Skip to contentSkip to conversation

Fixing and cleaning

PATCH In review Alan Cox 2 participants 15 messages Jul 8, 2011 – Jul 9, 2011 Staging

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

cover Fixing and cleaning

Further cleanup plus fixes from other. The important one here is the gtt Mask out bits patch.

---

Alan Cox (8):
gma500: Fix unused variable in cdv support gma500; clean mid files
gma500: tidy the mrst files
gma500: tidy up the CDV files
gma500: Fix symbol clash with i915
gma500: psb_intel_lvds style
gma500: Re-order checks and dereferences in psb_intel_lvds
gma500: strip unneeded version headers

Dan Carpenter (3):
gma500: remove unneeded check in mdfld_crtc_mode_set()
gma500: reversed test in mdfld_dbi_dsr_exit()
Staging: gma500: typo in array initialization

Patrik Jakobsson (1):
gma500: Mask out bits not part of the page table base address

 drivers/staging/gma500/cdv_device.c           |   23 +++--
 drivers/staging/gma500/cdv_intel_crt.c        |   23 +++--
 drivers/staging/gma500/cdv_intel_display.c    |  115 ++++++++++++-------------
 drivers/staging/gma500/cdv_intel_hdmi.c       |   81 +++++++++---------
 drivers/staging/gma500/cdv_intel_lvds.c       |   20 +++-
 drivers/staging/gma500/framebuffer.h          |    1 
 drivers/staging/gma500/gtt.c                  |    2 
 drivers/staging/gma500/intel_opregion.c       |    4 -
 drivers/staging/gma500/mdfld_dsi_dbi.c        |    2 
 drivers/staging/gma500/mdfld_dsi_dbi.h        |    1 
 drivers/staging/gma500/mdfld_dsi_output.h     |    1 
 drivers/staging/gma500/mdfld_dsi_pkg_sender.c |    2 
 drivers/staging/gma500/mdfld_intel_display.c  |    2 
 drivers/staging/gma500/mid_bios.c             |   10 +-
 drivers/staging/gma500/mrst_device.c          |    4 -
 drivers/staging/gma500/psb_device.c           |    2 
 drivers/staging/gma500/psb_drv.c              |    2 
 drivers/staging/gma500/psb_drv.h              |    5 -
 drivers/staging/gma500/psb_intel_lvds.c       |   58 +++++++------
 19 files changed, 179 insertions(+), 179 deletions(-)
Signature · 1 line
Signature
author
#1 lore raw

PATCH 1/12 gma500: strip unneeded version headers

From: Jesper Juhl <[email protected]>

Remove unneeded version.h includes from drivers/staging/gma500/

It was pointed out by 'make versioncheck' that some includes of linux/version.h are not needed in drivers/staging/gma500/. This patch removes them.

[updated for all th file cleanup and movement]

---

 drivers/staging/gma500/framebuffer.h      |    1 -
 drivers/staging/gma500/mdfld_dsi_dbi.h    |    1 -
 drivers/staging/gma500/mdfld_dsi_output.h |    1 -
 drivers/staging/gma500/psb_drv.h          |    1 -
 4 files changed, 0 insertions(+), 4 deletions(-)
drivers/staging/gma500/framebuffer.h +0 -1
index 9416a21..d1b2289 100644
@@ -22,7 +22,6 @@
 #ifndef _FRAMEBUFFER_H_
 #define _FRAMEBUFFER_H_
 
-#include <linux/version.h>
 #include <drm/drmP.h>
 #include <drm/drm_fb_helper.h>
 
drivers/staging/gma500/mdfld_dsi_dbi.h +0 -1
index a76813e..a51e2f8 100644
@@ -29,7 +29,6 @@
 #define __MDFLD_DSI_DBI_H__
 
 #include <linux/backlight.h>
-#include <linux/version.h>
 #include <drm/drmP.h>
 #include <drm/drm.h>
 #include <drm/drm_crtc.h>
drivers/staging/gma500/mdfld_dsi_output.h +0 -1
index 0bf00ea..4300f10 100644
@@ -29,7 +29,6 @@
 #define __MDFLD_DSI_OUTPUT_H__
 
 #include <linux/backlight.h>
-#include <linux/version.h>
 #include <drm/drmP.h>
 #include <drm/drm.h>
 #include <drm/drm_crtc.h>
drivers/staging/gma500/psb_drv.h +0 -1
index 9e4f361..c19045f 100644
@@ -20,7 +20,6 @@
 #ifndef _PSB_DRV_H_
 #define _PSB_DRV_H_
 
