Skip to contentSkip to conversation

drm: exynos: fix for loosing display mode header during mode adjustment

PATCH In review Rahul Sharma 2 participants 2 messages Nov 9, 2012 – Nov 14, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: exynos: fix for loosing display mode header during mode adjustment

This patch is to preserve the display mode header during the mode adjustment. Display mode header is overwritten with the adjusted mode header which is throwing the stack dump.

---
 drivers/gpu/drm/exynos/exynos_hdmi.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
drivers/gpu/drm/exynos/exynos_hdmi.c +8 -0
index ee110c9..c7844ea 100644
@@ -1974,6 +1974,8 @@ static void hdmi_mode_fixup(void *ctx, struct drm_connector *connector,
 {
 	struct drm_display_mode *m;
 	struct hdmi_context *hdata = ctx;
+	struct drm_mode_object base;
+	struct list_head head;
 	int index;
 
 	DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
@@ -2002,7 +2004,13 @@ static void hdmi_mode_fixup(void *ctx, struct drm_connector *connector,
 		if (index >= 0) {
 			DRM_INFO("desired mode doesn't exist so\n");
 			DRM_INFO("use the most suitable mode among modes.\n");
+
+			/* preserve display mode header while copying. */
+			head = adjusted_mode->head;
+			base = adjusted_mode->base;
 			memcpy(adjusted_mode, m, sizeof(*m));
+			adjusted_mode->head = head;
+			adjusted_mode->base = base;
 			break;
 		}
 	}
Signature · 1 line
1.7.0.4
maintainer
#1 lore raw

2012/11/9 Rahul Sharma <[email protected]>

Quoted 16 lines

This patch is to preserve the display mode header during the mode adjustment.
Display mode header is overwritten with the adjusted mode header which is throwing the stack dump.

---
 drivers/gpu/drm/exynos/exynos_hdmi.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
drivers/gpu/drm/exynos/exynos_hdmi.c +0 -0
index ee110c9..c7844ea 100644

drivers/gpu/drm/exynos/exynos_hdmi.c static void hdmi_mode_fixup(void *ctx, struct · line 1980

Quoted 7 lines
drivers/gpu/drm/exynos/exynos_hdmi.c +2 -0
@@ -1974,6 +1974,8 @@ static void hdmi_mode_fixup(void *ctx, struct
 drm_connector *connector,
 {
        struct drm_display_mode *m;
        struct hdmi_context *hdata = ctx;
+       struct drm_mode_object base;
+       struct list_head head;
 

Remove base and head,

drivers/gpu/drm/exynos/exynos_hdmi.c static void hdmi_mode_fixup(void *ctx, struct · line 2006

Quoted 7 lines
drivers/gpu/drm/exynos/exynos_hdmi.c +0 -0
        int index;
        DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
drivers/gpu/drm/exynos/exynos_hdmi.c +0 -0
@@ -2002,7 +2004,13 @@ static void hdmi_mode_fixup(void *ctx, struct
 drm_connector *connector,
                if (index >= 0) {
 

And declare them here.

Thanks,
Inki Dae

Quoted 13 lines
drivers/gpu/drm/exynos/exynos_hdmi.c +6 -0
                        DRM_INFO("desired mode doesn't exist so\n");
                        DRM_INFO("use the most suitable mode among
 modes.\n");
+
+                       /* preserve display mode header while copying. */
+                       head = adjusted_mode->head;
+                       base = adjusted_mode->base;
                        memcpy(adjusted_mode, m, sizeof(*m));
+                       adjusted_mode->head = head;
+                       adjusted_mode->base = base;
                        break;
                }
        }
Quoted 8 lines

--
1.7.0.4

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel