From patchwork Fri Nov 9 12:08:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Sharma X-Patchwork-Id: 1726481 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 2B1DD3FCF7 for ; Mon, 12 Nov 2012 08:00:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0BBDA9EF6A for ; Mon, 12 Nov 2012 00:00:48 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by gabe.freedesktop.org (Postfix) with ESMTP id 05298A0C38 for ; Fri, 9 Nov 2012 03:51:45 -0800 (PST) Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MD700E3ZYA8U430@mailout3.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 09 Nov 2012 20:51:44 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.122]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id CA.A8.01231.05EEC905; Fri, 09 Nov 2012 20:51:44 +0900 (KST) X-AuditID: cbfee61a-b7fa66d0000004cf-8e-509cee5045b0 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 7A.A8.01231.F4EEC905; Fri, 09 Nov 2012 20:51:44 +0900 (KST) Received: from localhost.localdomain ([107.108.73.106]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MD70045WY1UMP50@mmp2.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 09 Nov 2012 20:51:43 +0900 (KST) From: Rahul Sharma To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm: exynos: fix for loosing display mode header during mode adjustment Date: Fri, 09 Nov 2012 17:38:02 +0530 Message-id: <1352462882-5515-1-git-send-email-rahul.sharma@samsung.com> X-Mailer: git-send-email 1.7.0.4 DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrILMWRmVeSWpSXmKPExsWyRsSkSjfg3ZwAg1WPeC2ufH3P5sDocb/7 OFMAYxSXTUpqTmZZapG+XQJXxrWfk9gLTnJVrFtu0sB4haOLkZNDQsBEYu6Xv+wQtpjEhXvr 2UBsIYGljBIrnll3MXKA1cxYYgQRns4o0dhi0MXIBWSvZpLY9/YkK0iCTUBXYvbBZ4wgtoiA ssTfiavAbGaB1YwSa98VgtjCAlES667fYQKxWQRUJX4dnQPWyyvgLjF58X8miBsUJFqXHWKH qBGQ+Db5EAvEDbISmw4wg+yVENjDJvHo8TeomyUlDq64wTKBUXABI8MqRtHUguSC4qT0XEO9 4sTc4tK8dL3k/NxNjMBwOv3vmdQOxpUNFocYBTgYlXh4Ex/MDhBiTSwrrsw9xCjBwawkwmt0 dk6AEG9KYmVValF+fFFpTmrxIUYfoEsmMkuJJucDQz2vJN7Q2MTc1NjU0sjIzNQUh7CSOG+z R0qAkEB6YklqdmpqQWoRzDgmDk6pBsapU2QO+N3PlOO6HbT7MIdP28nK+I/rF7A9nfxv6pOC cgF5Yx3pwm83XwbGqhyRucwhK5w087Z+2YZPs1J5bu5UNs/NeqW/NumhbM8PHYlnjn7KszLP KXRX+4QZf3opLO3MbCtV3Xomsc5xscsyWYvuqUYpEyImV7z4tGjKjr1XIs5s0FPbw63EUpyR aKjFXFScCACGs/UzVAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrILMWRmVeSWpSXmKPExsVy+t9jQd2Ad3MCDOZtY7S48vU9mwOjx/3u 40wBjFENjDYZqYkpqUUKqXnJ+SmZeem2St7B8c7xpmYGhrqGlhbmSgp5ibmptkouPgG6bpk5 QGOVFMoSc0qBQgGJxcVK+naYJoSGuOlawDRG6PqGBMH1GBmggYQ1jBnXfk5iLzjJVbFuuUkD 4xWOLkYODgkBE4kZS4y6GDmBTDGJC/fWs4HYQgLTGSUaWwy6GLmA7NVMEvvenmQFSbAJ6ErM PviMEcQWEVCW+DtxFZjNLLCaUWLtu0IQW1ggSmLd9TtMIDaLgKrEr6NzwHp5BdwlJi/+zwSx TEGiddkh9gmM3AsYGVYxiqYWJBcUJ6XnGuoVJ+YWl+al6yXn525iBIfrM6kdjCsbLA4xCnAw KvHwJj6YHSDEmlhWXJl7iFGCg1lJhNfo7JwAId6UxMqq1KL8+KLSnNTiQ4w+QNsnMkuJJucD YymvJN7Q2MTc1NjU0sTCxMwSh7CSOG+zR0qAkEB6YklqdmpqQWoRzDgmDk6pBkb14knbhOfP +ri6+9jl93fV7hyQ0bvjI7DviripgszdY62Lcv7z+P53kws7Ld44V/aw2+SKWZr6t0qelnzY sNDs8bTTP2Yu+L869KTne47EfcIXpnfx7s6WW/vQ5OGXbZ0+oXpCsUv9tTMYrJQ2MjR+uTxl 5bUfTOeDmM1+zrlm3dK+q4E//Gu8EktxRqKhFnNRcSIAvq6xy4QCAAA= X-CFilter-Loop: Reflected X-Mailman-Approved-At: Mon, 12 Nov 2012 00:00:29 -0800 Cc: prathyush.k@samsung.com, joshi@samsung.com, kyungmin.park@samsung.com, prashanth.g@samsung.com, rahul.sharma@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org 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. Signed-off-by: Rahul Sharma --- drivers/gpu/drm/exynos/exynos_hdmi.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index ee110c9..c7844ea 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -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; } }