-#include <linux/version.h>
 #include <linux/kref.h>
 
 #include <drm/drmP.h>
author
#2 lore raw

PATCH 2/12 gma500: Re-order checks and dereferences in psb_intel_lvds

In reply to Alan Cox

From: Alan Cox <[email protected]>

Dan Carpenter reports:

Smatch complains about 6a7afe3acc4b "gma500: continue abstracting platform specific code"

drivers/staging/gma500/psb_intel_lvds.c +579 psb_intel_lvds_set_property(7)
warn: variable dereferenced before check 'encoder'

drivers/staging/gma500/psb_intel_lvds.c +0 -0
@@ -575,11 +575,12 @@ int psb_intel_lvds_set_property(struct drm_connector

*connector,
struct drm_property *property, uint64_t value)
{

-       struct drm_encoder *pEncoder = connector->encoder;
+       struct drm_encoder *encoder = connector->encoder;
+       struct drm_psb_private *dev_priv = encoder->dev->dev_private;
                                           ^^^^^^^^^^^^

dereference encoder here.

---

 drivers/staging/gma500/psb_intel_lvds.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
drivers/staging/gma500/psb_intel_lvds.c +9 -4
index 4a0d234..1e1e788 100644
@@ -574,9 +574,14 @@ int psb_intel_lvds_set_property(struct drm_connector *connector,
 				       uint64_t value)
 {
 	struct drm_encoder *encoder = connector->encoder;
-	struct drm_psb_private *dev_priv = encoder->dev->dev_private;
+	struct drm_psb_private *dev_priv;
+	
+	if (!encoder)
+	        return -1;
 
-	if (!strcmp(property->name, "scaling mode") && encoder) {
+	dev_priv = encoder->dev->dev_private;
+
+	if (!strcmp(property->name, "scaling mode")) {
 		struct psb_intel_crtc *pPsbCrtc =
 					to_psb_intel_crtc(encoder->crtc);
 		uint64_t curValue;
@@ -617,7 +622,7 @@ int psb_intel_lvds_set_property(struct drm_connector *connector,
 						      encoder->crtc->fb))
 				goto set_prop_error;
 		}
-	} else if (!strcmp(property->name, "backlight") && encoder) {
+	} else if (!strcmp(property->name, "backlight")) {
 		if (drm_connector_property_set_value(connector,
 							property,
 							value))
@@ -631,7 +636,7 @@ int psb_intel_lvds_set_property(struct drm_connector *connector,
                         }
 #endif
 		}
-	} else if (!strcmp(property->name, "DPMS") && encoder) {
+	} else if (!strcmp(property->name, "DPMS")) {
 		struct drm_encoder_helper_funcs *pEncHFuncs
 						= encoder->helper_private;
 		pEncHFuncs->dpms(encoder, value);
#3 lore raw

Re: [PATCH 02/12] gma500: Re-order checks and dereferences in psb_intel_lvds

Quoted 23 lines · Alan Cox

From: Alan Cox <[email protected]>

Dan Carpenter reports:

Smatch complains about 6a7afe3acc4b "gma500: continue abstracting platform specific code"

drivers/staging/gma500/psb_intel_lvds.c +579 psb_intel_lvds_set_property(7)
warn: variable dereferenced before check 'encoder'

drivers/staging/gma500/psb_intel_lvds.c +2 -1
@@ -575,11 +575,12 @@ int psb_intel_lvds_set_property(struct drm_connector
 *connector,
                                       struct drm_property *property,
                                       uint64_t value)
 {
-       struct drm_encoder *pEncoder = connector->encoder;
+       struct drm_encoder *encoder = connector->encoder;
+       struct drm_psb_private *dev_priv = encoder->dev->dev_private;
                                           ^^^^^^^^^^^^

dereference encoder here.

Quoted 1 line

Oh that played hell with git, please don't do that again...

author
#4 lore raw

Re: [PATCH 02/12] gma500: Re-order checks and dereferences in psb_intel_lvds

Quoted 3 lines
Quoted 1 line

Oh that played hell with git, please don't do that again...

Sorry didn't realise git was flaky in that area.

Alan

author
#5 lore raw

PATCH 3/12 gma500: psb_intel_lvds style

In reply to Alan Cox

From: Alan Cox <[email protected]>

Fixed some stylistic uglies noticed while fixing the previous bug

---

 drivers/staging/gma500/psb_intel_lvds.c |   49 +++++++++++++++----------------
 1 files changed, 23 insertions(+), 26 deletions(-)
drivers/staging/gma500/psb_intel_lvds.c +23 -26
index 1e1e788..c4111b5 100644
@@ -30,10 +30,7 @@
 #include "power.h"
 #include <linux/pm_runtime.h>
 
-u32 CoreClock;
-u32 PWMControlRegFreq;
-
-/**
+/*
  * LVDS I2C backlight control macros
  */
 #define BRIGHTNESS_MAX_LEVEL 100
@@ -51,7 +48,7 @@ u32 PWMControlRegFreq;
 #define PSB_BACKLIGHT_PWM_POLARITY_BIT_CLEAR (0xFFFE)
 
 struct psb_intel_lvds_priv {
-	/**
+	/*
 	 * Saved LVDO output states
 	 */
 	uint32_t savePP_ON;
@@ -64,9 +61,8 @@ struct psb_intel_lvds_priv {
 	uint32_t saveBLC_PWM_CTL;
 };
 
-/* MRST defines end */
 
-/**
+/*
  * Returns the maximum level of the backlight duty cycle field.
  */
 static u32 psb_intel_lvds_get_max_backlight(struct drm_device *dev)
@@ -161,7 +157,7 @@ static int psb_lvds_pwm_set_brightness(struct drm_device *dev, int level)
 	return 0;
 }
 
-/**
+/*
  * Set LVDS backlight level either by I2C or PWM
  */
 void psb_intel_lvds_set_brightness(struct drm_device *dev, int level)
@@ -183,10 +179,10 @@ void psb_intel_lvds_set_brightness(struct drm_device *dev, int level)
 		psb_lvds_pwm_set_brightness(dev, level);
 }
 
-/**
+/*
  * Sets the backlight level.
  *
- * \param level backlight level, from 0 to psb_intel_lvds_get_max_backlight().
+ * level: backlight level, from 0 to psb_intel_lvds_get_max_backlight().
  */
 static void psb_intel_lvds_set_backlight(struct drm_device *dev, int level)
 {
@@ -208,7 +204,7 @@ static void psb_intel_lvds_set_backlight(struct drm_device *dev, int level)
 	}
 }
 
