From patchwork Mon Nov 30 13:53:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 57466 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1490184lbb; Mon, 30 Nov 2015 06:00:44 -0800 (PST) X-Received: by 10.98.71.92 with SMTP id u89mr69537901pfa.143.1448891645995; Mon, 30 Nov 2015 05:54:05 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id 21si2028285pfq.214.2015.11.30.05.54.04; Mon, 30 Nov 2015 05:54:05 -0800 (PST) Received-SPF: pass (google.com: domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4C48E6E5BD; Mon, 30 Nov 2015 05:54:02 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout3.w1.samsung.com (mailout3.w1.samsung.com [210.118.77.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8892B6E5BD for ; Mon, 30 Nov 2015 05:53:56 -0800 (PST) Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NYM00AUZRXT8QB0@mailout3.w1.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 30 Nov 2015 13:53:53 +0000 (GMT) X-AuditID: cbfec7f5-f79b16d000005389-f0-565c54f12074 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id C2.78.21385.1F45C565; Mon, 30 Nov 2015 13:53:53 +0000 (GMT) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NYM007NRRXFE700@eusync2.samsung.com>; Mon, 30 Nov 2015 13:53:53 +0000 (GMT) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 16/22] drm/exynos: add fb pointer to exynos_drm_plane_state Date: Mon, 30 Nov 2015 14:53:31 +0100 Message-id: <1448891617-18830-17-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1448891617-18830-1-git-send-email-m.szyprowski@samsung.com> References: <1448891617-18830-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrFLMWRmVeSWpSXmKPExsVy+t/xK7ofQ2LCDDZv4rG4te4cq8XGGetZ La58fc9msfPBLnaLSfcnsFi8ebuGyeLFvYssFq9fGFrMOL+PyWLtkbvsFjMmv2SzaFv9gdVi 1a4/jA68Hjtn3WX3uN99nMnj3zF2jy39QN7OSXuZPPq2rGL0+LxJLoA9issmJTUnsyy1SN8u gSvj4p4fbAUvtCpWv5vO1MB4XKWLkZNDQsBEovHHSzYIW0ziwr31QDYXh5DAUkaJaRs2sUM4 TUwS37r+soJUsQkYSnS97QLrEBFwk2g6PBMszixwmFni8NQ6EFtYwE/i5uSFLCA2i4CqxJE1 l5hBbF4BT4ntHV/YIbbJSfx/uYIJxOYEij85exosLiTgIbFhxjGmCYy8CxgZVjGKppYmFxQn peca6RUn5haX5qXrJefnbmKEhOjXHYxLj1kdYhTgYFTi4ZUwiw4TYk0sK67MPcQowcGsJMIb aBoTJsSbklhZlVqUH19UmpNafIhRmoNFSZx35q73IUIC6YklqdmpqQWpRTBZJg5OqQbG+T83 /P36rvtOTsZsEbUzquf/Tvhvkiv+6o206emV9q/rA5tEN2gaPtvaVnhH6KTwlMuTQjwvqLKt nHfF+nDXja6kpCzmGOfJTRNjE06q6OT1r1U48zFUdPF/R1b14Dv772i9Om8pfrLzzrEkNfaC K3LNecs5HZhO8rNxlZ389YmrYz+H8iUZJZbijERDLeai4kQAmBy/8k0CAAA= Cc: Javier Martinez Canillas , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Seung-Woo Kim , Andrzej Hajda , Tobias Jakobi , Marek Szyprowski X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add framebuffer pointer to exynos_drm_plane_state and tell drivers to use it. This lets common plane code to set temporary framebuffer in the future and drivers will use it without additional changes. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 2 +- drivers/gpu/drm/exynos/exynos7_drm_decon.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_drv.h | 8 ++++++-- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_plane.c | 2 ++ drivers/gpu/drm/exynos/exynos_mixer.c | 4 ++-- 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c index 189ee5ca0a7a..1f705bede7dd 100644 --- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c @@ -269,7 +269,7 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc, struct exynos_drm_plane_state *state = to_exynos_plane_state(plane->base.state); struct decon_context *ctx = crtc->ctx; - struct drm_framebuffer *fb = state->base.fb; + struct drm_framebuffer *fb = state->fb; unsigned int win = plane->zpos; unsigned int bpp = fb->bits_per_pixel >> 3; unsigned int pitch = fb->pitches[0]; diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c index c47f9af8170b..17aa11702a40 100644 --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c @@ -402,7 +402,7 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc, struct exynos_drm_plane_state *state = to_exynos_plane_state(plane->base.state); struct decon_context *ctx = crtc->ctx; - struct drm_framebuffer *fb = state->base.fb; + struct drm_framebuffer *fb = state->fb; int padding; unsigned long val, alpha; unsigned int last_x; diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 82bbd7f4b316..bb2e449a20c3 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -53,9 +53,12 @@ struct exynos_drm_rect { * (clipped to visible part). * @h_ratio: horizontal scaling ratio, 16.16 fixed point * @v_ratio: vertical scaling ratio, 16.16 fixed point + * @fb: framebuffer with image data to be displayed (drivers should use this + * instead of .base->fb) * - * this structure consists plane state data that will be applied to hardware - * specific overlay info. + * This structure consists plane state data that will be applied to hardware + * specific overlay info. Some data is duplicated (comparing with base state) + * to let common code to modify it for internal use. */ struct exynos_drm_plane_state { @@ -64,6 +67,7 @@ struct exynos_drm_plane_state { struct exynos_drm_rect src; unsigned int h_ratio; unsigned int v_ratio; + struct drm_framebuffer *fb; }; static inline struct exynos_drm_plane_state * diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 2e2247126581..0046495173f3 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -650,7 +650,7 @@ static void fimd_update_plane(struct exynos_drm_crtc *crtc, struct exynos_drm_plane_state *state = to_exynos_plane_state(plane->base.state); struct fimd_context *ctx = crtc->ctx; - struct drm_framebuffer *fb = state->base.fb; + struct drm_framebuffer *fb = state->fb; dma_addr_t dma_addr; unsigned long val, size, offset; unsigned int last_x, last_y, buf_offsize, line_size; diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index 427aeec78a28..8a1242b5a938 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -117,6 +117,8 @@ static void exynos_plane_mode_set(struct exynos_drm_plane_state *exynos_state) exynos_state->crtc.w = actual_w; exynos_state->crtc.h = actual_h; + exynos_state->fb = state->fb; + DRM_DEBUG_KMS("plane : offset_x/y(%d,%d), width/height(%d,%d)", exynos_state->crtc.x, exynos_state->crtc.y, exynos_state->crtc.w, exynos_state->crtc.h); diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index dfb35e2da4db..787aa03f4359 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -425,7 +425,7 @@ static void vp_video_buffer(struct mixer_context *ctx, to_exynos_plane_state(plane->base.state); struct drm_display_mode *mode = &state->base.crtc->state->adjusted_mode; struct mixer_resources *res = &ctx->mixer_res; - struct drm_framebuffer *fb = state->base.fb; + struct drm_framebuffer *fb = state->fb; unsigned long flags; dma_addr_t luma_addr[2], chroma_addr[2]; bool tiled_mode = false; @@ -535,7 +535,7 @@ static void mixer_graph_buffer(struct mixer_context *ctx, to_exynos_plane_state(plane->base.state); struct drm_display_mode *mode = &state->base.crtc->state->adjusted_mode; struct mixer_resources *res = &ctx->mixer_res; - struct drm_framebuffer *fb = state->base.fb; + struct drm_framebuffer *fb = state->fb; unsigned long flags; unsigned int win = plane->zpos; unsigned int x_ratio = 0, y_ratio = 0;