From patchwork Tue May 28 07:58:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 2623251 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 825E6DFB78 for ; Tue, 28 May 2013 07:59:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8ED04E611F for ; Tue, 28 May 2013 00:59:04 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 81DC7E608A for ; Tue, 28 May 2013 00:58:51 -0700 (PDT) Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MNI008PF0TRS350@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Tue, 28 May 2013 16:58:49 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.113]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id 7A.3E.29708.9B364A15; Tue, 28 May 2013 16:58:49 +0900 (KST) X-AuditID: cbfee690-b7f6f6d00000740c-6f-51a463b9fdf7 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 33.02.21068.9B364A15; Tue, 28 May 2013 16:58:49 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.90.8.53]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MNI00IPN0U1RP00@mmp1.samsung.com>; Tue, 28 May 2013 16:58:49 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: drm/exynos: make overlay data to be updated to valid hw Date: Tue, 28 May 2013 16:58:48 +0900 Message-id: <1369727928-5613-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.5.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrHLMWRmVeSWpSXmKPExsWyRsSkUHdn8pJAg+5PJha9504yWVz5+p7N YtL9CSwWL+5dZLE42/SG3WLG5JdsDmwe2789YPW4332cyaNvyyrGAOYoLpuU1JzMstQifbsE royeL4uYCmZIVaxf8JS5gXGlWBcjJ4eEgInEx7NbmSFsMYkL99azdTFycQgJLGWUmPv2CTtM 0ZNr3SwQiUWMEh93TWMFSQgJdDFJPFpdA2KzCahKTFxxnw3EFhEwleiYtJQFxGYWSJP4/n0v 2CBhAQeJbZs2AdkcHCxA9ZM/O4KYvALOEtNXu0GsUpD4dWQVK8gqCYH3bBJPb38Da2UREJD4 NvkQC0i9hICsxKYDUDdLShxccYNlAqPgAkaGVYyiqQXJBcVJ6UUmesWJucWleel6yfm5mxiB YXn637MJOxjvHbA+xJgMNG4is5Rocj4wrPNK4g2NzYwsTE1MjY3MLc1IE1YS51VvsQ4UEkhP LEnNTk0tSC2KLyrNSS0+xMjEwSnVwBjzf/pVlygB7dUaG58vX57kY5q201Ly34aND3Zf7KzR 9O9fuZf5oWEuv37m6xdPFE2DXZkvaUlZJxW2fd+jKre363Lt67Z51TMcZpjuzDCp4np+SjbH LaDILvScQJXmv4L6F7MWqfgtUDu9WGzTsrhZPG+TN3LWSijeWl+fW2E9IWVjzvZD9UosxRmJ hlrMRcWJADoJzLFhAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrNIsWRmVeSWpSXmKPExsVy+t9jAd2dyUsCDb7161r0njvJZHHl63s2 i0n3J7BYvLh3kcXibNMbdosZk1+yObB5bP/2gNXjfvdxJo++LasYA5ijGhhtMlITU1KLFFLz kvNTMvPSbZW8g+Od403NDAx1DS0tzJUU8hJzU22VXHwCdN0yc4A2KymUJeaUAoUCEouLlfTt ME0IDXHTtYBpjND1DQmC6zEyQAMJaxgzer4sYiqYIVWxfsFT5gbGlWJdjJwcEgImEk+udbNA 2GISF+6tZ+ti5OIQEljEKPFx1zRWkISQQBeTxKPVNSA2m4CqxMQV99lAbBEBU4mOSUvBmpkF 0iS+f9/LDmILCzhIbNu0Ccjm4GABqp/82RHE5BVwlpi+2g1ilYLEryOrWCcwci9gZFjFKJpa kFxQnJSea6RXnJhbXJqXrpecn7uJERz0z6R3MK5qsDjEKMDBqMTDOyF7caAQa2JZcWXuIUYJ DmYlEV4R/yWBQrwpiZVVqUX58UWlOanFhxiTgXZPZJYSTc4HRmReSbyhsYmZkaWRuaGFkbE5 acJK4rwHW60DhQTSE0tSs1NTC1KLYLYwcXBKNTDycp6f/pf3W+CClXtYWhpjvvbzXQjZVOk1 q/pQXrPR+XUXTNpCm9r1tvw+tH+ZxwWFc+oF3Lv/tlx8MCHz3g6bHe51hlue6oettdn0fj9b +Jo4Na+TIkFS3T/VPzwIfeko9yLyZNv/vgKnw1ovrmyd0l2/desP7pn2G0pEdI+FXuqYLexX tKlFiaU4I9FQi7moOBEAN30wyb4CAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: kyungmin.park@samsung.com, sw0312.kim@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 makes sure that overlay data are updated to real hardware enabled when framebuffer is released. For this, this patch checks if crtc and encoder are valid or not, and then makes it waiting for signal synchroniztion to only valid encoder. Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 9 ++++++--- drivers/gpu/drm/exynos/exynos_drm_encoder.h | 2 +- drivers/gpu/drm/exynos/exynos_drm_fb.c | 13 +++++++++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c b/drivers/gpu/drm/exynos/exynos_drm_encoder.c index c63721f..9a6e3fd 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c +++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c @@ -220,18 +220,21 @@ static void exynos_drm_encoder_commit(struct drm_encoder *encoder) exynos_encoder->dpms = DRM_MODE_DPMS_ON; } -void exynos_drm_encoder_complete_scanout(struct drm_framebuffer *fb) +void exynos_drm_encoder_complete_scanout(struct drm_crtc *crtc) { struct exynos_drm_encoder *exynos_encoder; struct exynos_drm_manager_ops *ops; - struct drm_device *dev = fb->dev; + struct drm_device *dev = crtc->dev; struct drm_encoder *encoder; /* * make sure that overlay data are updated to real hardware - * for all encoders. + * for valid encoders. */ list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { + if (encoder->crtc != crtc) + continue; + exynos_encoder = to_exynos_encoder(encoder); ops = exynos_encoder->manager->ops; diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.h b/drivers/gpu/drm/exynos/exynos_drm_encoder.h index 89e2fb0..e8dee1c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_encoder.h +++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.h @@ -32,6 +32,6 @@ void exynos_drm_encoder_plane_mode_set(struct drm_encoder *encoder, void *data); void exynos_drm_encoder_plane_commit(struct drm_encoder *encoder, void *data); void exynos_drm_encoder_plane_enable(struct drm_encoder *encoder, void *data); void exynos_drm_encoder_plane_disable(struct drm_encoder *encoder, void *data); -void exynos_drm_encoder_complete_scanout(struct drm_framebuffer *fb); +void exynos_drm_encoder_complete_scanout(struct drm_crtc *crtc); #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c index 0e04f4e..1fc7ae6 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fb.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c @@ -68,12 +68,21 @@ static int check_fb_gem_memory_type(struct drm_device *drm_dev, static void exynos_drm_fb_destroy(struct drm_framebuffer *fb) { struct exynos_drm_fb *exynos_fb = to_exynos_fb(fb); + struct drm_device *dev = fb->dev; + struct drm_crtc *crtc; unsigned int i; DRM_DEBUG_KMS("%s\n", __FILE__); - /* make sure that overlay data are updated before relesing fb. */ - exynos_drm_encoder_complete_scanout(fb); + list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { + if (crtc->fb == fb) { + /* + * make sure that overlay data are updated before + * relesing fb. + */ + exynos_drm_encoder_complete_scanout(crtc); + } + } drm_framebuffer_cleanup(fb);