-/**
+/*
  * Sets the power state for the panel.
  */
 static void psb_intel_lvds_set_power(struct drm_device *dev,
@@ -501,7 +497,7 @@ static void psb_intel_lvds_mode_set(struct drm_encoder *encoder,
 	REG_WRITE(PFIT_CONTROL, pfit_control);
 }
 
-/**
+/*
  * Detect the LVDS connection.
  *
  * This always returns CONNECTOR_STATUS_CONNECTED.
@@ -514,7 +510,7 @@ static enum drm_connector_status psb_intel_lvds_detect(struct drm_connector
 	return connector_status_connected;
 }
 
-/**
+/*
  * Return the list of DDC modes if available, or the BIOS fixed mode otherwise.
  */
 static int psb_intel_lvds_get_modes(struct drm_connector *connector)
@@ -575,18 +571,18 @@ int psb_intel_lvds_set_property(struct drm_connector *connector,
 {
 	struct drm_encoder *encoder = connector->encoder;
 	struct drm_psb_private *dev_priv;
-	
+
 	if (!encoder)
-	        return -1;
+		return -1;
 
 	dev_priv = encoder->dev->dev_private;
 
 	if (!strcmp(property->name, "scaling mode")) {
-		struct psb_intel_crtc *pPsbCrtc =
+		struct psb_intel_crtc *crtc =
 					to_psb_intel_crtc(encoder->crtc);
 		uint64_t curValue;
 
-		if (!pPsbCrtc)
+		if (!crtc)
 			goto set_prop_error;
 
 		switch (value) {
@@ -613,10 +609,10 @@ int psb_intel_lvds_set_property(struct drm_connector *connector,
 							value))
 			goto set_prop_error;
 
-		if (pPsbCrtc->saved_mode.hdisplay != 0 &&
-		    pPsbCrtc->saved_mode.vdisplay != 0) {
+		if (crtc->saved_mode.hdisplay != 0 &&
+		    crtc->saved_mode.vdisplay != 0) {
 			if (!drm_crtc_helper_set_mode(encoder->crtc,
-						      &pPsbCrtc->saved_mode,
+						      &crtc->saved_mode,
 						      encoder->crtc->x,
 						      encoder->crtc->y,
 						      encoder->crtc->fb))
@@ -629,11 +625,12 @@ int psb_intel_lvds_set_property(struct drm_connector *connector,
 			goto set_prop_error;
 		else {
 #ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
-			struct backlight_device *bd = dev_priv->backlight_device;
+			struct backlight_device *bd =
+					dev_priv->backlight_device;
 			if (bd) {
-        			bd->props.brightness = value;
-	        		backlight_update_status(bd);
-                        }
+				bd->props.brightness = value;
+				backlight_update_status(bd);
+			}
 #endif
 		}
 	} else if (!strcmp(property->name, "DPMS")) {
@@ -749,7 +746,7 @@ void psb_intel_lvds_init(struct drm_device *dev,
 				      dev_priv->backlight_property,
 				      BRIGHTNESS_MAX_LEVEL);
 
-	/**
+	/*
 	 * Set up I2C bus
 	 * FIXME: distroy i2c_bus when exit
 	 */
@@ -797,7 +794,7 @@ void psb_intel_lvds_init(struct drm_device *dev,
 		}
 	}
 
-	/* Failed to get EDID, what about VBT? do we need this?*/
+	/* Failed to get EDID, what about VBT? do we need this? */
 	if (mode_dev->vbt_mode)
 		mode_dev->panel_fixed_mode =
 		    drm_mode_duplicate(dev, mode_dev->vbt_mode);
author
#6 lore raw

PATCH 4/12 gma500: Fix symbol clash with i915

In reply to Alan Cox

From: Alan Cox <[email protected]>

Randy Dunlap reports:

| when both CONFIG_DRM_I915=y and CONFIG_DRM_PSB=y:
| drivers/staging/built-in.o: In function `intel_opregion_init':
| (.text+0x47943): multiple definition of `intel_opregion_init'
| drivers/gpu/built-in.o:(.text+0x17277a): first defined here

---

 drivers/staging/gma500/cdv_device.c     |    2 +-
 drivers/staging/gma500/intel_opregion.c |    4 ++--
 drivers/staging/gma500/psb_device.c     |    2 +-
 drivers/staging/gma500/psb_drv.c        |    2 +-
 drivers/staging/gma500/psb_drv.h        |    4 ++--
 5 files changed, 7 insertions(+), 7 deletions(-)
drivers/staging/gma500/cdv_device.c +1 -1
index 680f1bb..3729a97 100644
@@ -319,7 +319,7 @@ static void cdv_get_core_freq(struct drm_device *dev)
 static int cdv_chip_setup(struct drm_device *dev)
 {
 	cdv_get_core_freq(dev);
-	intel_opregion_init(dev);
+	gma_intel_opregion_init(dev);
 	psb_intel_init_bios(dev);
 	return 0;
 }
drivers/staging/gma500/intel_opregion.c +2 -2
index 8240965..d2e6037 100644
@@ -47,7 +47,7 @@ struct opregion_acpi {
 	/*FIXME: add it later*/
 } __packed;
 
-int intel_opregion_init(struct drm_device *dev)
+int gma_intel_opregion_init(struct drm_device *dev)
 {
 	struct drm_psb_private *dev_priv = dev->dev_private;
 	u32 opregion_phy;
@@ -71,7 +71,7 @@ int intel_opregion_init(struct drm_device *dev)
 	return 0;
 }
 
-int intel_opregion_exit(struct drm_device *dev)
+int gma_intel_opregion_exit(struct drm_device *dev)
 {
 	struct drm_psb_private *dev_priv = dev->dev_private;
 	if (dev_priv->lid_state)
drivers/staging/gma500/psb_device.c +1 -1
index 0774c06..e26a176 100644
@@ -322,7 +322,7 @@ static void psb_get_core_freq(struct drm_device *dev)
 static int psb_chip_setup(struct drm_device *dev)
 {
 	psb_get_core_freq(dev);
-	intel_opregion_init(dev);
+	gma_intel_opregion_init(dev);
 	psb_intel_init_bios(dev);
 	return 0;
 }
drivers/staging/gma500/psb_drv.c +1 -1
index 264fdf4..397b605 100644
@@ -245,7 +245,7 @@ static int psb_driver_unload(struct drm_device *dev)
 
 	if (dev_priv) {
 		psb_lid_timer_takedown(dev_priv);
-		intel_opregion_exit(dev);
+		gma_intel_opregion_exit(dev);
 
 		psb_do_takedown(dev);
 
drivers/staging/gma500/psb_drv.h +2 -2
index c19045f..f5ecd6d 100644
@@ -728,8 +728,8 @@ extern void mdfld_disable_te(struct drm_device *dev, int pipe);
 /*
  * intel_opregion.c
  */
-extern int intel_opregion_init(struct drm_device *dev);
-extern int intel_opregion_exit(struct drm_device *dev);
+extern int gma_intel_opregion_init(struct drm_device *dev);
+extern int gma_intel_opregion_exit(struct drm_device *dev);
 
 /*
  * framebuffer.c
author
#7 lore raw

PATCH 5/12 gma500: Mask out bits not part of the page table base address

In reply to Alan Cox

From: Patrik Jakobsson <[email protected]>

Otherwise we can't ioremap the gtt and the screen gets garbled.

---

 drivers/staging/gma500/gtt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/gma500/gtt.c +1 -1
index 28f2261..78dd01b 100644
@@ -397,7 +397,7 @@ int psb_gtt_init(struct drm_device *dev, int resume)
 	/* The root resource we allocate address space from */
 	dev_priv->gtt_initialized = 1;
 
-	pg->gtt_phys_start = dev_priv->pge_ctl;
+	pg->gtt_phys_start = dev_priv->pge_ctl & PAGE_MASK;
 	
 	/*
 	 *	FIXME: video mmu has hw bug to access 0x0D0000000,
author
#8 lore raw

PATCH 6/12 gma500: tidy up the CDV files

In reply to Alan Cox

From: Alan Cox <[email protected]>

We are close to having PSB and CDV ready for moving from staging so it's time to get the polish out.

---

 drivers/staging/gma500/cdv_device.c        |   21 +++--
 drivers/staging/gma500/cdv_intel_crt.c     |   23 +++---
 drivers/staging/gma500/cdv_intel_display.c |  115 +++++++++++++---------------
 drivers/staging/gma500/cdv_intel_hdmi.c    |   80 ++++++++++---------
 drivers/staging/gma500/cdv_intel_lvds.c    |   20 +++--
 5 files changed, 133 insertions(+), 126 deletions(-)
drivers/staging/gma500/cdv_device.c +11 -10
index 3729a97..87614e0 100644
@@ -129,7 +129,6 @@ static int cdv_backlight_setup(struct drm_device *dev)
 
 static int cdv_set_brightness(struct backlight_device *bd)
 {
-	struct drm_device *dev = bl_get_data(cdv_backlight_device);
 	int level = bd->props.brightness;
 
 	/* Percentage 1-100% being valid */
@@ -188,9 +187,9 @@ static inline u32 CDV_MSG_READ32(uint port, uint offset)
 {
 	int mcr = (0x10<<24) | (port << 16) | (offset << 8);
 	uint32_t ret_val = 0;
-	struct pci_dev *pci_root = pci_get_bus_and_slot (0, 0);
-	pci_write_config_dword (pci_root, 0xD0, mcr);
-	pci_read_config_dword (pci_root, 0xD4, &ret_val);
+	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	pci_write_config_dword(pci_root, 0xD0, mcr);
+	pci_read_config_dword(pci_root, 0xD4, &ret_val);
 	pci_dev_put(pci_root);
 	return ret_val;
 }
@@ -198,9 +197,9 @@ static inline u32 CDV_MSG_READ32(uint port, uint offset)
 static inline void CDV_MSG_WRITE32(uint port, uint offset, u32 value)
 {
 	int mcr = (0x11<<24) | (port << 16) | (offset << 8) | 0xF0;
-	struct pci_dev *pci_root = pci_get_bus_and_slot (0, 0);
-	pci_write_config_dword (pci_root, 0xD4, value);
-	pci_write_config_dword (pci_root, 0xD0, mcr);
+	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	pci_write_config_dword(pci_root, 0xD4, value);
+	pci_write_config_dword(pci_root, 0xD0, mcr);
 	pci_dev_put(pci_root);
 }
 
@@ -218,8 +217,10 @@ static void cdv_init_pm(struct drm_device *dev)
 	u32 pwr_cnt;
 	int i;
 
-	dev_priv->apm_base = CDV_MSG_READ32(PSB_PUNIT_PORT, PSB_APMBA) & 0xFFFF;
-	dev_priv->ospm_base = CDV_MSG_READ32(PSB_PUNIT_PORT, PSB_OSPMBA) & 0xFFFF;
+	dev_priv->apm_base = CDV_MSG_READ32(PSB_PUNIT_PORT,
+							PSB_APMBA) & 0xFFFF;
+	dev_priv->ospm_base = CDV_MSG_READ32(PSB_PUNIT_PORT,
+							PSB_OSPMBA) & 0xFFFF;
 
 	/* Force power on for now */
 	pwr_cnt = inl(dev_priv->apm_base + PSB_APM_CMD);
@@ -346,5 +347,5 @@ const struct psb_ops cdv_chip_ops = {
 	.save_regs = cdv_save_display_registers,
 	.restore_regs = cdv_restore_display_registers,
 	.power_down = cdv_power_down,
-	.power_up = cdv_power_up,	
+	.power_up = cdv_power_up,
 };
drivers/staging/gma500/cdv_intel_crt.c +13 -10
index e26749c..efda63b 100644
@@ -45,7 +45,7 @@ static void cdv_intel_crt_dpms(struct drm_encoder *encoder, int mode)
 	temp &= ~(ADPA_HSYNC_CNTL_DISABLE | ADPA_VSYNC_CNTL_DISABLE);
 	temp &= ~ADPA_DAC_ENABLE;
 
-	switch(mode) {
+	switch (mode) {
 	case DRM_MODE_DPMS_ON:
 		temp |= ADPA_DAC_ENABLE;
 		break;
@@ -128,11 +128,10 @@ static void cdv_intel_crt_mode_set(struct drm_encoder *encoder,
 	if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC)
 		adpa |= ADPA_VSYNC_ACTIVE_HIGH;
 
-	if (psb_intel_crtc->pipe == 0) {
+	if (psb_intel_crtc->pipe == 0)
 		adpa |= ADPA_PIPE_A_SELECT;
-	} else {
+	else
 		adpa |= ADPA_PIPE_B_SELECT;
-	}
 
 	REG_WRITE(adpa_reg, adpa);
 }
@@ -144,7 +143,8 @@ static void cdv_intel_crt_mode_set(struct drm_encoder *encoder,
  * \return true if CRT is connected.
  * \return false if CRT is disconnected.
  */
-static bool cdv_intel_crt_detect_hotplug(struct drm_connector *connector, bool force)
+static bool cdv_intel_crt_detect_hotplug(struct drm_connector *connector,
+								bool force)
 {
 	struct drm_device *dev = connector->dev;
 	u32 hotplug_en;
@@ -193,7 +193,8 @@ static bool cdv_intel_crt_detect_hotplug(struct drm_connector *connector, bool f
 	return ret;
 }
 
-static enum drm_connector_status cdv_intel_crt_detect(struct drm_connector *connector, bool force)
+static enum drm_connector_status cdv_intel_crt_detect(
+				struct drm_connector *connector, bool force)
 {
 	if (cdv_intel_crt_detect_hotplug(connector, force))
 		return connector_status_connected;
@@ -245,7 +246,8 @@ static const struct drm_connector_funcs cdv_intel_crt_connector_funcs = {
 	.set_property = cdv_intel_crt_set_property,
 };
 
-static const struct drm_connector_helper_funcs cdv_intel_crt_connector_helper_funcs = {
+static const struct drm_connector_helper_funcs
+				cdv_intel_crt_connector_helper_funcs = {
 	.mode_valid = cdv_intel_crt_mode_valid,
 	.get_modes = cdv_intel_crt_get_modes,
 	.best_encoder = psb_intel_best_encoder,
@@ -277,11 +279,11 @@ void cdv_intel_crt_init(struct drm_device *dev,
 	psb_intel_output->mode_dev = mode_dev;
 	connector = &psb_intel_output->base;
 	drm_connector_init(dev, connector,
-			   &cdv_intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA);
+		&cdv_intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA);
 
 	encoder = &psb_intel_output->enc;
 	drm_encoder_init(dev, encoder,
-				&cdv_intel_crt_enc_funcs, DRM_MODE_ENCODER_DAC);
+		&cdv_intel_crt_enc_funcs, DRM_MODE_ENCODER_DAC);
 
 	drm_mode_connector_attach_encoder(&psb_intel_output->base,
 					  &psb_intel_output->enc);
@@ -310,7 +312,8 @@ void cdv_intel_crt_init(struct drm_device *dev,
 	connector->doublescan_allowed = 0;
 
 	drm_encoder_helper_add(encoder, &cdv_intel_crt_helper_funcs);
-	drm_connector_helper_add(connector, &cdv_intel_crt_connector_helper_funcs);
+	drm_connector_helper_add(connector,
+					&cdv_intel_crt_connector_helper_funcs);
 
 	drm_sysfs_connector_add(connector);
 
drivers/staging/gma500/cdv_intel_display.c +55 -60

244 lines not on this page · raw message

drivers/staging/gma500/cdv_intel_hdmi.c +42 -38

183 lines not on this page · raw message

drivers/staging/gma500/cdv_intel_lvds.c +12 -8
index d9b2290..19ad9bb 100644
@@ -11,7 +11,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 
+ * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  *
  * Authors:
@@ -200,7 +200,7 @@ static void cdv_intel_lvds_set_power(struct drm_device *dev,
 	u32 pp_status;
 
 	if (!gma_power_begin(dev, true))
-	        return;
+		return;
 
 	if (on) {
 		REG_WRITE(PP_CONTROL, REG_READ(PP_CONTROL) |
@@ -390,7 +390,8 @@ static void cdv_intel_lvds_mode_set(struct drm_encoder *encoder,
  * This connector should only have
  * been set up if the LVDS was actually connected anyway.
  */
-static enum drm_connector_status cdv_intel_lvds_detect(struct drm_connector *connector, bool force)
+static enum drm_connector_status cdv_intel_lvds_detect(
+				struct drm_connector *connector, bool force)
 {
 	return connector_status_connected;
 }
@@ -503,21 +504,24 @@ int cdv_intel_lvds_set_property(struct drm_connector *connector,
 			return -1;
 		else {
 #ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
-                	struct drm_psb_private *dev_priv =
+			struct drm_psb_private *dev_priv =
 						encoder->dev->dev_private;
-			struct backlight_device *bd = dev_priv->backlight_device;
+			struct backlight_device *bd =
+						dev_priv->backlight_device;
 			bd->props.brightness = value;
 			backlight_update_status(bd);
 #endif
 		}
 	} else if (!strcmp(property->name, "DPMS") && encoder) {
-		struct drm_encoder_helper_funcs *helpers = encoder->helper_private;
+		struct drm_encoder_helper_funcs *helpers =
+					encoder->helper_private;
 		helpers->dpms(encoder, value);
 	}
 	return 0;
 }
 
-static const struct drm_encoder_helper_funcs cdv_intel_lvds_helper_funcs = {
+static const struct drm_encoder_helper_funcs
+					cdv_intel_lvds_helper_funcs = {
 	.dpms = cdv_intel_lvds_encoder_dpms,
 	.mode_fixup = cdv_intel_lvds_mode_fixup,
 	.prepare = cdv_intel_lvds_prepare,
@@ -526,7 +530,7 @@ static const struct drm_encoder_helper_funcs cdv_intel_lvds_helper_funcs = {
 };
 
 static const struct drm_connector_helper_funcs
-    cdv_intel_lvds_connector_helper_funcs = {
+				cdv_intel_lvds_connector_helper_funcs = {
 	.get_modes = cdv_intel_lvds_get_modes,
 	.mode_valid = cdv_intel_lvds_mode_valid,
 	.best_encoder = psb_intel_best_encoder,
author
#9 lore raw

PATCH 7/12 gma500: tidy the mrst files

In reply to Alan Cox

From: Alan Cox <[email protected]>

---

 drivers/staging/gma500/mrst_device.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/gma500/mrst_device.c +2 -2
index 195a25b..436580d 100644
@@ -155,7 +155,7 @@ int mrst_backlight_init(struct drm_device *dev)
 
 	mrst_backlight_device = backlight_device_register("mrst-bl",
 					NULL, (void *)dev, &mrst_ops, &props);
-					
+
 	if (IS_ERR(mrst_backlight_device))
 		return PTR_ERR(mrst_backlight_device);
 
@@ -367,7 +367,7 @@ const struct psb_ops mrst_chip_ops = {
 #ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
 	.backlight_init = mrst_backlight_init,
 #endif
-	
+
 	.init_pm = mrst_init_pm,
 	.save_regs = mrst_save_display_registers,
 	.restore_regs = mrst_restore_display_registers,
author
#10 lore raw

PATCH 8/12 gma500; clean mid files

In reply to Alan Cox

From: Alan Cox <[email protected]>

---

 drivers/staging/gma500/mid_bios.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
drivers/staging/gma500/mid_bios.c +4 -6
index 9a7731c..8cfe301 100644
@@ -237,19 +237,17 @@ static void mid_get_vbt_data(struct drm_psb_private *dev_priv)
 		dev_err(dev->dev, "Unknown revision of GCT!\n");
 		vbt->size = 0;
 	}
-	if (IS_MFLD(dev_priv->dev)){
+	if (IS_MFLD(dev_priv->dev)) {
 		if (panel_id == GCT_DETECT) {
 			if (dev_priv->gct_data.bpi == 2) {
 				dev_info(dev->dev, "[GFX] PYR Panel Detected\n");
 				dev_priv->panel_id = PYR_CMD;
 				panel_id = PYR_CMD;
-			}
-			else if(dev_priv->gct_data.bpi == 0) {
+			} else if (dev_priv->gct_data.bpi == 0) {
 				dev_info(dev->dev, "[GFX] TMD Panel Detected.\n");
 				dev_priv->panel_id = TMD_VID;
 				panel_id = TMD_VID;
-			}
-			else {
+			} else {
 				dev_info(dev->dev, "[GFX] Default Panel (TPO)\n");
 				dev_priv->panel_id = TPO_CMD;
 				panel_id = TPO_CMD;
@@ -268,4 +266,4 @@ int mid_chip_setup(struct drm_device *dev)
 	mid_get_vbt_data(dev_priv);
 	mid_get_pci_revID(dev_priv);
 	return 0;
-}
\ No newline at end of file
+}
author
#11 lore raw

PATCH 9/12 gma500: Fix unused variable in cdv support

In reply to Alan Cox

From: Alan Cox <[email protected]>

---

 drivers/staging/gma500/cdv_intel_hdmi.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/staging/gma500/cdv_intel_hdmi.c +0 -1
index 7f86c0c..cbca2b0 100644
@@ -133,7 +133,6 @@ static void cdv_hdmi_restore(struct drm_connector *connector)
 static enum drm_connector_status cdv_hdmi_detect(
 				struct drm_connector *connector, bool force)
 {
-	struct drm_device *dev = connector->dev;
 	struct psb_intel_output *psb_intel_output =
 						to_psb_intel_output(connector);
 	struct mid_intel_hdmi_priv *hdmi_priv = psb_intel_output->dev_priv;
author
#12 lore raw

PATCH 10/12 Staging: gma500: typo in array initialization

In reply to Alan Cox

From: Dan Carpenter <[email protected]>

There is a comma missing here between the strings so they were concatenated by mistake.

---

 drivers/staging/gma500/mdfld_dsi_pkg_sender.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/gma500/mdfld_dsi_pkg_sender.c +1 -1
index 9198aa8..9b543eb 100644
@@ -62,7 +62,7 @@ static const char * const dsi_errors[] = {
 	"RX Prot Violation",
 	"HS Generic Write FIFO Full",
 	"LP Generic Write FIFO Full",
-	"Generic Read Data Avail"
+	"Generic Read Data Avail",
 	"Special Packet Sent",
 	"Tearing Effect",
 };
author
#13 lore raw

PATCH 11/12 gma500: reversed test in mdfld_dbi_dsr_exit()

In reply to Alan Cox

From: Dan Carpenter <[email protected]>

We should only cleanup "dsr_info" if it's non-NULL obviously and not the other way around.

---

 drivers/staging/gma500/mdfld_dsi_dbi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/gma500/mdfld_dsi_dbi.c +1 -1
index 9d2d97d..4897345 100644
@@ -642,7 +642,7 @@ void mdfld_dbi_dsr_exit(struct drm_device *dev)
 	struct drm_psb_private *dev_priv = dev->dev_private;
 	struct mdfld_dbi_dsr_info *dsr_info = dev_priv->dbi_dsr_info;
 
-	if (!dsr_info) {
+	if (dsr_info) {
 		del_timer_sync(&dsr_info->dsr_timer);
 		kfree(dsr_info);
 		dev_priv->dbi_dsr_info = NULL;
author
#14 lore raw

PATCH 12/12 gma500: remove unneeded check in mdfld_crtc_mode_set()

In reply to Alan Cox

From: Dan Carpenter <[email protected]>

The list cursor is never NULL in a list_for_each_entry() loop.

---

 drivers/staging/gma500/mdfld_intel_display.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/staging/gma500/mdfld_intel_display.c +0 -2
index 1447a5b..fa84990 100644
@@ -1093,8 +1093,6 @@ static int mdfld_crtc_mode_set(struct drm_crtc *crtc,
 	memcpy(&psb_intel_crtc->saved_adjusted_mode, adjusted_mode, sizeof(struct drm_display_mode));
 
 	list_for_each_entry(connector, &mode_config->connector_list, head) {
-		if(!connector)
-			continue;
 			
 		encoder = connector->encoder;