summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Salomon <dilinger@queued.net>2008-11-26 01:39:28 -0500
committerJordan Crouse <jordan@cosmicpenguin.net>2008-11-26 09:08:53 -0700
commit8080f7a01cf62a13c5a32013668b2796c23d97a4 (patch)
treee8753aa7518c07a316b9d803c860ccd52e78f7b7
parentf57f2bd7161d4a7c2ededfc43a7709fb06213b99 (diff)
xf86-video-geode: DCON: set the default (physical) screen size if we detect a DCON
We can be assured that a DCON device has an OLPC panel that's 152x114 mm. This adds fields to GeodeRec to allow other panels to potentially override physical width/height fields, and also allows xorg.conf to override the values. Signed-off-by: Andres Salomon <dilinger@debian.org>
-rw-r--r--src/geode.h2
-rw-r--r--src/geode_dcon.c6
-rw-r--r--src/lx_output.c11
3 files changed, 19 insertions, 0 deletions
diff --git a/src/geode.h b/src/geode.h
index e748ec6..37bee2e 100644
--- a/src/geode.h
+++ b/src/geode.h
@@ -196,6 +196,8 @@ typedef struct _geodeRec
Bool tryCompression;
Bool tryHWCursor;
+ int mm_width, mm_height; /* physical display size */
+
unsigned long CursorStartOffset;
int Pitch; /* display FB pitch */
diff --git a/src/geode_dcon.c b/src/geode_dcon.c
index 0baa178..13e5fd2 100644
--- a/src/geode_dcon.c
+++ b/src/geode_dcon.c
@@ -92,6 +92,9 @@ dcon_init(ScrnInfoPtr pScrni)
{
GeodeRec *pGeode = GEODEPTR(pScrni);
+ pGeode->mm_width = 0;
+ pGeode->mm_height = 0;
+
if (!dcon_present()) {
xf86DrvMsg(pScrni->scrnIndex, X_DEFAULT, "No DCON is present\n");
return FALSE;
@@ -115,6 +118,9 @@ dcon_init(ScrnInfoPtr pScrni)
pGeode->panelMode->VTotal = 912;
pGeode->panelMode->Flags = V_NHSYNC | V_NVSYNC;
+ pGeode->mm_width = 152;
+ pGeode->mm_height = 114;
+
xf86SetModeDefaultName(pGeode->panelMode);
/* TODO: Print board revision once sysfs exports it. */
diff --git a/src/lx_output.c b/src/lx_output.c
index 53a538a..5508477 100644
--- a/src/lx_output.c
+++ b/src/lx_output.c
@@ -249,6 +249,7 @@ LXSetupOutput(ScrnInfoPtr pScrni)
{
xf86OutputPtr output;
LXOutputPrivatePtr lxpriv;
+ GeodePtr pGeode = GEODEPTR(pScrni);
output = xf86OutputCreate(pScrni, &lx_output_funcs, "default");
@@ -267,6 +268,16 @@ LXSetupOutput(ScrnInfoPtr pScrni)
GeodeI2CInit(pScrni, &lxpriv->pDDCBus, "CS5536 DDC");
+ if (pScrni->monitor->widthmm && pScrni->monitor->heightmm) {
+ /* prioritize the admin's screen size */
+ output->mm_width = pScrni->monitor->widthmm;
+ output->mm_height = pScrni->monitor->heightmm;
+ } else if (pGeode->mm_width && pGeode->mm_height) {
+ /* if we have a panel that we're certain of the size of, set it */
+ output->mm_width = pScrni->monitor->widthmm = pGeode->mm_width;
+ output->mm_height = pScrni->monitor->heightmm = pGeode->mm_height;
+ }
+
/* We only have one CRTC, and this output is tied to it */
output->possible_crtcs = 1;
}