* [bug] drmfb does not set physical screen dimensions
@ 2011-05-09 18:08 Roger Leigh
0 siblings, 0 replies; only message in thread
From: Roger Leigh @ 2011-05-09 18:08 UTC (permalink / raw)
To: dri-devel, linux-fbdev, David Airlie
[-- Attachment #1: Type: text/plain, Size: 3331 bytes --]
Hi,
drivers/gpu/drm/drm_fb_helper.c is not setting width and height
in struct fb_var_screeninfo. drm_fb_helper_fill_var sets them to -1
rather than using the real values:
info->var.height = -1;
info->var.width = -1;
Since the physical dimensions are most likely known from the monitor
EDID, it would be ideal if this could be set here. If not, it might
be nice to assume a default of 96dpi and compute the size based upon
the current resolution (so applications don't need to implement
fallbacks when unset). On my hardware the radeon driver certainly
does have this information.
This information is needed in order to do accurate font rendering and
drawing. It's available in X, and it would be great if it was also
available using the framebuffer.
I've also attached a small patch to fbset to allow reporting of the
current state in fb_var_screeninfo such as resolution, size, depth etc.
Could be extended to report more info if desired.
I'm not entirely sure who is best to submit this to, so my apologies
if this is not you.
I've included the dri and fbdev lists because I'm not sure if it's
specific to the drmfb code or the generic framebuffer code. Likewise
if you set a default 96dpi size, I'm not sure if it's a generic issue
or specific to drmfb.
Thanks,
Roger
diff -urN /tmp/fbset-2.1/fbset.c ./fbset.c
--- /tmp/fbset-2.1/fbset.c 2011-05-09 18:47:47.000000000 +0100
+++ ./fbset.c 2011-05-09 18:46:32.142945642 +0100
@@ -281,7 +281,8 @@
static struct VideoMode *FindVideoMode(const char *name);
static void ModifyVideoMode(struct VideoMode *vmode);
static void DisplayVModeInfo(struct VideoMode *vmode);
-static void DisplayFBInfo(struct fb_fix_screeninfo *fix);
+static void DisplayFBInfo(struct fb_fix_screeninfo *fix,
+ struct fb_var_screeninfo *var);
static int FillScanRates(struct VideoMode *vmode);
static void Usage(void) __attribute__ ((noreturn));
int main(int argc, char *argv[]);
@@ -758,7 +759,8 @@
* Display the Frame Buffer Device Information
*/
-static void DisplayFBInfo(struct fb_fix_screeninfo *fix)
+static void DisplayFBInfo(struct fb_fix_screeninfo *fix,
+ struct fb_var_screeninfo *var)
{
int i;
@@ -845,6 +847,16 @@
puts(Accelerators[i].name);
else
printf("Unknown (%d)\n", fix->accel);
+
+ printf(" Dimensions : %dx%d pixels", var->xres, var->yres);
+ if (var->width != -1 && var->height != -1)
+ printf(" (%dx%d mm)", var->width, var->height);
+ putc('\n', stdout);
+ printf(" Virtual : %dx%d pixels\n", var->xres_virtual, var->yres_virtual);
+ printf(" Offset : %dx%d pixels\n", var->xoffset, var->yoffset);
+ printf(" Bits/Pixel : %d\n", var->bits_per_pixel);
+ if (var->grayscale)
+ printf(" Graylevels : %d\n", var->grayscale);
}
@@ -1101,7 +1113,7 @@
if (Opt_verbose)
puts("Getting further frame buffer information");
GetFixScreenInfo(fh, &fix);
- DisplayFBInfo(&fix);
+ DisplayFBInfo(&fix, &var);
}
/*
--
.''`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/
`- GPG Public Key: 0x25BFB848 Please GPG sign your mail.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-05-09 18:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-09 18:08 [bug] drmfb does not set physical screen dimensions Roger Leigh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).