Skip to contentSkip to conversation

gma500: Prevent endless loop in panel power up sequence

PATCH New Alan Cox 1 participant 3 messages May 21, 2012

Subsystems (4)
lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/3 gma500: Prevent endless loop in panel power up sequence

From: Alan Cox <[email protected]>

Some devices don't have a panel connected to LVDS and thus will never power up. This patch checks the power sequence progress bits in PP_STATUS to prevent an endless loop on such devices.

---

 drivers/gpu/drm/gma500/psb_lid.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
drivers/gpu/drm/gma500/psb_lid.c +9 -3
index 7ff8bb2b..1d2ebb5 100644
@@ -40,10 +40,16 @@ static void psb_lid_timer_func(unsigned long data)
 		REG_WRITE(PP_CONTROL, REG_READ(PP_CONTROL) | POWER_TARGET_ON);
 		do {
 			pp_status = REG_READ(PP_STATUS);
-		} while ((pp_status & PP_ON) == 0);
+		} while ((pp_status & PP_ON) == 0 &&
+			 (pp_status & PP_SEQUENCE_MASK) != 0);
 
-		/*FIXME: should be backlight level before*/
-		psb_intel_lvds_set_brightness(dev, 100);
+		if (REG_READ(PP_STATUS) & PP_ON) {
+			/*FIXME: should be backlight level before*/
+			psb_intel_lvds_set_brightness(dev, 100);
+		} else {
+			DRM_DEBUG("LVDS panel never powered up");
+			return;
+		}
 	} else {
 		psb_intel_lvds_set_brightness(dev, 0);
 
author
#1 lore raw

PATCH 2/3 gma500: handle poulsbo cursor restriction

From: Patrik Jakobsson <[email protected]>

Poulsbo needs a physical address in the cursor base register. We allocate a stolen memory buffer and copy the cursor image provided by userspace into it. When/If we get our own userspace driver we can map this stolen memory directly. The patch also adds a mark in chip ops so we can identify devices that has this requirement.

---

 drivers/gpu/drm/gma500/cdv_device.c        |    1 
 drivers/gpu/drm/gma500/mdfld_device.c      |    1 
 drivers/gpu/drm/gma500/oaktrail_device.c   |    1 
 drivers/gpu/drm/gma500/psb_device.c        |    1 
 drivers/gpu/drm/gma500/psb_drv.h           |    1 
 drivers/gpu/drm/gma500/psb_intel_display.c |   62 +++++++++++++++++++++++++---
 drivers/gpu/drm/gma500/psb_intel_drv.h     |    6 ---
 7 files changed, 61 insertions(+), 12 deletions(-)
drivers/gpu/drm/gma500/cdv_device.c +1 -0
index 8e39330..9764045 100644
@@ -563,6 +563,7 @@ const struct psb_ops cdv_chip_ops = {
 	.crtcs = 2,
 	.hdmi_mask = (1 << 0) | (1 << 1),
 	.lvds_mask = (1 << 1),
+	.cursor_needs_phys = 0,
 	.sgx_offset = MRST_SGX_OFFSET,
 	.chip_setup = cdv_chip_setup,
 	.errata = cdv_errata,
drivers/gpu/drm/gma500/mdfld_device.c +1 -0
index 2d8e741..265ad0d 100644
@@ -531,6 +531,7 @@ const struct psb_ops mdfld_chip_ops = {
 	.crtcs = 3,
 	.lvds_mask = (1 << 1),
 	.hdmi_mask = (1 << 1),
+	.cursor_needs_phys = 0,
 	.sgx_offset = MRST_SGX_OFFSET,
 
 	.chip_setup = mdfld_chip_setup,
drivers/gpu/drm/gma500/oaktrail_device.c +1 -0
index 7a8ff8e..0f9b7db 100644
@@ -544,6 +544,7 @@ const struct psb_ops oaktrail_chip_ops = {
 	.crtcs = 2,
 	.hdmi_mask = (1 << 0),
 	.lvds_mask = (1 << 0),
+	.cursor_needs_phys = 0,
 	.sgx_offset = MRST_SGX_OFFSET,
 
 	.chip_setup = oaktrail_chip_setup,
drivers/gpu/drm/gma500/psb_device.c +1 -0
index 1726c04..2a3e2da 100644
@@ -373,6 +373,7 @@ const struct psb_ops psb_chip_ops = {
 	.crtcs = 2,
 	.hdmi_mask = (1 << 0),
 	.lvds_mask = (1 << 1),
+	.cursor_needs_phys = 1,
 	.sgx_offset = PSB_SGX_OFFSET,
 	.chip_setup = psb_chip_setup,
 	.chip_teardown = psb_chip_teardown,
drivers/gpu/drm/gma500/psb_drv.h +1 -0
index a1b0c0b..1bd115e 100644
@@ -655,6 +655,7 @@ struct psb_ops {
 	int sgx_offset;		/* Base offset of SGX device */
 	int hdmi_mask;		/* Mask of HDMI CRTCs */
 	int lvds_mask;		/* Mask of LVDS CRTCs */
+	int cursor_needs_phys;  /* If cursor base reg need physical address */
 
 	/* Sub functions */
 	struct drm_crtc_helper_funcs const *crtc_helper;
drivers/gpu/drm/gma500/psb_intel_display.c +55 -7

105 lines not on this page · raw message

drivers/gpu/drm/gma500/psb_intel_drv.h +1 -5
index 81852b4..2515f83 100644
@@ -106,11 +106,6 @@ struct psb_intel_mode_device {
 	 size_t(*bo_offset) (struct drm_device *dev, void *bo);
 
 	/*
-	 * Cursor (Can go ?)
-	 */
-	int cursor_needs_physical;
-
-	/*
 	 * LVDS info
 	 */
 	int backlight_duty_cycle;	/* restore backlight to this value */
@@ -176,6 +171,7 @@ struct psb_intel_crtc {
 	int pipe;
 	int plane;
 	uint32_t cursor_addr;
+	struct gtt_range *cursor_gt;
 	u8 lut_r[256], lut_g[256], lut_b[256];
 	u8 lut_adj[256];
 	struct psb_intel_framebuffer *fbdev_fb;
author
#2 lore raw

PATCH 3/3 gma500: Fix Poulsbo suspend/resume crash on devices with SDVO ports

In reply to Alan Cox

From: Alan Cox <[email protected]>

---

 drivers/gpu/drm/gma500/psb_device.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/gma500/psb_device.c +4 -2
index 2a3e2da..eff039b 100644
@@ -197,7 +197,8 @@ static int psb_save_display_registers(struct drm_device *dev)
 	}
 
 	list_for_each_entry(connector, &dev->mode_config.connector_list, head)
-		connector->funcs->save(connector);
+		if (connector->funcs->save)
+			connector->funcs->save(connector);
 
 	mutex_unlock(&dev->mode_config.mutex);
 	return 0;
@@ -235,7 +236,8 @@ static int psb_restore_display_registers(struct drm_device *dev)
 			crtc->funcs->restore(crtc);
 
 	list_for_each_entry(connector, &dev->mode_config.connector_list, head)
-		connector->funcs->restore(connector);
+		if (connector->funcs->restore)
+			connector->funcs->restore(connector);
 
 	mutex_unlock(&dev->mode_config.mutex);
 	return 0;

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html