summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhao Yakui <yakui.zhao@intel.com>2009-06-10 11:17:26 +0800
committerZhenyu Wang <zhenyu.z.wang@intel.com>2009-06-16 11:27:18 +0800
commit115e28639fbf6a1eba636dafac02fadd83036c75 (patch)
tree2ff78d19f4c4e480a907019060052f19964f40d3
parent3da549f5b350dd42516e5cb3576f7fefe012d95e (diff)
Add the private data for the LVDS connector
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. http://bugs.freedesktop.org/show_bug.cgi?id=20801 http://bugs.freedesktop.org/show_bug.cgi?id=21094 http://bugs.freedesktop.org/show_bug.cgi?id=21346 http://bugs.freedesktop.org/show_bug.cgi?id=21417 http://bugs.freedesktop.org/show_bug.cgi?id=21671 Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
-rw-r--r--src/drmmode_display.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 24e0e269..c9e15a45 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -58,6 +58,10 @@ typedef struct {
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 @@ typedef struct {
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 @@ drmmode_output_destroy(xf86OutputPtr output)
}
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 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num)
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;