From patchwork Tue Nov 10 13:23:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 7590951 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 536809F830 for ; Tue, 10 Nov 2015 13:25:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 431C120639 for ; Tue, 10 Nov 2015 13:25:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2788820793 for ; Tue, 10 Nov 2015 13:25:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753128AbbKJNZA (ORCPT ); Tue, 10 Nov 2015 08:25:00 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:55191 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753109AbbKJNY6 (ORCPT ); Tue, 10 Nov 2015 08:24:58 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NXL006J0P9LTTA0@mailout2.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Tue, 10 Nov 2015 13:24:57 +0000 (GMT) X-AuditID: cbfec7f5-f794b6d000001495-44-5641f029f025 Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 27.B8.05269.920F1465; Tue, 10 Nov 2015 13:24:57 +0000 (GMT) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NXL00L9RP94NP10@eusync1.samsung.com>; Tue, 10 Nov 2015 13:24:57 +0000 (GMT) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Inki Dae , Joonyoung Shim , Seung-Woo Kim , Andrzej Hajda , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Tobias Jakobi , Gustavo Padovan , Javier Martinez Canillas Subject: [PATCH 19/25] drm/exynos: add fb pointer to exynos_drm_plane_state Date: Tue, 10 Nov 2015 14:23:35 +0100 Message-id: <1447161821-1877-20-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1447161821-1877-1-git-send-email-m.szyprowski@samsung.com> References: <1447161821-1877-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrFLMWRmVeSWpSXmKPExsVy+t/xy7qaHxzDDHZ95LC4te4cq8XGGetZ La58fc9msfPBLnaLSfcnsFi8ebuGyeLFvYssFq9fGFrMOL+PyWLtkbvsFjMmv2SzaFv9gdVi 1a4/jA68Hjtn3WX3uN99nMnj3zF2jy39QN7OSXuZPPq2rGL0+LxJLoA9issmJTUnsyy1SN8u gSuj7dkHpoIXWhX//i9haWA8rtLFyMkhIWAi8e3TQhYIW0ziwr31bF2MXBxCAksZJRac+s0K 4TQxSXz89YoVpIpNwFCi620XG4gtIuAm0XR4JlicWeAws8ThqXUgtrCAt8SPw1PAalgEVCUu zJsAVsMr4CGx92sjE8Q2OYn/L1eA2ZxA8a0fPzOD2EIC7hI3my6yTGDkXcDIsIpRNLU0uaA4 KT3XSK84Mbe4NC9dLzk/dxMjJES/7mBceszqEKMAB6MSD++Ebw5hQqyJZcWVuYcYJTiYlUR4 GV87hgnxpiRWVqUW5ccXleakFh9ilOZgURLnnbnrfYiQQHpiSWp2ampBahFMlomDU6qBUah6 caEa+72f5y6k5tw6+EdIWHbVDf98xnmcG6ojcm+8CMpM/Jl6YT+PzSy/W/L6Tnt1lh3W0aha J+u6kLdxHUt88f27Op+MD1+4ohEQ/8HuSN2L17M69KonpJvdEDqsdvpr7TbF0rwviudNY8RY zszhXL7XMvjWUeG3i9sFmu+rrX7pK1lgp8RSnJFoqMVcVJwIAG0ko8hNAgAA Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 3c8b8e0240fe..50c65ef6b9d3 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 6b28e3f73e4e..8a4d3066c992 100644 --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c @@ -407,7 +407,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 bee0696ccddc..9ed52b04c0ba 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -55,9 +55,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 { @@ -66,6 +69,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 6c04ff6432d4..61452facc69a 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 348bcec30489..c49b241cafe5 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 467e98044751..541454c413a3 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -428,7 +428,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; @@ -538,7 +538,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;