Add the private data when the connector type is LVDS. 
We can use the private_data to store the LVDS panel limit.
For example: Hdisplay, Vdisplay  

Signed-off-by: Zhao Yakui <yakui.z...@intel.com>
---
 src/drmmode_display.c |   24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

Index: xf86_video_intel/src/drmmode_display.c
===================================================================
--- xf86_video_intel.orig/src/drmmode_display.c 2009-05-21 09:23:10.000000000 
+0800
+++ xf86_video_intel/src/drmmode_display.c      2009-05-21 11:39:38.000000000 
+0800
@@ -58,6 +58,10 @@
     Atom *atoms;
 } drmmode_prop_rec, *drmmode_prop_ptr;
 
+struct fixed_panel_lvds {
+       int hdisplay;
+       int vdisplay;
+};
 typedef struct {
     drmmode_ptr drmmode;
     int output_id;
@@ -66,6 +70,8 @@
     drmModePropertyBlobPtr edid_blob;
     int num_props;
     drmmode_prop_ptr props;
+       void *private_data;
+       /* this is used to store private data */
 } drmmode_output_private_rec, *drmmode_output_private_ptr;
 
 static void
@@ -529,6 +535,10 @@
        }
        xfree(drmmode_output->props);
        drmModeFreeConnector(drmmode_output->mode_output);
+       if (drmmode_output->private_data) {
+               xfree(drmmode_output->private_data);
+               drmmode_output->private_data = NULL;
+       }
        xfree(drmmode_output);
        output->driver_private = NULL;
 }
@@ -792,7 +802,19 @@
                drmModeFreeEncoder(kencoder);
                return;
        }
-
+       /*
+        * If the connector type of the output device is LVDS, we will
+        * allocate the private_data to store the panel limit.
+        * For example: hdisplay, vdisplay
+        */
+       drmmode_output->private_data = NULL;
+       if (koutput->connector_type ==  DRM_MODE_CONNECTOR_LVDS) {
+               drmmode_output->private_data = xcalloc(
+                               sizeof(struct fixed_panel_lvds), 1);
+               if (!drmmode_output->private_data)
+                       xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+                               "Can't allocate private memory for LVDS.\n");
+       }
        drmmode_output->output_id = drmmode->mode_res->connectors[num];
        drmmode_output->mode_output = koutput;
        drmmode_output->mode_encoder = kencoder;



------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to