Hi,

guessing i'm not the only one wondering about these sizes, as w/current
snapshot the font does seem too big for me(on 2560x1440 display, for
which radeondrm(4) has never gotten the size right(giving only 1920x1200)).

display.part of wsconsctl output w/the diff:
display.type=radeondrm
display.width=1920
display.height=1200
display.depth=32
display.emulations=vt100
display.col_x_row=120x37
display.font_wxh=16x32
display.screentypes=std
display.focus=4
display.screen_on=250
display.screen_off=0
display.vblank=off
display.kbdact=on
display.msact=on
display.outact=on

lazy(=ugly) not-so-minimal diff below.

-Artturi


diff --git a/sbin/wsconsctl/display.c b/sbin/wsconsctl/display.c
index 6f789291142..9927a9d77c5 100644
--- a/sbin/wsconsctl/display.c
+++ b/sbin/wsconsctl/display.c
@@ -42,6 +42,7 @@
 
 u_int dpytype;
 u_int width, height, depth;
+u_int cxr[2], fontwxh[2];
 int focus;
 struct field_pc brightness, contrast, backlight;
 int burnon, burnoff, vblank, kbdact, msact, outact;
@@ -55,6 +56,8 @@ struct field display_field_tab[] = {
     { "height",                &height,        FMT_UINT,       FLG_RDONLY },
     { "depth",         &depth,         FMT_UINT,       FLG_RDONLY },
     { "emulations",    &emuls,         FMT_EMUL,       FLG_RDONLY },
+    { "col_x_row",     &cxr,           FMT_UINTX,      FLG_RDONLY },
+    { "font_wxh",      &fontwxh,       FMT_UINTX,      FLG_RDONLY },
     { "screentypes",   &screens,       FMT_SCREEN,     FLG_RDONLY },
     { "focus",         &focus,         FMT_INT,        FLG_NORDBACK },
     { "brightness",    &brightness,    FMT_PC,         FLG_MODIFY|FLG_INIT },
@@ -85,6 +88,7 @@ display_get_values(int fd)
        void *ptr;
        unsigned long cmd;
        int bon = 0, fbon = 0;
+       int fson = 0;
 
        focus = gscr.idx = -1;
        for (pf = display_field_tab; pf->name; pf++) {
@@ -102,6 +106,10 @@ display_get_values(int fd)
                } else if (ptr == &emuls) {
                        fillioctl(WSDISPLAYIO_GETEMULTYPE);
                        emuls.idx=0;
+               } else if (ptr == &cxr || ptr == &fontwxh) {
+                       fillioctl(WSDISPLAYIO_GETSCREENTYPE);
+                       ptr = &screens;
+                       screens.idx = 0;
                } else if (ptr == &screens) {
                        fillioctl(WSDISPLAYIO_GETSCREENTYPE);
                        screens.idx=0;
@@ -168,6 +176,13 @@ display_get_values(int fd)
                        emuls.idx=fd;
                } else if (ptr == &screens) {
                        screens.idx=fd;
+                       if (!fson) {
+                               cxr[0] = screens.ncols;
+                               cxr[1] = screens.nrows;
+                               fontwxh[0] = screens.fontwidth;
+                               fontwxh[1] = screens.fontheight;
+                       }
+                       fson++;
                } else if (ptr == &param) {
                        struct field_pc *pc = pf->valp;
 
diff --git a/sbin/wsconsctl/util.c b/sbin/wsconsctl/util.c
index b0ac4b3e23f..071baf31f85 100644
--- a/sbin/wsconsctl/util.c
+++ b/sbin/wsconsctl/util.c
@@ -186,6 +186,7 @@ int name2int(char *, const struct nameint *, int);
 void print_kmap(struct wskbd_map_data *);
 void print_emul(struct wsdisplay_emultype *);
 void print_screen(struct wsdisplay_screentype *);
+void print_uintx(u_int *);
 
 struct field *
 field_by_name(struct field *field_tab, char *name)
@@ -316,6 +317,9 @@ pr_field(const char *pre, struct field *f, const char *sep)
        case FMT_CFG:
                mousecfg_pr_field((struct wsmouse_parameters *) f->valp);
                break;
+       case FMT_UINTX:
+               print_uintx((u_int *) f->valp);
+               break;
        default:
                errx(1, "internal error: pr_field: no format %d", f->format);
                break;
@@ -551,3 +555,9 @@ print_screen(struct wsdisplay_screentype *screens)
                i = ioctl(fd, WSDISPLAYIO_GETSCREENTYPE, &s);
        }
 }
+
+void
+print_uintx(u_int *ux)
+{
+       printf("%ux%u", ux[0], ux[1]);
+}
diff --git a/sbin/wsconsctl/wsconsctl.h b/sbin/wsconsctl/wsconsctl.h
index 3a6e38d67e2..93d42ed600a 100644
--- a/sbin/wsconsctl/wsconsctl.h
+++ b/sbin/wsconsctl/wsconsctl.h
@@ -49,6 +49,7 @@ struct field {
 #define FMT_SCREEN     108             /* wsdisplay screen types */
 #define FMT_STRING     109             /* free string */
 #define FMT_CFG                201             /* wsmouse parameters */
+#define FMT_UINTX      202             /* u_int x u_int */
        int format;
 #define FLG_RDONLY     0x0001          /* variable cannot be modified */
 #define FLG_WRONLY     0x0002          /* variable cannot be displayed */

Reply via email to