[Intel-gfx] [PATCH 1/6] drm/i915: Split up struct drm_i915_private

Richard Purdie rpurdie at linux.intel.com
Wed May 13 16:02:50 CEST 2009


struct drm_i915_private is rather large and covers several different 
functional blocks. This patch separates out the "Display Controller"
part of that structure into a new struct intel_vdc_private which
will ultimately allow the VDC code to be used by other drivers.

This patch also necessitates that struct drm_device changes to a 
pointer to the vdc structure, not the i915 one so the container_of 
macro is used to get the i915_private structure back where needed.

Signed-off-by: Richard Purdie <rpurdie at linux.intel.com>

Index: git/drivers/gpu/drm/i915/intel_tv.c
===================================================================
--- git.orig/drivers/gpu/drm/i915/intel_tv.c	2009-05-12 20:59:37.000000000 +0100
+++ git/drivers/gpu/drm/i915/intel_tv.c	2009-05-13 10:51:08.000000000 +0100
@@ -902,7 +902,7 @@
 intel_tv_dpms(struct drm_encoder *encoder, int mode)
 {
 	struct drm_device *dev = encoder->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 
 	switch(mode) {
 	case DRM_MODE_DPMS_ON:
@@ -920,7 +920,7 @@
 intel_tv_save(struct drm_connector *connector)
 {
 	struct drm_device *dev = connector->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct intel_output *intel_output = to_intel_output(connector);
 	struct intel_tv_priv *tv_priv = intel_output->dev_priv;
 	int i;
@@ -970,7 +970,7 @@
 intel_tv_restore(struct drm_connector *connector)
 {
 	struct drm_device *dev = connector->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct intel_output *intel_output = to_intel_output(connector);
 	struct intel_tv_priv *tv_priv = intel_output->dev_priv;
 	struct drm_crtc *crtc = connector->encoder->crtc;
@@ -1117,7 +1117,7 @@
 		  struct drm_display_mode *adjusted_mode)
 {
 	struct drm_device *dev = encoder->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct drm_crtc *crtc = encoder->crtc;
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	struct intel_output *intel_output = enc_to_intel_output(encoder);
@@ -1366,7 +1366,8 @@
 {
 	struct drm_encoder *encoder = &intel_output->enc;
 	struct drm_device *dev = encoder->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
+	struct intel_vdc_private *vdc = dev->dev_private;
 	unsigned long irqflags;
 	u32 tv_ctl, save_tv_ctl;
 	u32 tv_dac, save_tv_dac;
@@ -1653,7 +1654,8 @@
 void
 intel_tv_init(struct drm_device *dev)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct drm_connector *connector;
 	struct intel_output *intel_output;
 	struct intel_tv_priv *tv_priv;
@@ -1665,7 +1667,7 @@
 		return;
 
 	/* Even if we have an encoder we may not have a connector */
-	if (!dev_priv->int_tv_support)
+	if (!dev_priv->vdc.int_tv_support)
 		return;
 
 	/*
Index: git/drivers/gpu/drm/i915/intel_i2c.c
===================================================================
--- git.orig/drivers/gpu/drm/i915/intel_i2c.c	2009-05-12 20:59:37.000000000 +0100
+++ git/drivers/gpu/drm/i915/intel_i2c.c	2009-05-13 10:51:08.000000000 +0100
@@ -43,7 +43,7 @@
 static int get_clock(void *data)
 {
 	struct intel_i2c_chan *chan = data;
-	struct drm_i915_private *dev_priv = chan->drm_dev->dev_private;
+	struct intel_vdc_private *vdc = chan->drm_dev->dev_private;
 	u32 val;
 
 	val = I915_READ(chan->reg);
@@ -53,7 +53,7 @@
 static int get_data(void *data)
 {
 	struct intel_i2c_chan *chan = data;
-	struct drm_i915_private *dev_priv = chan->drm_dev->dev_private;
+	struct intel_vdc_private *vdc = chan->drm_dev->dev_private;
 	u32 val;
 
 	val = I915_READ(chan->reg);
@@ -64,7 +64,7 @@
 {
 	struct intel_i2c_chan *chan = data;
 	struct drm_device *dev = chan->drm_dev;
-	struct drm_i915_private *dev_priv = chan->drm_dev->dev_private;
+	struct intel_vdc_private *vdc = chan->drm_dev->dev_private;
 	u32 reserved = 0, clock_bits;
 
 	/* On most chips, these bits must be preserved in software. */
@@ -85,7 +85,7 @@
 {
 	struct intel_i2c_chan *chan = data;
 	struct drm_device *dev = chan->drm_dev;
-	struct drm_i915_private *dev_priv = chan->drm_dev->dev_private;
+	struct intel_vdc_private *vdc = chan->drm_dev->dev_private;
 	u32 reserved = 0, data_bits;
 
 	/* On most chips, these bits must be preserved in software. */
Index: git/drivers/gpu/drm/i915/intel_dvo.c
===================================================================
--- git.orig/drivers/gpu/drm/i915/intel_dvo.c	2009-05-12 20:59:37.000000000 +0100
+++ git/drivers/gpu/drm/i915/intel_dvo.c	2009-05-13 10:51:08.000000000 +0100
@@ -78,7 +78,7 @@
 
 static void intel_dvo_dpms(struct drm_encoder *encoder, int mode)
 {
-	struct drm_i915_private *dev_priv = encoder->dev->dev_private;
+	struct intel_vdc_private *vdc = encoder->dev->dev_private;
 	struct intel_output *intel_output = enc_to_intel_output(encoder);
 	struct intel_dvo_device *dvo = intel_output->dev_priv;
 	u32 dvo_reg = dvo->dvo_reg;
@@ -97,31 +97,31 @@
 
 static void intel_dvo_save(struct drm_connector *connector)
 {
-	struct drm_i915_private *dev_priv = connector->dev->dev_private;
+	struct intel_vdc_private *vdc = connector->dev->dev_private;
 	struct intel_output *intel_output = to_intel_output(connector);
 	struct intel_dvo_device *dvo = intel_output->dev_priv;
 
 	/* Each output should probably just save the registers it touches,
 	 * but for now, use more overkill.
 	 */
-	dev_priv->saveDVOA = I915_READ(DVOA);
-	dev_priv->saveDVOB = I915_READ(DVOB);
-	dev_priv->saveDVOC = I915_READ(DVOC);
+	vdc->saveDVOA = I915_READ(DVOA);
+	vdc->saveDVOB = I915_READ(DVOB);
+	vdc->saveDVOC = I915_READ(DVOC);
 
 	dvo->dev_ops->save(dvo);
 }
 
 static void intel_dvo_restore(struct drm_connector *connector)
 {
-	struct drm_i915_private *dev_priv = connector->dev->dev_private;
+	struct intel_vdc_private *vdc = connector->dev->dev_private;
 	struct intel_output *intel_output = to_intel_output(connector);
 	struct intel_dvo_device *dvo = intel_output->dev_priv;
 
 	dvo->dev_ops->restore(dvo);
 
-	I915_WRITE(DVOA, dev_priv->saveDVOA);
-	I915_WRITE(DVOB, dev_priv->saveDVOB);
-	I915_WRITE(DVOC, dev_priv->saveDVOC);
+	I915_WRITE(DVOA, vdc->saveDVOA);
+	I915_WRITE(DVOB, vdc->saveDVOB);
+	I915_WRITE(DVOC, vdc->saveDVOC);
 }
 
 static int intel_dvo_mode_valid(struct drm_connector *connector,
@@ -183,7 +183,7 @@
 			       struct drm_display_mode *adjusted_mode)
 {
 	struct drm_device *dev = encoder->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
 	struct intel_output *intel_output = enc_to_intel_output(encoder);
 	struct intel_dvo_device *dvo = intel_output->dev_priv;
@@ -298,7 +298,6 @@
 static struct drm_crtc *intel_dvo_get_crtc(struct drm_connector *connector)
 {
 	struct drm_device *dev = connector->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct intel_output *intel_output = to_intel_output(connector);
 	struct intel_dvo_device *dvo = intel_output->dev_priv;
 	int pipe = !!(I915_READ(dvo->dvo_reg) & SDVO_PIPE_B_SELECT);
@@ -349,7 +348,7 @@
 intel_dvo_get_current_mode (struct drm_connector *connector)
 {
 	struct drm_device *dev = connector->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct intel_output *intel_output = to_intel_output(connector);
 	struct intel_dvo_device *dvo = intel_output->dev_priv;
 	uint32_t dvo_reg = dvo->dvo_reg;
Index: git/drivers/gpu/drm/i915/intel_hdmi.c
===================================================================
--- git.orig/drivers/gpu/drm/i915/intel_hdmi.c	2009-05-12 20:59:37.000000000 +0100
+++ git/drivers/gpu/drm/i915/intel_hdmi.c	2009-05-13 10:51:08.000000000 +0100
@@ -46,7 +46,7 @@
 				struct drm_display_mode *adjusted_mode)
 {
 	struct drm_device *dev = encoder->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct drm_crtc *crtc = encoder->crtc;
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	struct intel_output *intel_output = enc_to_intel_output(encoder);
@@ -71,7 +71,7 @@
 static void intel_hdmi_dpms(struct drm_encoder *encoder, int mode)
 {
 	struct drm_device *dev = encoder->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct intel_output *intel_output = enc_to_intel_output(encoder);
 	struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv;
 	u32 temp;
@@ -89,7 +89,7 @@
 static void intel_hdmi_save(struct drm_connector *connector)
 {
 	struct drm_device *dev = connector->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct intel_output *intel_output = to_intel_output(connector);
 	struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv;
 
@@ -99,7 +99,7 @@
 static void intel_hdmi_restore(struct drm_connector *connector)
 {
 	struct drm_device *dev = connector->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct intel_output *intel_output = to_intel_output(connector);
 	struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv;
 
@@ -148,7 +148,7 @@
 intel_hdmi_detect(struct drm_connector *connector)
 {
 	struct drm_device *dev = connector->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct intel_output *intel_output = to_intel_output(connector);
 	struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv;
 	u32 temp, bit;
@@ -237,7 +237,7 @@
 
 void intel_hdmi_init(struct drm_device *dev, int sdvox_reg)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct drm_connector *connector;
 	struct intel_output *intel_output;
 	struct intel_hdmi_priv *hdmi_priv;
Index: git/drivers/gpu/drm/i915/i915_suspend.c
===================================================================
--- git.orig/drivers/gpu/drm/i915/i915_suspend.c	2009-05-12 20:59:37.000000000 +0100
+++ git/drivers/gpu/drm/i915/i915_suspend.c	2009-05-13 10:51:08.000000000 +0100
@@ -31,7 +31,7 @@
 
 static bool i915_pipe_enabled(struct drm_device *dev, enum pipe pipe)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 
 	if (pipe == PIPE_A)
 		return (I915_READ(DPLL_A) & DPLL_VCO_ENABLE);
@@ -41,7 +41,7 @@
 
 static void i915_save_palette(struct drm_device *dev, enum pipe pipe)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	unsigned long reg = (pipe == PIPE_A ? PALETTE_A : PALETTE_B);
 	u32 *array;
 	int i;
@@ -50,9 +50,9 @@
 		return;
 
 	if (pipe == PIPE_A)
-		array = dev_priv->save_palette_a;
+		array = vdc->save_palette_a;
 	else
-		array = dev_priv->save_palette_b;
+		array = vdc->save_palette_b;
 
 	for(i = 0; i < 256; i++)
 		array[i] = I915_READ(reg + (i << 2));
@@ -60,7 +60,7 @@
 
 static void i915_restore_palette(struct drm_device *dev, enum pipe pipe)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	unsigned long reg = (pipe == PIPE_A ? PALETTE_A : PALETTE_B);
 	u32 *array;
 	int i;
@@ -69,9 +69,9 @@
 		return;
 
 	if (pipe == PIPE_A)
-		array = dev_priv->save_palette_a;
+		array = vdc->save_palette_a;
 	else
-		array = dev_priv->save_palette_b;
+		array = vdc->save_palette_b;
 
 	for(i = 0; i < 256; i++)
 		I915_WRITE(reg + (i << 2), array[i]);
@@ -79,7 +79,7 @@
 
 static u8 i915_read_indexed(struct drm_device *dev, u16 index_port, u16 data_port, u8 reg)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 
 	I915_WRITE8(index_port, reg);
 	return I915_READ8(data_port);
@@ -87,7 +87,7 @@
 
 static u8 i915_read_ar(struct drm_device *dev, u16 st01, u8 reg, u16 palette_enable)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 
 	I915_READ8(st01);
 	I915_WRITE8(VGA_AR_INDEX, palette_enable | reg);
@@ -96,7 +96,7 @@
 
 static void i915_write_ar(struct drm_device *dev, u16 st01, u8 reg, u8 val, u16 palette_enable)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 
 	I915_READ8(st01);
 	I915_WRITE8(VGA_AR_INDEX, palette_enable | reg);
@@ -105,7 +105,7 @@
 
 static void i915_write_indexed(struct drm_device *dev, u16 index_port, u16 data_port, u8 reg, u8 val)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 
 	I915_WRITE8(index_port, reg);
 	I915_WRITE8(data_port, val);
@@ -113,7 +113,8 @@
 
 static void i915_save_vga(struct drm_device *dev)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
+	struct intel_vdc_private *dev_priv = dev->dev_private;
 	int i;
 	u16 cr_index, cr_data, st01;
 
@@ -171,7 +172,8 @@
 
 static void i915_restore_vga(struct drm_device *dev)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
+	struct intel_vdc_private *dev_priv = dev->dev_private;
 	int i;
 	u16 cr_index, cr_data, st01;
 
@@ -224,7 +226,8 @@
 
 int i915_save_state(struct drm_device *dev)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
+	struct intel_vdc_private *dev_priv = dev->dev_private;
 	int i;
 
 	pci_read_config_byte(dev->pdev, LBB, &dev_priv->saveLBB);
@@ -368,7 +371,8 @@
 
 int i915_restore_state(struct drm_device *dev)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
+	struct intel_vdc_private *dev_priv = dev->dev_private;
 	int i;
 
 	pci_write_config_byte(dev->pdev, LBB, dev_priv->saveLBB);
Index: git/drivers/gpu/drm/i915/i915_opregion.c
===================================================================
--- git.orig/drivers/gpu/drm/i915/i915_opregion.c	2009-05-12 20:59:37.000000000 +0100
+++ git/drivers/gpu/drm/i915/i915_opregion.c	2009-05-13 11:15:21.000000000 +0100
@@ -145,7 +145,8 @@
 
 static u32 asle_set_backlight(struct drm_device *dev, u32 bclp)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct opregion_asle *asle = dev_priv->opregion.asle;
 	u32 blc_pwm_ctl, blc_pwm_ctl2;
 
@@ -179,7 +180,8 @@
 
 static u32 asle_set_pwm_freq(struct drm_device *dev, u32 pfmb)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
+
 	if (pfmb & ASLE_PFMB_PWM_VALID) {
 		u32 blc_pwm_ctl = I915_READ(BLC_PWM_CTL);
 		u32 pwm = pfmb & ASLE_PFMB_PWM_MASK;
@@ -201,7 +203,7 @@
 
 void opregion_asle_intr(struct drm_device *dev)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct opregion_asle *asle = dev_priv->opregion.asle;
 	u32 asle_stat = 0;
 	u32 asle_req;
@@ -238,7 +240,7 @@
 
 void opregion_enable_asle(struct drm_device *dev)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct opregion_asle *asle = dev_priv->opregion.asle;
 
 	if (asle) {
@@ -297,7 +299,7 @@
 
 static void intel_didl_outputs(struct drm_device *dev)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct intel_opregion *opregion = &dev_priv->opregion;
 	struct drm_connector *connector;
 	int i = 0;
@@ -342,7 +344,7 @@
 
 int intel_opregion_init(struct drm_device *dev, int resume)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct intel_opregion *opregion = &dev_priv->opregion;
 	void *base;
 	u32 asls, mboxes;
@@ -412,7 +414,7 @@
 
 void intel_opregion_free(struct drm_device *dev, int suspend)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct intel_opregion *opregion = &dev_priv->opregion;
 
 	if (!opregion->enabled)
Index: git/drivers/gpu/drm/i915/i915_gem.c
===================================================================
--- git.orig/drivers/gpu/drm/i915/i915_gem.c	2009-05-12 20:59:37.000000000 +0100
+++ git/drivers/gpu/drm/i915/i915_gem.c	2009-05-13 11:26:19.000000000 +0100
@@ -56,7 +56,7 @@
 int i915_gem_do_init(struct drm_device *dev, unsigned long start,
 		     unsigned long end)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 
 	if (start >= end ||
 	    (start & (PAGE_SIZE - 1)) != 0 ||
@@ -157,7 +157,7 @@
 
 static int i915_gem_object_needs_bit17_swizzle(struct drm_gem_object *obj)
 {
-	drm_i915_private_t *dev_priv = obj->dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(obj->dev->dev_private);
 	struct drm_i915_gem_object *obj_priv = obj->driver_private;
 
 	return dev_priv->mm.bit_6_swizzle_x == I915_BIT_6_SWIZZLE_9_10_17 &&
@@ -554,7 +554,7 @@
 			 struct drm_file *file_priv)
 {
 	struct drm_i915_gem_object *obj_priv = obj->driver_private;
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	ssize_t remain;
 	loff_t offset, page_base;
 	char __user *user_data;
@@ -628,7 +628,7 @@
 			 struct drm_file *file_priv)
 {
 	struct drm_i915_gem_object *obj_priv = obj->driver_private;
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	ssize_t remain;
 	loff_t gtt_page_base, offset;
 	loff_t first_data_page, last_data_page, num_pages;
@@ -1126,7 +1126,7 @@
 {
 	struct drm_gem_object *obj = vma->vm_private_data;
 	struct drm_device *dev = obj->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_i915_gem_object *obj_priv = obj->driver_private;
 	pgoff_t page_offset;
 	unsigned long pfn;
@@ -1327,7 +1327,7 @@
 			struct drm_file *file_priv)
 {
 	struct drm_i915_gem_mmap_gtt *args = data;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_gem_object *obj;
 	struct drm_i915_gem_object *obj_priv;
 	int ret;
@@ -1418,7 +1418,7 @@
 i915_gem_object_move_to_active(struct drm_gem_object *obj, uint32_t seqno)
 {
 	struct drm_device *dev = obj->dev;
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_i915_gem_object *obj_priv = obj->driver_private;
 
 	/* Add a reference if we're newly entering the active list. */
@@ -1438,7 +1438,7 @@
 i915_gem_object_move_to_flushing(struct drm_gem_object *obj)
 {
 	struct drm_device *dev = obj->dev;
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_i915_gem_object *obj_priv = obj->driver_private;
 
 	BUG_ON(!obj_priv->active);
@@ -1450,7 +1450,7 @@
 i915_gem_object_move_to_inactive(struct drm_gem_object *obj)
 {
 	struct drm_device *dev = obj->dev;
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_i915_gem_object *obj_priv = obj->driver_private;
 
 	i915_verify_inactive(dev, __FILE__, __LINE__);
@@ -1478,7 +1478,8 @@
 static uint32_t
 i915_add_request(struct drm_device *dev, uint32_t flush_domains)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct drm_i915_gem_request *request;
 	uint32_t seqno;
 	int was_empty;
@@ -1544,7 +1545,8 @@
 static uint32_t
 i915_retire_commands(struct drm_device *dev)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	uint32_t cmd = MI_FLUSH | MI_NO_WRITE_FLUSH;
 	uint32_t flush_domains = 0;
 	RING_LOCALS;
@@ -1567,7 +1569,7 @@
 i915_gem_retire_request(struct drm_device *dev,
 			struct drm_i915_gem_request *request)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 
 	/* Move any buffers on the active list that are no longer referenced
 	 * by the ringbuffer to the flushing/inactive lists as appropriate.
@@ -1626,7 +1628,7 @@
 uint32_t
 i915_get_gem_seqno(struct drm_device *dev)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 
 	return READ_HWSP(dev_priv, I915_GEM_HWS_INDEX);
 }
@@ -1637,7 +1639,7 @@
 void
 i915_gem_retire_requests(struct drm_device *dev)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	uint32_t seqno;
 
 	if (!dev_priv->hw_status_page)
@@ -1668,7 +1670,7 @@
 void
 i915_gem_retire_work_handler(struct work_struct *work)
 {
-	drm_i915_private_t *dev_priv;
+	struct drm_i915_private *dev_priv;
 	struct drm_device *dev;
 
 	dev_priv = container_of(work, drm_i915_private_t,
@@ -1690,7 +1692,7 @@
 static int
 i915_wait_request(struct drm_device *dev, uint32_t seqno)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	int ret = 0;
 
 	BUG_ON(seqno == 0);
@@ -1728,7 +1730,8 @@
 	       uint32_t invalidate_domains,
 	       uint32_t flush_domains)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	uint32_t cmd;
 	RING_LOCALS;
 
@@ -1899,7 +1902,7 @@
 static int
 i915_gem_evict_something(struct drm_device *dev)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_gem_object *obj;
 	struct drm_i915_gem_object *obj_priv;
 	int ret = 0;
@@ -2046,7 +2049,7 @@
 {
 	struct drm_gem_object *obj = reg->obj;
 	struct drm_device *dev = obj->dev;
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct drm_i915_gem_object *obj_priv = obj->driver_private;
 	int regnum = obj_priv->fence_reg;
 	uint64_t val;
@@ -2066,7 +2069,7 @@
 {
 	struct drm_gem_object *obj = reg->obj;
 	struct drm_device *dev = obj->dev;
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct drm_i915_gem_object *obj_priv = obj->driver_private;
 	int regnum = obj_priv->fence_reg;
 	int tile_width;
@@ -2108,8 +2111,8 @@
 {
 	struct drm_gem_object *obj = reg->obj;
 	struct drm_device *dev = obj->dev;
-	drm_i915_private_t *dev_priv = dev->dev_private;
 	struct drm_i915_gem_object *obj_priv = obj->driver_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	int regnum = obj_priv->fence_reg;
 	uint32_t val;
 	uint32_t pitch_val;
@@ -2155,7 +2158,7 @@
 i915_gem_object_get_fence_reg(struct drm_gem_object *obj, bool write)
 {
 	struct drm_device *dev = obj->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_i915_gem_object *obj_priv = obj->driver_private;
 	struct drm_i915_fence_reg *reg = NULL;
 	struct drm_i915_gem_object *old_obj_priv = NULL;
@@ -2283,7 +2286,8 @@
 i915_gem_clear_fence_reg(struct drm_gem_object *obj)
 {
 	struct drm_device *dev = obj->dev;
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct drm_i915_gem_object *obj_priv = obj->driver_private;
 
 	if (IS_I965G(dev))
@@ -2311,7 +2315,7 @@
 i915_gem_object_bind_to_gtt(struct drm_gem_object *obj, unsigned alignment)
 {
 	struct drm_device *dev = obj->dev;
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_i915_gem_object *obj_priv = obj->driver_private;
 	struct drm_mm_node *free_space;
 	int page_count, ret;
@@ -2847,7 +2851,7 @@
 				 struct drm_i915_gem_relocation_entry *relocs)
 {
 	struct drm_device *dev = obj->dev;
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_i915_gem_object *obj_priv = obj->driver_private;
 	int i, ret;
 	void __iomem *reloc_page;
@@ -3010,7 +3014,8 @@
 			      struct drm_clip_rect *cliprects,
 			      uint64_t exec_offset)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
+	struct intel_vdc_private *vdc = dev->dev_private;
 	int nbox = exec->num_cliprects;
 	int i = 0, count;
 	uint32_t	exec_start, exec_len;
@@ -3165,7 +3170,7 @@
 i915_gem_execbuffer(struct drm_device *dev, void *data,
 		    struct drm_file *file_priv)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_i915_file_private *i915_file_priv = file_priv->driver_priv;
 	struct drm_i915_gem_execbuffer *args = data;
 	struct drm_i915_gem_exec_object *exec_list = NULL;
@@ -3517,7 +3522,7 @@
 i915_gem_object_unpin(struct drm_gem_object *obj)
 {
 	struct drm_device *dev = obj->dev;
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_i915_gem_object *obj_priv = obj->driver_private;
 
 	i915_verify_inactive(dev, __FILE__, __LINE__);
@@ -3757,7 +3762,7 @@
 int
 i915_gem_idle(struct drm_device *dev)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	uint32_t seqno, cur_seqno, last_seqno;
 	int stuck, ret;
 
@@ -3871,7 +3876,8 @@
 static int
 i915_gem_init_hws(struct drm_device *dev)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct drm_gem_object *obj;
 	struct drm_i915_gem_object *obj_priv;
 	int ret;
@@ -3918,7 +3924,8 @@
 static void
 i915_gem_cleanup_hws(struct drm_device *dev)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct drm_gem_object *obj;
 	struct drm_i915_gem_object *obj_priv;
 
@@ -3943,7 +3950,8 @@
 int
 i915_gem_init_ringbuffer(struct drm_device *dev)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct drm_gem_object *obj;
 	struct drm_i915_gem_object *obj_priv;
 	drm_i915_ring_buffer_t *ring = &dev_priv->ring;
@@ -4053,7 +4061,7 @@
 void
 i915_gem_cleanup_ringbuffer(struct drm_device *dev)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 
 	if (dev_priv->ring.ring_obj == NULL)
 		return;
@@ -4072,7 +4080,7 @@
 i915_gem_entervt_ioctl(struct drm_device *dev, void *data,
 		       struct drm_file *file_priv)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	int ret;
 
 	if (drm_core_check_feature(dev, DRIVER_MODESET))
@@ -4137,7 +4145,7 @@
 void
 i915_gem_load(struct drm_device *dev)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 
 	spin_lock_init(&dev_priv->mm.active_list_lock);
 	INIT_LIST_HEAD(&dev_priv->mm.active_list);
@@ -4166,7 +4174,7 @@
 int i915_gem_init_phys_object(struct drm_device *dev,
 			      int id, int size)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_i915_gem_phys_object *phys_obj;
 	int ret;
 
@@ -4198,7 +4206,7 @@
 
 void i915_gem_free_phys_object(struct drm_device *dev, int id)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_i915_gem_phys_object *phys_obj;
 
 	if (!dev_priv->mm.phys_objs[id - 1])
@@ -4261,7 +4269,7 @@
 i915_gem_attach_phys_object(struct drm_device *dev,
 			    struct drm_gem_object *obj, int id)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_i915_gem_object *obj_priv;
 	int ret = 0;
 	int page_count;
Index: git/drivers/gpu/drm/i915/i915_gem_tiling.c
===================================================================
--- git.orig/drivers/gpu/drm/i915/i915_gem_tiling.c	2009-05-12 20:59:37.000000000 +0100
+++ git/drivers/gpu/drm/i915/i915_gem_tiling.c	2009-05-13 11:17:13.000000000 +0100
@@ -88,7 +88,8 @@
 void
 i915_gem_detect_bit_6_swizzle(struct drm_device *dev)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
+	struct intel_vdc_private *vdc = dev->dev_private;
 	uint32_t swizzle_x = I915_BIT_6_SWIZZLE_UNKNOWN;
 	uint32_t swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN;
 
@@ -266,7 +267,7 @@
 		   struct drm_file *file_priv)
 {
 	struct drm_i915_gem_set_tiling *args = data;
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_gem_object *obj;
 	struct drm_i915_gem_object *obj_priv;
 
@@ -342,7 +343,7 @@
 		   struct drm_file *file_priv)
 {
 	struct drm_i915_gem_get_tiling *args = data;
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_gem_object *obj;
 	struct drm_i915_gem_object *obj_priv;
 
@@ -411,7 +412,7 @@
 i915_gem_object_do_bit_17_swizzle(struct drm_gem_object *obj)
 {
 	struct drm_device *dev = obj->dev;
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_i915_gem_object *obj_priv = obj->driver_private;
 	int page_count = obj->size >> PAGE_SHIFT;
 	int i;
@@ -440,7 +441,7 @@
 i915_gem_object_save_bit_17_swizzle(struct drm_gem_object *obj)
 {
 	struct drm_device *dev = obj->dev;
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_i915_gem_object *obj_priv = obj->driver_private;
 	int page_count = obj->size >> PAGE_SHIFT;
 	int i;
Index: git/drivers/gpu/drm/i915/i915_irq.c
===================================================================
--- git.orig/drivers/gpu/drm/i915/i915_irq.c	2009-05-12 20:59:37.000000000 +0100
+++ git/drivers/gpu/drm/i915/i915_irq.c	2009-05-13 11:25:37.000000000 +0100
@@ -30,6 +30,7 @@
 #include "drm.h"
 #include "i915_drm.h"
 #include "i915_drv.h"
+#include "intel_vdc.h"
 #include "intel_drv.h"
 
 #define MAX_NOPID ((u32)~0)
@@ -60,6 +61,8 @@
 void
 i915_enable_irq(drm_i915_private_t *dev_priv, u32 mask)
 {
+	struct intel_vdc_private *vdc = &dev_priv->vdc;
+
 	if ((dev_priv->irq_mask_reg & mask) != 0) {
 		dev_priv->irq_mask_reg &= ~mask;
 		I915_WRITE(IMR, dev_priv->irq_mask_reg);
@@ -70,6 +73,8 @@
 static inline void
 i915_disable_irq(drm_i915_private_t *dev_priv, u32 mask)
 {
+	struct intel_vdc_private *vdc = &dev_priv->vdc;
+
 	if ((dev_priv->irq_mask_reg & mask) != mask) {
 		dev_priv->irq_mask_reg |= mask;
 		I915_WRITE(IMR, dev_priv->irq_mask_reg);
@@ -90,6 +95,8 @@
 void
 i915_enable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask)
 {
+	struct intel_vdc_private *vdc = &dev_priv->vdc;
+
 	if ((dev_priv->pipestat[pipe] & mask) != mask) {
 		u32 reg = i915_pipestat(pipe);
 
@@ -103,6 +110,8 @@
 void
 i915_disable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask)
 {
+	struct intel_vdc_private *vdc = &dev_priv->vdc;
+
 	if ((dev_priv->pipestat[pipe] & mask) != 0) {
 		u32 reg = i915_pipestat(pipe);
 
@@ -124,7 +133,7 @@
 static int
 i915_pipe_enabled(struct drm_device *dev, int pipe)
 {
-	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	unsigned long pipeconf = pipe ? PIPEBCONF : PIPEACONF;
 
 	if (I915_READ(pipeconf) & PIPEACONF_ENABLE)
@@ -138,7 +147,7 @@
  */
 u32 i915_get_vblank_counter(struct drm_device *dev, int pipe)
 {
-	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	unsigned long high_frame;
 	unsigned long low_frame;
 	u32 high1, high2, low, count;
@@ -172,7 +181,7 @@
 
 u32 gm45_get_vblank_counter(struct drm_device *dev, int pipe)
 {
-	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	int reg = pipe ? PIPEB_FRMCOUNT_GM45 : PIPEA_FRMCOUNT_GM45;
 
 	if (!i915_pipe_enabled(dev, pipe)) {
@@ -199,7 +208,8 @@
 irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
 {
 	struct drm_device *dev = (struct drm_device *) arg;
-	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct drm_i915_master_private *master_priv;
 	u32 iir, new_iir;
 	u32 pipea_stats, pipeb_stats;
@@ -319,7 +329,8 @@
 
 static int i915_emit_irq(struct drm_device * dev)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv;
 	RING_LOCALS;
 
@@ -345,7 +356,7 @@
 
 void i915_user_irq_get(struct drm_device *dev)
 {
-	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	unsigned long irqflags;
 
 	spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags);
@@ -356,7 +367,7 @@
 
 void i915_user_irq_put(struct drm_device *dev)
 {
-	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	unsigned long irqflags;
 
 	spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags);
@@ -368,7 +379,7 @@
 
 static int i915_wait_irq(struct drm_device * dev, int irq_nr)
 {
-	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv;
 	int ret = 0;
 
@@ -402,7 +413,7 @@
 int i915_irq_emit(struct drm_device *dev, void *data,
 			 struct drm_file *file_priv)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	drm_i915_irq_emit_t *emit = data;
 	int result;
 
@@ -430,7 +441,7 @@
 int i915_irq_wait(struct drm_device *dev, void *data,
 			 struct drm_file *file_priv)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	drm_i915_irq_wait_t *irqwait = data;
 
 	if (!dev_priv) {
@@ -446,7 +457,8 @@
  */
 int i915_enable_vblank(struct drm_device *dev, int pipe)
 {
-	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	unsigned long irqflags;
 	int pipeconf_reg = (pipe == 0) ? PIPEACONF : PIPEBCONF;
 	u32 pipeconf;
@@ -471,7 +483,7 @@
  */
 void i915_disable_vblank(struct drm_device *dev, int pipe)
 {
-	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	unsigned long irqflags;
 
 	spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags);
@@ -483,7 +495,7 @@
 
 void i915_enable_interrupt (struct drm_device *dev)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	opregion_enable_asle(dev);
 	dev_priv->irq_enabled = 1;
 }
@@ -494,7 +506,7 @@
 int i915_vblank_pipe_set(struct drm_device *dev, void *data,
 			 struct drm_file *file_priv)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 
 	if (!dev_priv) {
 		DRM_ERROR("called with no initialization\n");
@@ -507,7 +519,7 @@
 int i915_vblank_pipe_get(struct drm_device *dev, void *data,
 			 struct drm_file *file_priv)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	drm_i915_vblank_pipe_t *pipe = data;
 
 	if (!dev_priv) {
@@ -547,7 +559,8 @@
 */
 void i915_driver_irq_preinstall(struct drm_device * dev)
 {
-	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 
 	atomic_set(&dev_priv->irq_received, 0);
 
@@ -567,7 +580,8 @@
 
 int i915_driver_irq_postinstall(struct drm_device *dev)
 {
-	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
+	struct intel_vdc_private *vdc = dev->dev_private;
 	u32 enable_mask = I915_INTERRUPT_ENABLE_FIX | I915_INTERRUPT_ENABLE_VAR;
 
 	dev_priv->vblank_pipe = DRM_I915_VBLANK_PIPE_A | DRM_I915_VBLANK_PIPE_B;
@@ -620,7 +634,8 @@
 
 void i915_driver_irq_uninstall(struct drm_device * dev)
 {
-	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 
 	if (!dev_priv)
 		return;
Index: git/drivers/gpu/drm/i915/i915_gem_debug.c
===================================================================
--- git.orig/drivers/gpu/drm/i915/i915_gem_debug.c	2009-05-12 18:27:35.000000000 +0100
+++ git/drivers/gpu/drm/i915/i915_gem_debug.c	2009-05-13 10:51:08.000000000 +0100
@@ -34,7 +34,7 @@
 void
 i915_verify_inactive(struct drm_device *dev, char *file, int line)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_gem_object *obj;
 	struct drm_i915_gem_object *obj_priv;
 
@@ -101,8 +101,8 @@
 void
 i915_dump_lru(struct drm_device *dev, const char *where)
 {
-	drm_i915_private_t		*dev_priv = dev->dev_private;
-	struct drm_i915_gem_object	*obj_priv;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
+	struct drm_i915_gem_object *obj_priv;
 
 	DRM_INFO("active list %s {\n", where);
 	spin_lock(&dev_priv->mm.active_list_lock);
Index: git/drivers/gpu/drm/i915/i915_mem.c
===================================================================
--- git.orig/drivers/gpu/drm/i915/i915_mem.c	2009-05-12 18:27:35.000000000 +0100
+++ git/drivers/gpu/drm/i915/i915_mem.c	2009-05-13 10:51:08.000000000 +0100
@@ -45,7 +45,7 @@
  */
 static void mark_block(struct drm_device * dev, struct mem_block *p, int in_use)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv;
 	drm_i915_sarea_t *sarea_priv = master_priv->sarea_priv;
 	struct drm_tex_region *list;
@@ -272,7 +272,7 @@
 int i915_mem_alloc(struct drm_device *dev, void *data,
 		   struct drm_file *file_priv)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	drm_i915_mem_alloc_t *alloc = data;
 	struct mem_block *block, **heap;
 
@@ -310,7 +310,7 @@
 int i915_mem_free(struct drm_device *dev, void *data,
 		  struct drm_file *file_priv)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	drm_i915_mem_free_t *memfree = data;
 	struct mem_block *block, **heap;
 
@@ -338,7 +338,7 @@
 int i915_mem_init_heap(struct drm_device *dev, void *data,
 		       struct drm_file *file_priv)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	drm_i915_mem_init_heap_t *initheap = data;
 	struct mem_block **heap;
 
@@ -362,7 +362,7 @@
 int i915_mem_destroy_heap( struct drm_device *dev, void *data,
 			   struct drm_file *file_priv )
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	drm_i915_mem_destroy_heap_t *destroyheap = data;
 	struct mem_block **heap;
 
Index: git/drivers/gpu/drm/i915/i915_dma.c
===================================================================
--- git.orig/drivers/gpu/drm/i915/i915_dma.c	2009-05-12 20:59:38.000000000 +0100
+++ git/drivers/gpu/drm/i915/i915_dma.c	2009-05-13 11:25:10.000000000 +0100
@@ -40,7 +40,8 @@
  */
 int i915_wait_ring(struct drm_device * dev, int n, const char *caller)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	drm_i915_ring_buffer_t *ring = &(dev_priv->ring);
 	u32 acthd_reg = IS_I965G(dev) ? ACTHD_I965 : ACTHD;
 	u32 last_acthd = I915_READ(acthd_reg);
@@ -84,7 +85,8 @@
  */
 static int i915_init_phys_hws(struct drm_device *dev)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	/* Program Hardware Status Page */
 	dev_priv->status_page_dmah =
 		drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, 0xffffffff);
@@ -109,7 +111,8 @@
  */
 static void i915_free_hws(struct drm_device *dev)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
+	struct intel_vdc_private *vdc = dev->dev_private;
 	if (dev_priv->status_page_dmah) {
 		drm_pci_free(dev, dev_priv->status_page_dmah);
 		dev_priv->status_page_dmah = NULL;
@@ -126,7 +129,8 @@
 
 void i915_kernel_lost_context(struct drm_device * dev)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct drm_i915_master_private *master_priv;
 	drm_i915_ring_buffer_t *ring = &(dev_priv->ring);
 
@@ -153,7 +157,7 @@
 
 static int i915_dma_cleanup(struct drm_device * dev)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	/* Make sure interrupts are disabled here because the uninstall ioctl
 	 * may not have been called from userspace and after dev_private
 	 * is freed, it's too late.
@@ -177,7 +181,8 @@
 
 static int i915_initialize(struct drm_device * dev, drm_i915_init_t * init)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(vdc);
 	struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv;
 
 	master_priv->sarea = drm_getsarea(dev);
@@ -233,7 +238,8 @@
 
 static int i915_dma_resume(struct drm_device * dev)
 {
-	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
+	struct intel_vdc_private *vdc = dev->dev_private;
 
 	DRM_DEBUG("%s\n", __func__);
 
@@ -361,7 +367,8 @@
 
 static int i915_emit_cmds(struct drm_device * dev, int *buffer, int dwords)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
+	struct intel_vdc_private *vdc = dev->dev_private;
 	int i;
 	RING_LOCALS;
 
@@ -398,7 +405,8 @@
 	      struct drm_clip_rect *boxes,
 	      int i, int DR1, int DR4)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct drm_clip_rect box = boxes[i];
 	RING_LOCALS;
 
@@ -435,7 +443,8 @@
 
 static void i915_emit_breadcrumb(struct drm_device *dev)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv;
 	RING_LOCALS;
 
@@ -491,7 +500,8 @@
 				     drm_i915_batchbuffer_t * batch,
 				     struct drm_clip_rect *cliprects)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	int nbox = batch->num_cliprects;
 	int i = 0, count;
 	RING_LOCALS;
@@ -540,7 +550,8 @@
 
 static int i915_dispatch_flip(struct drm_device * dev)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct drm_i915_master_private *master_priv =
 		dev->primary->master->driver_priv;
 	RING_LOCALS;
@@ -593,7 +604,7 @@
 
 static int i915_quiescent(struct drm_device * dev)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 
 	i915_kernel_lost_context(dev);
 	return i915_wait_ring(dev, dev_priv->ring.Size - 8, __func__);
@@ -616,7 +627,7 @@
 static int i915_batchbuffer(struct drm_device *dev, void *data,
 			    struct drm_file *file_priv)
 {
-	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv;
 	drm_i915_sarea_t *sarea_priv = (drm_i915_sarea_t *)
 	    master_priv->sarea_priv;
@@ -669,7 +680,7 @@
 static int i915_cmdbuffer(struct drm_device *dev, void *data,
 			  struct drm_file *file_priv)
 {
-	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv;
 	drm_i915_sarea_t *sarea_priv = (drm_i915_sarea_t *)
 	    master_priv->sarea_priv;
@@ -748,7 +759,7 @@
 static int i915_getparam(struct drm_device *dev, void *data,
 			 struct drm_file *file_priv)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	drm_i915_getparam_t *param = data;
 	int value;
 
@@ -792,7 +803,7 @@
 static int i915_setparam(struct drm_device *dev, void *data,
 			 struct drm_file *file_priv)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	drm_i915_setparam_t *param = data;
 
 	if (!dev_priv) {
@@ -827,7 +838,8 @@
 static int i915_set_status_page(struct drm_device *dev, void *data,
 				struct drm_file *file_priv)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	drm_i915_hws_addr_t *hws = data;
 
 	if (!I915_NEED_GFX_HWS(dev))
@@ -982,7 +994,8 @@
 
 static int i915_load_modeset_init(struct drm_device *dev)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	unsigned long agp_size, prealloc_size;
 	int fb_bar = IS_I9XX(dev) ? 2 : 0;
 	int ret = 0;
@@ -997,12 +1010,12 @@
 		0xff000000;
 
 	if (IS_MOBILE(dev) || IS_I9XX(dev))
-		dev_priv->cursor_needs_physical = true;
+		vdc->cursor_needs_physical = true;
 	else
-		dev_priv->cursor_needs_physical = false;
+		vdc->cursor_needs_physical = false;
 
 	if (IS_I965G(dev) || IS_G33(dev))
-		dev_priv->cursor_needs_physical = false;
+		vdc->cursor_needs_physical = false;
 
 	ret = i915_probe_agp(dev, &agp_size, &prealloc_size);
 	if (ret)
@@ -1091,7 +1104,7 @@
  */
 int i915_driver_load(struct drm_device *dev, unsigned long flags)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv;
 	resource_size_t base, size;
 	int ret = 0, mmio_bar = IS_I9XX(dev) ? 0 : 1;
 
@@ -1108,15 +1121,15 @@
 
 	memset(dev_priv, 0, sizeof(drm_i915_private_t));
 
-	dev->dev_private = (void *)dev_priv;
+	dev->dev_private = (void *)&dev_priv->vdc;
 	dev_priv->dev = dev;
 
 	/* Add register map (needed for suspend/resume) */
 	base = drm_get_resource_start(dev, mmio_bar);
 	size = drm_get_resource_len(dev, mmio_bar);
 
-	dev_priv->regs = ioremap(base, size);
-	if (!dev_priv->regs) {
+	dev_priv->vdc.regs = ioremap(base, size);
+	if (!dev_priv->vdc.regs) {
 		DRM_ERROR("failed to map registers\n");
 		ret = -EIO;
 		goto free_priv;
@@ -1197,7 +1210,7 @@
 out_iomapfree:
 	io_mapping_free(dev_priv->mm.gtt_mapping);
 out_rmmap:
-	iounmap(dev_priv->regs);
+	iounmap(dev_priv->vdc.regs);
 free_priv:
 	drm_free(dev_priv, sizeof(struct drm_i915_private), DRM_MEM_DRIVER);
 	return ret;
@@ -1205,7 +1218,7 @@
 
 int i915_driver_unload(struct drm_device *dev)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 
 	io_mapping_free(dev_priv->mm.gtt_mapping);
 	if (dev_priv->mm.gtt_mtrr >= 0) {
@@ -1221,8 +1234,8 @@
 	if (dev->pdev->msi_enabled)
 		pci_disable_msi(dev->pdev);
 
-	if (dev_priv->regs != NULL)
-		iounmap(dev_priv->regs);
+	if (dev_priv->vdc.regs != NULL)
+		iounmap(dev_priv->vdc.regs);
 
 	intel_opregion_free(dev, 0);
 
@@ -1277,7 +1290,7 @@
  */
 void i915_driver_lastclose(struct drm_device * dev)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 
 	if (!dev_priv || drm_core_check_feature(dev, DRIVER_MODESET)) {
 		intelfb_restore();
@@ -1294,7 +1307,7 @@
 
 void i915_driver_preclose(struct drm_device * dev, struct drm_file *file_priv)
 {
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	if (!drm_core_check_feature(dev, DRIVER_MODESET))
 		i915_mem_release(dev, file_priv, dev_priv->agp_heap);
 }
Index: git/drivers/gpu/drm/i915/intel_crt.c
===================================================================
--- git.orig/drivers/gpu/drm/i915/intel_crt.c	2009-05-12 20:59:37.000000000 +0100
+++ git/drivers/gpu/drm/i915/intel_crt.c	2009-05-13 11:11:44.000000000 +0100
@@ -36,7 +36,7 @@
 static void intel_crt_dpms(struct drm_encoder *encoder, int mode)
 {
 	struct drm_device *dev = encoder->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	u32 temp;
 
 	temp = I915_READ(ADPA);
@@ -98,7 +98,7 @@
 	struct drm_device *dev = encoder->dev;
 	struct drm_crtc *crtc = encoder->crtc;
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	int dpll_md_reg;
 	u32 adpa, dpll_md;
 
@@ -145,7 +145,7 @@
 static bool intel_crt_detect_hotplug(struct drm_connector *connector)
 {
 	struct drm_device *dev = connector->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	u32 hotplug_en;
 	int i, tries = 0;
 	/*
Index: git/drivers/gpu/drm/i915/intel_sdvo.c
===================================================================
--- git.orig/drivers/gpu/drm/i915/intel_sdvo.c	2009-05-12 20:59:37.000000000 +0100
+++ git/drivers/gpu/drm/i915/intel_sdvo.c	2009-05-13 11:14:20.000000000 +0100
@@ -108,7 +108,7 @@
 static void intel_sdvo_write_sdvox(struct intel_output *intel_output, u32 val)
 {
 	struct drm_device *dev = intel_output->base.dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct intel_sdvo_priv   *sdvo_priv = intel_output->dev_priv;
 	u32 bval = val, cval = val;
 	int i;
@@ -994,7 +994,7 @@
 				struct drm_display_mode *adjusted_mode)
 {
 	struct drm_device *dev = encoder->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct drm_crtc *crtc = encoder->crtc;
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	struct intel_output *output = enc_to_intel_output(encoder);
@@ -1117,7 +1117,7 @@
 static void intel_sdvo_dpms(struct drm_encoder *encoder, int mode)
 {
 	struct drm_device *dev = encoder->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct intel_output *intel_output = enc_to_intel_output(encoder);
 	struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv;
 	u32 temp;
@@ -1167,7 +1167,7 @@
 static void intel_sdvo_save(struct drm_connector *connector)
 {
 	struct drm_device *dev = connector->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct intel_output *intel_output = to_intel_output(connector);
 	struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv;
 	int o;
@@ -1406,7 +1406,6 @@
 
 #if 0
 	struct drm_device *dev = encoder->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
 	/* Mac mini hack.  On this device, I get DDC through the analog, which
 	 * load-detects as disconnected.  I fail to DDC through the SDVO DDC,
 	 * but it does load-detect as connected.  So, just steal the DDC bits
Index: git/drivers/gpu/drm/i915/intel_lvds.c
===================================================================
--- git.orig/drivers/gpu/drm/i915/intel_lvds.c	2009-05-12 20:59:38.000000000 +0100
+++ git/drivers/gpu/drm/i915/intel_lvds.c	2009-05-13 10:51:08.000000000 +0100
@@ -44,7 +44,7 @@
  */
 static void intel_lvds_set_backlight(struct drm_device *dev, int level)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	u32 blc_pwm_ctl;
 
 	blc_pwm_ctl = I915_READ(BLC_PWM_CTL) & ~BACKLIGHT_DUTY_CYCLE_MASK;
@@ -57,7 +57,7 @@
  */
 static u32 intel_lvds_get_max_backlight(struct drm_device *dev)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 
 	return ((I915_READ(BLC_PWM_CTL) & BACKLIGHT_MODULATION_FREQ_MASK) >>
 		BACKLIGHT_MODULATION_FREQ_SHIFT) * 2;
@@ -68,7 +68,7 @@
  */
 static void intel_lvds_set_power(struct drm_device *dev, bool on)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	u32 pp_status;
 
 	if (on) {
@@ -78,7 +78,7 @@
 			pp_status = I915_READ(PP_STATUS);
 		} while ((pp_status & PP_ON) == 0);
 
-		intel_lvds_set_backlight(dev, dev_priv->backlight_duty_cycle);
+		intel_lvds_set_backlight(dev, vdc->backlight_duty_cycle);
 	} else {
 		intel_lvds_set_backlight(dev, 0);
 
@@ -105,35 +105,35 @@
 static void intel_lvds_save(struct drm_connector *connector)
 {
 	struct drm_device *dev = connector->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 
-	dev_priv->savePP_ON = I915_READ(PP_ON_DELAYS);
-	dev_priv->savePP_OFF = I915_READ(PP_OFF_DELAYS);
-	dev_priv->savePP_CONTROL = I915_READ(PP_CONTROL);
-	dev_priv->savePP_DIVISOR = I915_READ(PP_DIVISOR);
-	dev_priv->saveBLC_PWM_CTL = I915_READ(BLC_PWM_CTL);
-	dev_priv->backlight_duty_cycle = (dev_priv->saveBLC_PWM_CTL &
+	vdc->savePP_ON = I915_READ(PP_ON_DELAYS);
+	vdc->savePP_OFF = I915_READ(PP_OFF_DELAYS);
+	vdc->savePP_CONTROL = I915_READ(PP_CONTROL);
+	vdc->savePP_DIVISOR = I915_READ(PP_DIVISOR);
+	vdc->saveBLC_PWM_CTL = I915_READ(BLC_PWM_CTL);
+	vdc->backlight_duty_cycle = (vdc->saveBLC_PWM_CTL &
 				       BACKLIGHT_DUTY_CYCLE_MASK);
 
 	/*
 	 * If the light is off at server startup, just make it full brightness
 	 */
-	if (dev_priv->backlight_duty_cycle == 0)
-		dev_priv->backlight_duty_cycle =
+	if (vdc->backlight_duty_cycle == 0)
+		vdc->backlight_duty_cycle =
 			intel_lvds_get_max_backlight(dev);
 }
 
 static void intel_lvds_restore(struct drm_connector *connector)
 {
 	struct drm_device *dev = connector->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 
-	I915_WRITE(BLC_PWM_CTL, dev_priv->saveBLC_PWM_CTL);
-	I915_WRITE(PP_ON_DELAYS, dev_priv->savePP_ON);
-	I915_WRITE(PP_OFF_DELAYS, dev_priv->savePP_OFF);
-	I915_WRITE(PP_DIVISOR, dev_priv->savePP_DIVISOR);
-	I915_WRITE(PP_CONTROL, dev_priv->savePP_CONTROL);
-	if (dev_priv->savePP_CONTROL & POWER_TARGET_ON)
+	I915_WRITE(BLC_PWM_CTL, vdc->saveBLC_PWM_CTL);
+	I915_WRITE(PP_ON_DELAYS, vdc->savePP_ON);
+	I915_WRITE(PP_OFF_DELAYS, vdc->savePP_OFF);
+	I915_WRITE(PP_DIVISOR, vdc->savePP_DIVISOR);
+	I915_WRITE(PP_CONTROL, vdc->savePP_CONTROL);
+	if (vdc->savePP_CONTROL & POWER_TARGET_ON)
 		intel_lvds_set_power(dev, true);
 	else
 		intel_lvds_set_power(dev, false);
@@ -143,8 +143,8 @@
 				 struct drm_display_mode *mode)
 {
 	struct drm_device *dev = connector->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
-	struct drm_display_mode *fixed_mode = dev_priv->panel_fixed_mode;
+	struct intel_vdc_private *vdc = dev->dev_private;
+	struct drm_display_mode *fixed_mode = vdc->panel_fixed_mode;
 
 	if (fixed_mode)	{
 		if (mode->hdisplay > fixed_mode->hdisplay)
@@ -161,7 +161,7 @@
 				  struct drm_display_mode *adjusted_mode)
 {
 	struct drm_device *dev = encoder->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
 	struct drm_encoder *tmp_encoder;
 
@@ -186,20 +186,20 @@
 	 * with the panel scaling set up to source from the H/VDisplay
 	 * of the original mode.
 	 */
-	if (dev_priv->panel_fixed_mode != NULL) {
-		adjusted_mode->hdisplay = dev_priv->panel_fixed_mode->hdisplay;
+	if (vdc->panel_fixed_mode != NULL) {
+		adjusted_mode->hdisplay = vdc->panel_fixed_mode->hdisplay;
 		adjusted_mode->hsync_start =
-			dev_priv->panel_fixed_mode->hsync_start;
+			vdc->panel_fixed_mode->hsync_start;
 		adjusted_mode->hsync_end =
-			dev_priv->panel_fixed_mode->hsync_end;
-		adjusted_mode->htotal = dev_priv->panel_fixed_mode->htotal;
-		adjusted_mode->vdisplay = dev_priv->panel_fixed_mode->vdisplay;
+			vdc->panel_fixed_mode->hsync_end;
+		adjusted_mode->htotal = vdc->panel_fixed_mode->htotal;
+		adjusted_mode->vdisplay = vdc->panel_fixed_mode->vdisplay;
 		adjusted_mode->vsync_start =
-			dev_priv->panel_fixed_mode->vsync_start;
+			vdc->panel_fixed_mode->vsync_start;
 		adjusted_mode->vsync_end =
-			dev_priv->panel_fixed_mode->vsync_end;
-		adjusted_mode->vtotal = dev_priv->panel_fixed_mode->vtotal;
-		adjusted_mode->clock = dev_priv->panel_fixed_mode->clock;
+			vdc->panel_fixed_mode->vsync_end;
+		adjusted_mode->vtotal = vdc->panel_fixed_mode->vtotal;
+		adjusted_mode->clock = vdc->panel_fixed_mode->clock;
 		drm_mode_set_crtcinfo(adjusted_mode, CRTC_INTERLACE_HALVE_V);
 	}
 
@@ -215,10 +215,10 @@
 static void intel_lvds_prepare(struct drm_encoder *encoder)
 {
 	struct drm_device *dev = encoder->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 
-	dev_priv->saveBLC_PWM_CTL = I915_READ(BLC_PWM_CTL);
-	dev_priv->backlight_duty_cycle = (dev_priv->saveBLC_PWM_CTL &
+	vdc->saveBLC_PWM_CTL = I915_READ(BLC_PWM_CTL);
+	vdc->backlight_duty_cycle = (vdc->saveBLC_PWM_CTL &
 				       BACKLIGHT_DUTY_CYCLE_MASK);
 
 //	intel_lvds_set_power(dev, false);
@@ -227,10 +227,10 @@
 static void intel_lvds_commit( struct drm_encoder *encoder)
 {
 	struct drm_device *dev = encoder->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 
-	if (dev_priv->backlight_duty_cycle == 0)
-		dev_priv->backlight_duty_cycle =
+	if (vdc->backlight_duty_cycle == 0)
+		vdc->backlight_duty_cycle =
 			intel_lvds_get_max_backlight(dev);
 
 //	intel_lvds_set_power(dev, true);
@@ -241,7 +241,7 @@
 				struct drm_display_mode *adjusted_mode)
 {
 	struct drm_device *dev = encoder->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
 	u32 pfit_control;
 
@@ -265,7 +265,7 @@
 		pfit_control = 0;
 
 	if (!IS_I965G(dev)) {
-		if (dev_priv->panel_wants_dither || dev_priv->lvds_dither)
+		if (vdc->panel_wants_dither || vdc->lvds_dither)
 			pfit_control |= PANEL_8TO6_DITHER_ENABLE;
 	}
 	else
@@ -292,7 +292,7 @@
 {
 	struct drm_device *dev = connector->dev;
 	struct intel_output *intel_output = to_intel_output(connector);
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	int ret = 0;
 
 	ret = intel_ddc_get_modes(intel_output);
@@ -309,10 +309,10 @@
 	connector->display_info.min_hfreq = 0;
 	connector->display_info.max_hfreq = 200;
 
-	if (dev_priv->panel_fixed_mode != NULL) {
+	if (vdc->panel_fixed_mode != NULL) {
 		struct drm_display_mode *mode;
 
-		mode = drm_mode_duplicate(dev, dev_priv->panel_fixed_mode);
+		mode = drm_mode_duplicate(dev, vdc->panel_fixed_mode);
 		drm_mode_probed_add(connector, mode);
 
 		return 1;
@@ -395,7 +395,7 @@
  */
 void intel_lvds_init(struct drm_device *dev)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+ 	struct intel_vdc_private *vdc = dev->dev_private;
 	struct intel_output *intel_output;
 	struct drm_connector *connector;
 	struct drm_encoder *encoder;
@@ -464,7 +464,7 @@
 	list_for_each_entry(scan, &connector->probed_modes, head) {
 		mutex_lock(&dev->mode_config.mutex);
 		if (scan->type & DRM_MODE_TYPE_PREFERRED) {
-			dev_priv->panel_fixed_mode =
+			vdc->panel_fixed_mode =
 				drm_mode_duplicate(dev, scan);
 			mutex_unlock(&dev->mode_config.mutex);
 			goto out;
@@ -473,13 +473,13 @@
 	}
 
 	/* Failed to get EDID, what about VBT? */
-	if (dev_priv->vbt_mode) {
+	if (vdc->vbt_mode) {
 		mutex_lock(&dev->mode_config.mutex);
-		dev_priv->panel_fixed_mode =
-			drm_mode_duplicate(dev, dev_priv->vbt_mode);
+		vdc->panel_fixed_mode =
+			drm_mode_duplicate(dev, vdc->vbt_mode);
 		mutex_unlock(&dev->mode_config.mutex);
-		if (dev_priv->panel_fixed_mode) {
-			dev_priv->panel_fixed_mode->type |=
+		if (vdc->panel_fixed_mode) {
+			vdc->panel_fixed_mode->type |=
 				DRM_MODE_TYPE_PREFERRED;
 			goto out;
 		}
@@ -495,16 +495,16 @@
 	crtc = intel_get_crtc_from_pipe(dev, pipe);
 
 	if (crtc && (lvds & LVDS_PORT_EN)) {
-		dev_priv->panel_fixed_mode = intel_crtc_mode_get(dev, crtc);
-		if (dev_priv->panel_fixed_mode) {
-			dev_priv->panel_fixed_mode->type |=
+		vdc->panel_fixed_mode = intel_crtc_mode_get(dev, crtc);
+		if (vdc->panel_fixed_mode) {
+			vdc->panel_fixed_mode->type |=
 				DRM_MODE_TYPE_PREFERRED;
 			goto out;
 		}
 	}
 
 	/* If we still don't have a mode after all that, give up. */
-	if (!dev_priv->panel_fixed_mode)
+	if (!vdc->panel_fixed_mode)
 		goto failed;
 
 out:
Index: git/drivers/gpu/drm/i915/intel_display.c
===================================================================
--- git.orig/drivers/gpu/drm/i915/intel_display.c	2009-05-12 20:59:37.000000000 +0100
+++ git/drivers/gpu/drm/i915/intel_display.c	2009-05-13 11:13:37.000000000 +0100
@@ -26,6 +26,7 @@
 
 #include <linux/i2c.h>
 #include "drmP.h"
+#include "intel_vdc.h"
 #include "intel_drv.h"
 #include "i915_drm.h"
 #include "i915_drv.h"
@@ -389,7 +390,7 @@
 static const intel_limit_t *intel_g4x_limit(struct drm_crtc *crtc)
 {
 	struct drm_device *dev = crtc->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	const intel_limit_t *limit;
 
 	if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) {
@@ -522,7 +523,7 @@
 
 {
 	struct drm_device *dev = crtc->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	intel_clock_t clock;
 	int err = target;
 
@@ -582,7 +583,7 @@
 			int target, int refclk, intel_clock_t *best_clock)
 {
 	struct drm_device *dev = crtc->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	intel_clock_t clock;
 	int max_n;
 	bool found;
@@ -646,7 +647,7 @@
 		    struct drm_framebuffer *old_fb)
 {
 	struct drm_device *dev = crtc->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct drm_i915_master_private *master_priv;
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	struct intel_framebuffer *intel_fb;
@@ -797,7 +798,7 @@
 {
 	struct drm_device *dev = crtc->dev;
 	struct drm_i915_master_private *master_priv;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	int pipe = intel_crtc->pipe;
 	int dpll_reg = (pipe == 0) ? DPLL_A : DPLL_B;
@@ -1009,7 +1010,7 @@
  */
 static int intel_panel_fitter_pipe (struct drm_device *dev)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	u32  pfit_control;
 
 	/* i830 doesn't have a panel fitter */
@@ -1037,7 +1038,7 @@
 			       struct drm_framebuffer *old_fb)
 {
 	struct drm_device *dev = crtc->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	int pipe = intel_crtc->pipe;
 	int fp_reg = (pipe == 0) ? FPA0 : FPB0;
@@ -1096,8 +1097,8 @@
 		num_outputs++;
 	}
 
-	if (is_lvds && dev_priv->lvds_use_ssc && num_outputs < 2) {
-		refclk = dev_priv->lvds_ssc_freq * 1000;
+	if (is_lvds && vdc->lvds_use_ssc && num_outputs < 2) {
+		refclk = vdc->lvds_ssc_freq * 1000;
 		DRM_DEBUG("using SSC reference clock of %d MHz\n", refclk / 1000);
 	} else if (IS_I9XX(dev)) {
 		refclk = 96000;
@@ -1196,7 +1197,7 @@
 		/* XXX: just matching BIOS for now */
 		/*	dpll |= PLL_REF_INPUT_TVCLKINBC; */
 		dpll |= 3;
-	else if (is_lvds && dev_priv->lvds_use_ssc && num_outputs < 2)
+	else if (is_lvds && vdc->lvds_use_ssc && num_outputs < 2)
 		dpll |= PLLB_REF_INPUT_SPREADSPECTRUMIN;
 	else
 		dpll |= PLL_REF_INPUT_DREFCLK;
@@ -1327,7 +1328,7 @@
 void intel_crtc_load_lut(struct drm_crtc *crtc)
 {
 	struct drm_device *dev = crtc->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	int palreg = (intel_crtc->pipe == 0) ? PALETTE_A : PALETTE_B;
 	int i;
@@ -1350,7 +1351,7 @@
 				 uint32_t width, uint32_t height)
 {
 	struct drm_device *dev = crtc->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	struct drm_gem_object *bo;
 	struct drm_i915_gem_object *obj_priv;
@@ -1393,7 +1394,7 @@
 
 	/* we only need to pin inside GTT if cursor is non-phy */
 	mutex_lock(&dev->struct_mutex);
-	if (!dev_priv->cursor_needs_physical) {
+	if (!vdc->cursor_needs_physical) {
 		ret = i915_gem_object_pin(bo, PAGE_SIZE);
 		if (ret) {
 			DRM_ERROR("failed to pin cursor bo\n");
@@ -1419,7 +1420,7 @@
 	I915_WRITE(base, addr);
 
 	if (intel_crtc->cursor_bo) {
-		if (dev_priv->cursor_needs_physical) {
+		if (vdc->cursor_needs_physical) {
 			if (intel_crtc->cursor_bo != bo)
 				i915_gem_detach_phys_object(dev, intel_crtc->cursor_bo);
 		} else
@@ -1443,7 +1444,7 @@
 static int intel_crtc_cursor_move(struct drm_crtc *crtc, int x, int y)
 {
 	struct drm_device *dev = crtc->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	int pipe = intel_crtc->pipe;
 	uint32_t temp = 0;
@@ -1627,7 +1628,7 @@
 /* Returns the clock of the currently programmed mode of the given pipe. */
 static int intel_crtc_clock_get(struct drm_device *dev, struct drm_crtc *crtc)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	int pipe = intel_crtc->pipe;
 	u32 dpll = I915_READ((pipe == 0) ? DPLL_A : DPLL_B);
@@ -1715,7 +1716,7 @@
 struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev,
 					     struct drm_crtc *crtc)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	int pipe = intel_crtc->pipe;
 	struct drm_display_mode *mode;
@@ -1834,7 +1835,7 @@
 
 static void intel_setup_outputs(struct drm_device *dev)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_vdc_private *vdc = dev->dev_private;
 	struct drm_connector *connector;
 
 	intel_crt_init(dev);
Index: git/drivers/gpu/drm/i915/intel_bios.c
===================================================================
--- git.orig/drivers/gpu/drm/i915/intel_bios.c	2009-05-12 20:59:37.000000000 +0100
+++ git/drivers/gpu/drm/i915/intel_bios.c	2009-05-13 10:51:08.000000000 +0100
@@ -68,14 +68,14 @@
 	struct drm_display_mode *panel_fixed_mode;
 
 	/* Defaults if we can't find VBT info */
-	dev_priv->lvds_dither = 0;
-	dev_priv->lvds_vbt = 0;
+	dev_priv->vdc.lvds_dither = 0;
+	dev_priv->vdc.lvds_vbt = 0;
 
 	lvds_options = find_section(bdb, BDB_LVDS_OPTIONS);
 	if (!lvds_options)
 		return;
 
-	dev_priv->lvds_dither = lvds_options->pixel_dither;
+	dev_priv->vdc.lvds_dither = lvds_options->pixel_dither;
 	if (lvds_options->panel_type == 0xff)
 		return;
 
@@ -83,7 +83,7 @@
 	if (!lvds_lfp_data)
 		return;
 
-	dev_priv->lvds_vbt = 1;
+	dev_priv->vdc.lvds_vbt = 1;
 
 	entry = &lvds_lfp_data->data[lvds_options->panel_type];
 	dvo_timing = &entry->dvo_timing;
@@ -119,7 +119,7 @@
 
 	drm_mode_set_name(panel_fixed_mode);
 
-	dev_priv->vbt_mode = panel_fixed_mode;
+	dev_priv->vdc.vbt_mode = panel_fixed_mode;
 
 	DRM_DEBUG("Found panel mode in BIOS VBT tables:\n");
 	drm_mode_debug_printmodeline(panel_fixed_mode);
@@ -134,20 +134,20 @@
 	struct bdb_general_features *general;
 
 	/* Set sensible defaults in case we can't find the general block */
-	dev_priv->int_tv_support = 1;
-	dev_priv->int_crt_support = 1;
+	dev_priv->vdc.int_tv_support = 1;
+	dev_priv->vdc.int_crt_support = 1;
 
 	general = find_section(bdb, BDB_GENERAL_FEATURES);
 	if (general) {
-		dev_priv->int_tv_support = general->int_tv_support;
-		dev_priv->int_crt_support = general->int_crt_support;
-		dev_priv->lvds_use_ssc = general->enable_ssc;
+		dev_priv->vdc.int_tv_support = general->int_tv_support;
+		dev_priv->vdc.int_crt_support = general->int_crt_support;
+		dev_priv->vdc.lvds_use_ssc = general->enable_ssc;
 
-		if (dev_priv->lvds_use_ssc) {
+		if (dev_priv->vdc.lvds_use_ssc) {
 		  if (IS_I855(dev_priv->dev))
-		    dev_priv->lvds_ssc_freq = general->ssc_freq ? 66 : 48;
+		    dev_priv->vdc.lvds_ssc_freq = general->ssc_freq ? 66 : 48;
 		  else
-		    dev_priv->lvds_ssc_freq = general->ssc_freq ? 100 : 96;
+		    dev_priv->vdc.lvds_ssc_freq = general->ssc_freq ? 100 : 96;
 		}
 	}
 }
@@ -169,7 +169,7 @@
 bool
 intel_init_bios(struct drm_device *dev)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct pci_dev *pdev = dev->pdev;
 	struct vbt_header *vbt = NULL;
 	struct bdb_header *bdb;
Index: git/drivers/gpu/drm/i915/i915_drv.c
===================================================================
--- git.orig/drivers/gpu/drm/i915/i915_drv.c	2009-05-12 20:59:38.000000000 +0100
+++ git/drivers/gpu/drm/i915/i915_drv.c	2009-05-13 10:51:08.000000000 +0100
@@ -54,7 +54,7 @@
 
 static int i915_suspend(struct drm_device *dev, pm_message_t state)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 
 	if (!dev || !dev_priv) {
 		printk(KERN_ERR "dev: %p, dev_priv: %p\n", dev, dev_priv);
@@ -90,7 +90,7 @@
 
 static int i915_resume(struct drm_device *dev)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	int ret = 0;
 
 	pci_set_power_state(dev->pdev, PCI_D0);
Index: git/drivers/gpu/drm/i915/intel_vdc.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ git/drivers/gpu/drm/i915/intel_vdc.h	2009-05-13 11:01:20.000000000 +0100
@@ -0,0 +1,147 @@
+/*
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef _INTEL_VDC_H_
+#define _INTEL_VDC_H_
+
+struct intel_vdc_private {
+	void __iomem *regs;
+
+	bool cursor_needs_physical;
+
+	/* LVDS info */
+	int backlight_duty_cycle;  /* restore backlight to this value */
+	bool panel_wants_dither;
+	struct drm_display_mode *panel_fixed_mode;
+	struct drm_display_mode *vbt_mode; /* if any */
+
+	/* Feature bits from the VBIOS */
+	unsigned int int_tv_support:1;
+	unsigned int lvds_dither:1;
+	unsigned int lvds_vbt:1;
+	unsigned int int_crt_support:1;
+	unsigned int lvds_use_ssc:1;
+	int lvds_ssc_freq;
+
+	/* Register state */
+	u8 saveLBB;
+	u32 saveDSPACNTR;
+	u32 saveDSPBCNTR;
+	u32 saveDSPARB;
+	u32 saveRENDERSTANDBY;
+	u32 saveHWS;
+	u32 savePIPEACONF;
+	u32 savePIPEBCONF;
+	u32 savePIPEASRC;
+	u32 savePIPEBSRC;
+	u32 saveFPA0;
+	u32 saveFPA1;
+	u32 saveDPLL_A;
+	u32 saveDPLL_A_MD;
+	u32 saveHTOTAL_A;
+	u32 saveHBLANK_A;
+	u32 saveHSYNC_A;
+	u32 saveVTOTAL_A;
+	u32 saveVBLANK_A;
+	u32 saveVSYNC_A;
+	u32 saveBCLRPAT_A;
+	u32 savePIPEASTAT;
+	u32 saveDSPASTRIDE;
+	u32 saveDSPASIZE;
+	u32 saveDSPAPOS;
+	u32 saveDSPAADDR;
+	u32 saveDSPASURF;
+	u32 saveDSPATILEOFF;
+	u32 savePFIT_PGM_RATIOS;
+	u32 saveBLC_PWM_CTL;
+	u32 saveBLC_PWM_CTL2;
+	u32 saveFPB0;
+	u32 saveFPB1;
+	u32 saveDPLL_B;
+	u32 saveDPLL_B_MD;
+	u32 saveHTOTAL_B;
+	u32 saveHBLANK_B;
+	u32 saveHSYNC_B;
+	u32 saveVTOTAL_B;
+	u32 saveVBLANK_B;
+	u32 saveVSYNC_B;
+	u32 saveBCLRPAT_B;
+	u32 savePIPEBSTAT;
+	u32 saveDSPBSTRIDE;
+	u32 saveDSPBSIZE;
+	u32 saveDSPBPOS;
+	u32 saveDSPBADDR;
+	u32 saveDSPBSURF;
+	u32 saveDSPBTILEOFF;
+	u32 saveVGA0;
+	u32 saveVGA1;
+	u32 saveVGA_PD;
+	u32 saveVGACNTRL;
+	u32 saveADPA;
+	u32 saveLVDS;
+	u32 savePP_ON_DELAYS;
+	u32 savePP_OFF_DELAYS;
+	u32 saveDVOA;
+	u32 saveDVOB;
+	u32 saveDVOC;
+	u32 savePP_ON;
+	u32 savePP_OFF;
+	u32 savePP_CONTROL;
+	u32 savePP_DIVISOR;
+	u32 savePFIT_CONTROL;
+	u32 save_palette_a[256];
+	u32 save_palette_b[256];
+	u32 saveFBC_CFB_BASE;
+	u32 saveFBC_LL_BASE;
+	u32 saveFBC_CONTROL;
+	u32 saveFBC_CONTROL2;
+	u32 saveIER;
+	u32 saveIIR;
+	u32 saveIMR;
+	u32 saveCACHE_MODE_0;
+	u32 saveD_STATE;
+	u32 saveCG_2D_DIS;
+	u32 saveMI_ARB_STATE;
+	u32 saveSWF0[16];
+	u32 saveSWF1[16];
+	u32 saveSWF2[3];
+	u8 saveMSR;
+	u8 saveSR[8];
+	u8 saveGR[25];
+	u8 saveAR_INDEX;
+	u8 saveAR[21];
+	u8 saveDACMASK;
+	u8 saveCR[37];
+	uint64_t saveFENCE[16];
+};
+
+struct drm_i915_master_private {
+	drm_local_map_t *sarea;
+	struct _drm_i915_sarea *sarea_priv;
+};
+
+#endif
Index: git/drivers/gpu/drm/i915/i915_drv.h
===================================================================
--- git.orig/drivers/gpu/drm/i915/i915_drv.h	2009-05-12 20:59:38.000000000 +0100
+++ git/drivers/gpu/drm/i915/i915_drv.h	2009-05-13 11:19:24.000000000 +0100
@@ -32,6 +32,7 @@
 
 #include "i915_reg.h"
 #include "intel_bios.h"
+#include "intel_vdc.h"
 #include <linux/io-mapping.h>
 
 /* General customization:
@@ -116,10 +117,6 @@
 	int enabled;
 };
 
-struct drm_i915_master_private {
-	drm_local_map_t *sarea;
-	struct _drm_i915_sarea *sarea_priv;
-};
 #define I915_FENCE_REG_NONE -1
 
 struct drm_i915_fence_reg {
@@ -127,9 +124,9 @@
 };
 
 typedef struct drm_i915_private {
-	struct drm_device *dev;
+	struct intel_vdc_private vdc;
 
-	void __iomem *regs;
+	struct drm_device *dev;
 
 	drm_i915_ring_buffer_t ring;
 
@@ -166,123 +163,16 @@
 	unsigned int sr01, adpa, ppcr, dvob, dvoc, lvds;
 	int vblank_pipe;
 
-	bool cursor_needs_physical;
-
 	struct drm_mm vram;
 
 	int irq_enabled;
 
 	struct intel_opregion opregion;
 
-	/* LVDS info */
-	int backlight_duty_cycle;  /* restore backlight to this value */
-	bool panel_wants_dither;
-	struct drm_display_mode *panel_fixed_mode;
-	struct drm_display_mode *vbt_mode; /* if any */
-
-	/* Feature bits from the VBIOS */
-	unsigned int int_tv_support:1;
-	unsigned int lvds_dither:1;
-	unsigned int lvds_vbt:1;
-	unsigned int int_crt_support:1;
-	unsigned int lvds_use_ssc:1;
-	int lvds_ssc_freq;
-
 	struct drm_i915_fence_reg fence_regs[16]; /* assume 965 */
 	int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */
 	int num_fence_regs; /* 8 on pre-965, 16 otherwise */
 
-	/* Register state */
-	u8 saveLBB;
-	u32 saveDSPACNTR;
-	u32 saveDSPBCNTR;
-	u32 saveDSPARB;
-	u32 saveRENDERSTANDBY;
-	u32 saveHWS;
-	u32 savePIPEACONF;
-	u32 savePIPEBCONF;
-	u32 savePIPEASRC;
-	u32 savePIPEBSRC;
-	u32 saveFPA0;
-	u32 saveFPA1;
-	u32 saveDPLL_A;
-	u32 saveDPLL_A_MD;
-	u32 saveHTOTAL_A;
-	u32 saveHBLANK_A;
-	u32 saveHSYNC_A;
-	u32 saveVTOTAL_A;
-	u32 saveVBLANK_A;
-	u32 saveVSYNC_A;
-	u32 saveBCLRPAT_A;
-	u32 savePIPEASTAT;
-	u32 saveDSPASTRIDE;
-	u32 saveDSPASIZE;
-	u32 saveDSPAPOS;
-	u32 saveDSPAADDR;
-	u32 saveDSPASURF;
-	u32 saveDSPATILEOFF;
-	u32 savePFIT_PGM_RATIOS;
-	u32 saveBLC_PWM_CTL;
-	u32 saveBLC_PWM_CTL2;
-	u32 saveFPB0;
-	u32 saveFPB1;
-	u32 saveDPLL_B;
-	u32 saveDPLL_B_MD;
-	u32 saveHTOTAL_B;
-	u32 saveHBLANK_B;
-	u32 saveHSYNC_B;
-	u32 saveVTOTAL_B;
-	u32 saveVBLANK_B;
-	u32 saveVSYNC_B;
-	u32 saveBCLRPAT_B;
-	u32 savePIPEBSTAT;
-	u32 saveDSPBSTRIDE;
-	u32 saveDSPBSIZE;
-	u32 saveDSPBPOS;
-	u32 saveDSPBADDR;
-	u32 saveDSPBSURF;
-	u32 saveDSPBTILEOFF;
-	u32 saveVGA0;
-	u32 saveVGA1;
-	u32 saveVGA_PD;
-	u32 saveVGACNTRL;
-	u32 saveADPA;
-	u32 saveLVDS;
-	u32 savePP_ON_DELAYS;
-	u32 savePP_OFF_DELAYS;
-	u32 saveDVOA;
-	u32 saveDVOB;
-	u32 saveDVOC;
-	u32 savePP_ON;
-	u32 savePP_OFF;
-	u32 savePP_CONTROL;
-	u32 savePP_DIVISOR;
-	u32 savePFIT_CONTROL;
-	u32 save_palette_a[256];
-	u32 save_palette_b[256];
-	u32 saveFBC_CFB_BASE;
-	u32 saveFBC_LL_BASE;
-	u32 saveFBC_CONTROL;
-	u32 saveFBC_CONTROL2;
-	u32 saveIER;
-	u32 saveIIR;
-	u32 saveIMR;
-	u32 saveCACHE_MODE_0;
-	u32 saveD_STATE;
-	u32 saveCG_2D_DIS;
-	u32 saveMI_ARB_STATE;
-	u32 saveSWF0[16];
-	u32 saveSWF1[16];
-	u32 saveSWF2[3];
-	u8 saveMSR;
-	u8 saveSR[8];
-	u8 saveGR[25];
-	u8 saveAR_INDEX;
-	u8 saveAR[21];
-	u8 saveDACMASK;
-	u8 saveCR[37];
-	uint64_t saveFENCE[16];
-
 	struct {
 		struct drm_mm gtt_space;
 
@@ -381,6 +271,8 @@
 	} mm;
 } drm_i915_private_t;
 
+#define to_i915_priv(x) container_of(x, struct drm_i915_private, vdc)
+
 /** driver private structure attached to each drm_gem_object */
 struct drm_i915_gem_object {
 	struct drm_gem_object *obj;
@@ -694,18 +586,19 @@
  * has access to the ring.
  */
 #define RING_LOCK_TEST_WITH_RETURN(dev, file_priv) do {			\
-	if (((drm_i915_private_t *)dev->dev_private)->ring.ring_obj == NULL) \
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private); \
+	if (dev_priv->ring.ring_obj == NULL) \
 		LOCK_TEST_WITH_RETURN(dev, file_priv);			\
 } while (0)
 
-#define I915_READ(reg)          readl(dev_priv->regs + (reg))
-#define I915_WRITE(reg, val)     writel(val, dev_priv->regs + (reg))
-#define I915_READ16(reg)	readw(dev_priv->regs + (reg))
-#define I915_WRITE16(reg, val)	writel(val, dev_priv->regs + (reg))
-#define I915_READ8(reg)		readb(dev_priv->regs + (reg))
-#define I915_WRITE8(reg, val)	writeb(val, dev_priv->regs + (reg))
-#define I915_WRITE64(reg, val)	writeq(val, dev_priv->regs + (reg))
-#define I915_READ64(reg)	readq(dev_priv->regs + (reg))
+#define I915_READ(reg)          readl(vdc->regs + (reg))
+#define I915_WRITE(reg, val)     writel(val, vdc->regs + (reg))
+#define I915_READ16(reg)	readw(vdc->regs + (reg))
+#define I915_WRITE16(reg, val)	writel(val, vdc->regs + (reg))
+#define I915_READ8(reg)		readb(vdc->regs + (reg))
+#define I915_WRITE8(reg, val)	writeb(val, vdc->regs + (reg))
+#define I915_WRITE64(reg, val)	writeq(val, vdc->regs + (reg))
+#define I915_READ64(reg)	readq(vdc->regs + (reg))
 #define POSTING_READ(reg)	(void)I915_READ(reg)
 
 #define I915_VERBOSE 0
Index: git/drivers/gpu/drm/i915/i915_gem_debugfs.c
===================================================================
--- git.orig/drivers/gpu/drm/i915/i915_gem_debugfs.c	2009-05-13 11:04:08.000000000 +0100
+++ git/drivers/gpu/drm/i915/i915_gem_debugfs.c	2009-05-13 11:27:09.000000000 +0100
@@ -67,7 +67,7 @@
 	uintptr_t list = (uintptr_t) node->info_ent->data;
 	struct list_head *head;
 	struct drm_device *dev = node->minor->dev;
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_i915_gem_object *obj_priv;
 	spinlock_t *lock = NULL;
 
@@ -117,7 +117,7 @@
 {
 	struct drm_info_node *node = (struct drm_info_node *) m->private;
 	struct drm_device *dev = node->minor->dev;
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_i915_gem_request *gem_request;
 
 	seq_printf(m, "Request:\n");
@@ -133,7 +133,7 @@
 {
 	struct drm_info_node *node = (struct drm_info_node *) m->private;
 	struct drm_device *dev = node->minor->dev;
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 
 	if (dev_priv->hw_status_page != NULL) {
 		seq_printf(m, "Current sequence: %d\n",
@@ -152,7 +152,8 @@
 {
 	struct drm_info_node *node = (struct drm_info_node *) m->private;
 	struct drm_device *dev = node->minor->dev;
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
+	struct intel_vdc_private *vdc = dev->dev_private;
 
 	seq_printf(m, "Interrupt enable:    %08x\n",
 		   I915_READ(IER));
@@ -183,7 +184,7 @@
 {
 	struct drm_info_node *node = (struct drm_info_node *) m->private;
 	struct drm_device *dev = node->minor->dev;
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	int i;
 
 	seq_printf(m, "Reserved fences = %d\n", dev_priv->fence_reg_start);
@@ -218,7 +219,7 @@
 {
 	struct drm_info_node *node = (struct drm_info_node *) m->private;
 	struct drm_device *dev = node->minor->dev;
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	int i;
 	volatile u32 *hws;
 
@@ -251,7 +252,7 @@
 {
 	struct drm_info_node *node = (struct drm_info_node *) m->private;
 	struct drm_device *dev = node->minor->dev;
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	struct drm_gem_object *obj;
 	struct drm_i915_gem_object *obj_priv;
 	int ret;
@@ -284,7 +285,7 @@
 {
 	struct drm_info_node *node = (struct drm_info_node *) m->private;
 	struct drm_device *dev = node->minor->dev;
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
 	u8 *virt;
 	uint32_t *ptr, off;
 
@@ -307,7 +308,8 @@
 {
 	struct drm_info_node *node = (struct drm_info_node *) m->private;
 	struct drm_device *dev = node->minor->dev;
-	drm_i915_private_t *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915_priv(dev->dev_private);
+	struct intel_vdc_private *vdc = dev->dev_private;
 	unsigned int head, tail, mask;
 
 	head = I915_READ(PRB0_HEAD) & HEAD_ADDR;




More information about the Intel-gfx mailing list