From patchwork Thu Dec 24 08:15:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 7915711 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 49FE2BEEE5 for ; Thu, 24 Dec 2015 08:16:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 576FF2051D for ; Thu, 24 Dec 2015 08:16:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 72EC7205EA for ; Thu, 24 Dec 2015 08:16:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754830AbbLXIQB (ORCPT ); Thu, 24 Dec 2015 03:16:01 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:35911 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754829AbbLXIP6 (ORCPT ); Thu, 24 Dec 2015 03:15:58 -0500 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NZU02VYJSAIZ8D0@mailout1.samsung.com> for linux-samsung-soc@vger.kernel.org; Thu, 24 Dec 2015 17:15:54 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.115]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 69.E4.04972.AB9AB765; Thu, 24 Dec 2015 17:15:54 +0900 (KST) X-AuditID: cbfee68e-f793c6d00000136c-01-567ba9baa6ed Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 7E.6E.09068.9B9AB765; Thu, 24 Dec 2015 17:15:54 +0900 (KST) Content-transfer-encoding: 8BIT Received: from [10.113.62.206] by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NZU001UOSA99Q70@mmp2.samsung.com>; Thu, 24 Dec 2015 17:15:53 +0900 (KST) Message-id: <567BA9B1.5020607@samsung.com> Date: Thu, 24 Dec 2015 17:15:45 +0900 From: Inki Dae User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 To: Marek Szyprowski , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Cc: Joonyoung Shim , Seung-Woo Kim , Andrzej Hajda , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Tobias Jakobi , Gustavo Padovan Subject: Re: [PATCH v3 1/7] drm/exynos: rename zpos to index References: <1450268508-15028-1-git-send-email-m.szyprowski@samsung.com> <1450268508-15028-2-git-send-email-m.szyprowski@samsung.com> In-reply-to: <1450268508-15028-2-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrLIsWRmVeSWpSXmKPExsWyRsSkWHfXyuowg+4F/Ba31p1jtdg4Yz2r xZWv79ksdj7YxW7x4t5FFovXLwwtZpzfx2Sx9shddosZk1+yWbSt/sDqwOVxv/s4k8e/Y+we OyftZfLo27KK0ePzJrkA1igum5TUnMyy1CJ9uwSujL0nVjMWXDnHWLHk2UG2BsZpqxm7GDk4 JARMJHauCeli5AQyxSQu3FvP1sXIxSEksIJRYkZTGyNEwkRi9439zBCJWYwSv3/dAkvwCghK /Jh8jwVkELOAvMSRS9kQprrElCm5EOUPGCUanm5igijXkmg/sYQZxGYRUJV4vn4pO4jNBmRP XHGfDaRXVCBCovtEJUhYRKBU4lX/fUaQOcwC+5gkpp59wQpSIyxgI7H9XgjE/HZGiecXb4L1 cgp4SrTuKwGJSwi8ZJe48Ggf1C4BiW+TD7FA/CsrsekAM8RbkhIHV9xgmcAoNgvJM7MQnpmF 8MwCRuZVjKKpBckFxUnpRUZ6xYm5xaV56XrJ+bmbGIGxePrfs74djDcPWB9iFOBgVOLhlbhV FSbEmlhWXJl7iNEU6IaJzFKiyfnAiM8riTc0NjOyMDUxNTYytzRTEudNkPoZLCSQnliSmp2a WpBaFF9UmpNafIiRiYNTqoExZMXc6VtOMPZpxJVuOtelqa7QHP5l3dNDOhNPTLhR8nobA9OW zpo+bSFjsZMJO56q8/XNLLteKLN5w5Pd7G4eQb/NBEoiVM8fc/m3NPjBiffeU0PS/IsW6h4o Z/oXHtjW2Td1epN2a/uGbf52P1N8Viyy/qIXFZWkdn/FccO79VXFLrMYc2yVWIozEg21mIuK EwF6kqXqwAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNIsWRmVeSWpSXmKPExsVy+t9jQd1dK6vDDJ5MZLO4te4cq8XGGetZ La58fc9msfPBLnaLF/cusli8fmFoMeP8PiaLtUfuslvMmPySzaJt9QdWBy6P+93HmTz+HWP3 2DlpL5NH35ZVjB6fN8kFsEY1MNpkpCampBYppOYl56dk5qXbKnkHxzvHm5oZGOoaWlqYKynk Jeam2iq5+AToumXmAB2lpFCWmFMKFApILC5W0rfDNCE0xE3XAqYxQtc3JAiux8gADSSsYczY e2I1Y8GVc4wVS54dZGtgnLaasYuRk0NCwERi9439zBC2mMSFe+vZuhi5OIQEZjFK/P51C6yI V0BQ4sfkeyxdjBwczALyEkcuZUOY6hJTpuRClD9glGh4uokJolxLov3EErCZLAKqEs/XL2UH sdmA7Ikr7rOB9IoKREh0n6gECYsIlEq86r/PCDKHWWAfk8TUsy9YQWqEBWwktt8LgZjfzijx /OJNsF5OAU+J1n0lExiBbkQ4bhbCcbMQjlvAyLyKUSK1ILmgOCk91ygvtVyvODG3uDQvXS85 P3cTIzjin0nvYDy8y/0QowAHoxIPb+GdqjAh1sSy4srcQ4wSHMxKIrwcK6rDhHhTEiurUovy 44tKc1KLDzGaAn03kVlKNDkfmIzySuINjU3MjCyNzA0tjIzNlcR5912KDBMSSE8sSc1OTS1I LYLpY+LglGpgXHn/4gRl/dOHrKvzTOvCb9jNqdz/bEpYEYf198DEdSdCm3atcf9zWKS6iu19 840N3ieP8Rr3rfsmeOzwU7Yoi/mnj08oWpSwI9feYXF1vfxkk1UHektYL2k6pE4oPjohK67k 1RMP7mO83TfX/fqy+QxPpUz2itiPxeIR1XsSP09ydnPb8eZ/gBJLcUaioRZzUXEiAAyxP/UO AwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected 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=-6.9 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 Hi Marek, Seems this patch could be more cleaned up. Each ctx object of each crtc driver has its own plane config object which includes already zpos value. So I think we wouldn't need to keep zpos of the plane config and index of the plane object. How about removing index from exynos plane structure and using zpos of exynos plane config structure instead? Below patch can be applied on top of your patch, Thanks, Inki Dae 2015? 12? 16? 21:21? Marek Szyprowski ?(?) ? ?: > This patch renames zpos entry to index, because in most places it is > used as index for selecting hardware layer/window instead of > configurable layer position. This will later enable to make the zpos > property configurable. > > Signed-off-by: Marek Szyprowski > --- > drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 10 +++++----- > drivers/gpu/drm/exynos/exynos7_drm_decon.c | 10 +++++----- > drivers/gpu/drm/exynos/exynos_drm_drv.h | 4 ++-- > drivers/gpu/drm/exynos/exynos_drm_fimd.c | 10 +++++----- > drivers/gpu/drm/exynos/exynos_drm_plane.c | 4 ++-- > drivers/gpu/drm/exynos/exynos_drm_plane.h | 2 +- > drivers/gpu/drm/exynos/exynos_drm_vidi.c | 2 +- > drivers/gpu/drm/exynos/exynos_mixer.c | 14 +++++++------- > 8 files changed, 28 insertions(+), 28 deletions(-) > > diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c > index c7362b99ce28..88d022ad5280 100644 > --- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c > +++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c > @@ -256,7 +256,7 @@ static void decon_atomic_begin(struct exynos_drm_crtc *crtc, > if (test_bit(BIT_SUSPENDED, &ctx->flags)) > return; > > - decon_shadow_protect_win(ctx, plane->zpos, true); > + decon_shadow_protect_win(ctx, plane->index, true); > } > > #define BIT_VAL(x, e, s) (((x) & ((1 << ((e) - (s) + 1)) - 1)) << (s)) > @@ -270,7 +270,7 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc, > to_exynos_plane_state(plane->base.state); > struct decon_context *ctx = crtc->ctx; > struct drm_framebuffer *fb = state->base.fb; > - unsigned int win = plane->zpos; > + unsigned int win = plane->index; > unsigned int bpp = fb->bits_per_pixel >> 3; > unsigned int pitch = fb->pitches[0]; > dma_addr_t dma_addr = exynos_drm_fb_dma_addr(fb, 0); > @@ -320,7 +320,7 @@ static void decon_disable_plane(struct exynos_drm_crtc *crtc, > struct exynos_drm_plane *plane) > { > struct decon_context *ctx = crtc->ctx; > - unsigned int win = plane->zpos; > + unsigned int win = plane->index; > > if (test_bit(BIT_SUSPENDED, &ctx->flags)) > return; > @@ -344,7 +344,7 @@ static void decon_atomic_flush(struct exynos_drm_crtc *crtc, > if (test_bit(BIT_SUSPENDED, &ctx->flags)) > return; > > - decon_shadow_protect_win(ctx, plane->zpos, false); > + decon_shadow_protect_win(ctx, plane->index, false); > > if (ctx->out_type == IFTYPE_I80) > set_bit(BIT_WIN_UPDATED, &ctx->flags); > @@ -502,7 +502,7 @@ static int decon_bind(struct device *dev, struct device *master, void *data) > ctx->configs[win].zpos = win; > ctx->configs[win].type = decon_win_types[tmp]; > > - ret = exynos_plane_init(drm_dev, &ctx->planes[win], > + ret = exynos_plane_init(drm_dev, &ctx->planes[win], i, > 1 << ctx->pipe, &ctx->configs[win]); > if (ret) > return ret; > diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c > index c47f9af8170b..8911f965b06c 100644 > --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c > +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c > @@ -393,7 +393,7 @@ static void decon_atomic_begin(struct exynos_drm_crtc *crtc, > if (ctx->suspended) > return; > > - decon_shadow_protect_win(ctx, plane->zpos, true); > + decon_shadow_protect_win(ctx, plane->index, true); > } > > static void decon_update_plane(struct exynos_drm_crtc *crtc, > @@ -407,7 +407,7 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc, > unsigned long val, alpha; > unsigned int last_x; > unsigned int last_y; > - unsigned int win = plane->zpos; > + unsigned int win = plane->index; > unsigned int bpp = fb->bits_per_pixel >> 3; > unsigned int pitch = fb->pitches[0]; > > @@ -498,7 +498,7 @@ static void decon_disable_plane(struct exynos_drm_crtc *crtc, > struct exynos_drm_plane *plane) > { > struct decon_context *ctx = crtc->ctx; > - unsigned int win = plane->zpos; > + unsigned int win = plane->index; > u32 val; > > if (ctx->suspended) > @@ -525,7 +525,7 @@ static void decon_atomic_flush(struct exynos_drm_crtc *crtc, > if (ctx->suspended) > return; > > - decon_shadow_protect_win(ctx, plane->zpos, false); > + decon_shadow_protect_win(ctx, plane->index, false); > } > > static void decon_init(struct decon_context *ctx) > @@ -657,7 +657,7 @@ static int decon_bind(struct device *dev, struct device *master, void *data) > ctx->configs[i].zpos = i; > ctx->configs[i].type = decon_win_types[i]; > > - ret = exynos_plane_init(drm_dev, &ctx->planes[i], > + ret = exynos_plane_init(drm_dev, &ctx->planes[i], i, > 1 << ctx->pipe, &ctx->configs[i]); > if (ret) > return ret; > diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h > index 82bbd7f4b316..588b6763f9c7 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h > +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h > @@ -76,7 +76,7 @@ to_exynos_plane_state(struct drm_plane_state *state) > * Exynos drm common overlay structure. > * > * @base: plane object > - * @zpos: order of overlay layer(z position). > + * @index: hardware index of the overlay layer > * > * this structure is common to exynos SoC and its contents would be copied > * to hardware specific overlay info. > @@ -85,7 +85,7 @@ to_exynos_plane_state(struct drm_plane_state *state) > struct exynos_drm_plane { > struct drm_plane base; > const struct exynos_drm_plane_config *config; > - unsigned int zpos; > + unsigned int index; > struct drm_framebuffer *pending_fb; > }; > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c > index 2e2247126581..6ae1b1e55783 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c > @@ -630,7 +630,7 @@ static void fimd_atomic_begin(struct exynos_drm_crtc *crtc, > if (ctx->suspended) > return; > > - fimd_shadow_protect_win(ctx, plane->zpos, true); > + fimd_shadow_protect_win(ctx, plane->index, true); > } > > static void fimd_atomic_flush(struct exynos_drm_crtc *crtc, > @@ -641,7 +641,7 @@ static void fimd_atomic_flush(struct exynos_drm_crtc *crtc, > if (ctx->suspended) > return; > > - fimd_shadow_protect_win(ctx, plane->zpos, false); > + fimd_shadow_protect_win(ctx, plane->index, false); > } > > static void fimd_update_plane(struct exynos_drm_crtc *crtc, > @@ -654,7 +654,7 @@ static void fimd_update_plane(struct exynos_drm_crtc *crtc, > dma_addr_t dma_addr; > unsigned long val, size, offset; > unsigned int last_x, last_y, buf_offsize, line_size; > - unsigned int win = plane->zpos; > + unsigned int win = plane->index; > unsigned int bpp = fb->bits_per_pixel >> 3; > unsigned int pitch = fb->pitches[0]; > > @@ -740,7 +740,7 @@ static void fimd_disable_plane(struct exynos_drm_crtc *crtc, > struct exynos_drm_plane *plane) > { > struct fimd_context *ctx = crtc->ctx; > - unsigned int win = plane->zpos; > + unsigned int win = plane->index; > > if (ctx->suspended) > return; > @@ -944,7 +944,7 @@ static int fimd_bind(struct device *dev, struct device *master, void *data) > ctx->configs[i].num_pixel_formats = ARRAY_SIZE(fimd_formats); > ctx->configs[i].zpos = i; > ctx->configs[i].type = fimd_win_types[i]; > - ret = exynos_plane_init(drm_dev, &ctx->planes[i], > + ret = exynos_plane_init(drm_dev, &ctx->planes[i], i, > 1 << ctx->pipe, &ctx->configs[i]); > if (ret) > return ret; > diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c > index 427aeec78a28..fd6cb4cee01a 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c > @@ -280,7 +280,7 @@ static void exynos_plane_attach_zpos_property(struct drm_plane *plane, > > int exynos_plane_init(struct drm_device *dev, > struct exynos_drm_plane *exynos_plane, > - unsigned long possible_crtcs, > + unsigned int index, unsigned long possible_crtcs, > const struct exynos_drm_plane_config *config) > { > int err; > @@ -299,7 +299,7 @@ int exynos_plane_init(struct drm_device *dev, > > drm_plane_helper_add(&exynos_plane->base, &plane_helper_funcs); > > - exynos_plane->zpos = config->zpos; > + exynos_plane->index = index; > exynos_plane->config = config; > > if (config->type == DRM_PLANE_TYPE_OVERLAY) > diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.h b/drivers/gpu/drm/exynos/exynos_drm_plane.h > index 0dd096548284..9aafad164cdf 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_plane.h > +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.h > @@ -10,6 +10,6 @@ > */ > > int exynos_plane_init(struct drm_device *dev, > - struct exynos_drm_plane *exynos_plane, > + struct exynos_drm_plane *exynos_plane, unsigned int index, > unsigned long possible_crtcs, > const struct exynos_drm_plane_config *config); > diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c > index c1d33d5cbb15..adad4dc84b81 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c > @@ -461,7 +461,7 @@ static int vidi_bind(struct device *dev, struct device *master, void *data) > plane_config.zpos = i; > plane_config.type = vidi_win_types[i]; > > - ret = exynos_plane_init(drm_dev, &ctx->planes[i], > + ret = exynos_plane_init(drm_dev, &ctx->planes[i], i, > 1 << ctx->pipe, &plane_config); > if (ret) > return ret; > diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c > index dfb35e2da4db..0dceeb2b532c 100644 > --- a/drivers/gpu/drm/exynos/exynos_mixer.c > +++ b/drivers/gpu/drm/exynos/exynos_mixer.c > @@ -511,7 +511,7 @@ static void vp_video_buffer(struct mixer_context *ctx, > > mixer_cfg_scan(ctx, mode->vdisplay); > mixer_cfg_rgb_fmt(ctx, mode->vdisplay); > - mixer_cfg_layer(ctx, plane->zpos, true); > + mixer_cfg_layer(ctx, plane->index, true); > mixer_run(ctx); > > mixer_vsync_set_update(ctx, true); > @@ -537,7 +537,7 @@ static void mixer_graph_buffer(struct mixer_context *ctx, > struct mixer_resources *res = &ctx->mixer_res; > struct drm_framebuffer *fb = state->base.fb; > unsigned long flags; > - unsigned int win = plane->zpos; > + unsigned int win = plane->index; > unsigned int x_ratio = 0, y_ratio = 0; > unsigned int src_x_offset, src_y_offset, dst_x_offset, dst_y_offset; > dma_addr_t dma_addr; > @@ -956,12 +956,12 @@ static void mixer_update_plane(struct exynos_drm_crtc *crtc, > { > struct mixer_context *mixer_ctx = crtc->ctx; > > - DRM_DEBUG_KMS("win: %d\n", plane->zpos); > + DRM_DEBUG_KMS("win: %d\n", plane->index); > > if (!test_bit(MXR_BIT_POWERED, &mixer_ctx->flags)) > return; > > - if (plane->zpos > 1 && mixer_ctx->vp_enabled) > + if (plane->index > 1 && mixer_ctx->vp_enabled) > vp_video_buffer(mixer_ctx, plane); > else > mixer_graph_buffer(mixer_ctx, plane); > @@ -974,7 +974,7 @@ static void mixer_disable_plane(struct exynos_drm_crtc *crtc, > struct mixer_resources *res = &mixer_ctx->mixer_res; > unsigned long flags; > > - DRM_DEBUG_KMS("win: %d\n", plane->zpos); > + DRM_DEBUG_KMS("win: %d\n", plane->index); > > if (!test_bit(MXR_BIT_POWERED, &mixer_ctx->flags)) > return; > @@ -982,7 +982,7 @@ static void mixer_disable_plane(struct exynos_drm_crtc *crtc, > spin_lock_irqsave(&res->reg_slock, flags); > mixer_vsync_set_update(mixer_ctx, false); > > - mixer_cfg_layer(mixer_ctx, plane->zpos, false); > + mixer_cfg_layer(mixer_ctx, plane->index, false); > > mixer_vsync_set_update(mixer_ctx, true); > spin_unlock_irqrestore(&res->reg_slock, flags); > @@ -1160,7 +1160,7 @@ static int mixer_bind(struct device *dev, struct device *manager, void *data) > if (i == VP_DEFAULT_WIN && !ctx->vp_enabled) > continue; > > - ret = exynos_plane_init(drm_dev, &ctx->planes[i], > + ret = exynos_plane_init(drm_dev, &ctx->planes[i], i, > 1 << ctx->pipe, &plane_configs[i]); > if (ret) > return ret; > --- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c index 88d022a..009fa18 100644 --- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c @@ -256,7 +256,7 @@ static void decon_atomic_begin(struct exynos_drm_crtc *crtc, if (test_bit(BIT_SUSPENDED, &ctx->flags)) return; - decon_shadow_protect_win(ctx, plane->index, true); + decon_shadow_protect_win(ctx, plane->config->index, true); } #define BIT_VAL(x, e, s) (((x) & ((1 << ((e) - (s) + 1)) - 1)) << (s)) @@ -270,7 +270,7 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc, to_exynos_plane_state(plane->base.state); struct decon_context *ctx = crtc->ctx; struct drm_framebuffer *fb = state->base.fb; - unsigned int win = plane->index; + unsigned int win = plane->config->index; unsigned int bpp = fb->bits_per_pixel >> 3; unsigned int pitch = fb->pitches[0]; dma_addr_t dma_addr = exynos_drm_fb_dma_addr(fb, 0); @@ -320,7 +320,7 @@ static void decon_disable_plane(struct exynos_drm_crtc *crtc, struct exynos_drm_plane *plane) { struct decon_context *ctx = crtc->ctx; - unsigned int win = plane->index; + unsigned int win = plane->config->index; if (test_bit(BIT_SUSPENDED, &ctx->flags)) return; @@ -344,7 +344,7 @@ static void decon_atomic_flush(struct exynos_drm_crtc *crtc, if (test_bit(BIT_SUSPENDED, &ctx->flags)) return; - decon_shadow_protect_win(ctx, plane->index, false); + decon_shadow_protect_win(ctx, plane->config->index, false); if (ctx->out_type == IFTYPE_I80) set_bit(BIT_WIN_UPDATED, &ctx->flags); @@ -499,10 +499,10 @@ static int decon_bind(struct device *dev, struct device *master, void *data) ctx->configs[win].pixel_formats = decon_formats; ctx->configs[win].num_pixel_formats = ARRAY_SIZE(decon_formats); - ctx->configs[win].zpos = win; + ctx->configs[win].index = win; ctx->configs[win].type = decon_win_types[tmp]; - ret = exynos_plane_init(drm_dev, &ctx->planes[win], i, + ret = exynos_plane_init(drm_dev, &ctx->planes[win], 1 << ctx->pipe, &ctx->configs[win]); if (ret) return ret; diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c index 8911f965..6f47b60 100644 --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c @@ -393,7 +393,7 @@ static void decon_atomic_begin(struct exynos_drm_crtc *crtc, if (ctx->suspended) return; - decon_shadow_protect_win(ctx, plane->index, true); + decon_shadow_protect_win(ctx, plane->config->index, true); } static void decon_update_plane(struct exynos_drm_crtc *crtc, @@ -407,7 +407,7 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc, unsigned long val, alpha; unsigned int last_x; unsigned int last_y; - unsigned int win = plane->index; + unsigned int win = plane->config->index; unsigned int bpp = fb->bits_per_pixel >> 3; unsigned int pitch = fb->pitches[0]; @@ -498,7 +498,7 @@ static void decon_disable_plane(struct exynos_drm_crtc *crtc, struct exynos_drm_plane *plane) { struct decon_context *ctx = crtc->ctx; - unsigned int win = plane->index; + unsigned int win = plane->config->index; u32 val; if (ctx->suspended) @@ -525,7 +525,7 @@ static void decon_atomic_flush(struct exynos_drm_crtc *crtc, if (ctx->suspended) return; - decon_shadow_protect_win(ctx, plane->index, false); + decon_shadow_protect_win(ctx, plane->config->index, false); } static void decon_init(struct decon_context *ctx) @@ -654,10 +654,10 @@ static int decon_bind(struct device *dev, struct device *master, void *data) for (i = 0; i < WINDOWS_NR; i++) { ctx->configs[i].pixel_formats = decon_formats; ctx->configs[i].num_pixel_formats = ARRAY_SIZE(decon_formats); - ctx->configs[i].zpos = i; + ctx->configs[i].index = i; ctx->configs[i].type = decon_win_types[i]; - ret = exynos_plane_init(drm_dev, &ctx->planes[i], i, + ret = exynos_plane_init(drm_dev, &ctx->planes[i], 1 << ctx->pipe, &ctx->configs[i]); if (ret) return ret; diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index f0827db..c006047 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -77,7 +77,6 @@ to_exynos_plane_state(struct drm_plane_state *state) * Exynos drm common overlay structure. * * @base: plane object - * @index: hardware index of the overlay layer * * this structure is common to exynos SoC and its contents would be copied * to hardware specific overlay info. @@ -86,7 +85,6 @@ to_exynos_plane_state(struct drm_plane_state *state) struct exynos_drm_plane { struct drm_plane base; const struct exynos_drm_plane_config *config; - unsigned int index; struct drm_framebuffer *pending_fb; }; @@ -97,7 +95,7 @@ struct exynos_drm_plane { /* * Exynos DRM plane configuration structure. * - * @zpos: initial z-position of the plane. + * @index: hardware index of the overlay layer * @type: type of the plane (primary, cursor or overlay). * @pixel_formats: supported pixel formats. * @num_pixel_formats: number of elements in 'pixel_formats'. @@ -105,7 +103,7 @@ struct exynos_drm_plane { */ struct exynos_drm_plane_config { - unsigned int zpos; + unsigned int index; enum drm_plane_type type; const uint32_t *pixel_formats; unsigned int num_pixel_formats; diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 6ae1b1e..df5fbd7 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -630,7 +630,7 @@ static void fimd_atomic_begin(struct exynos_drm_crtc *crtc, if (ctx->suspended) return; - fimd_shadow_protect_win(ctx, plane->index, true); + fimd_shadow_protect_win(ctx, plane->config->index, true); } static void fimd_atomic_flush(struct exynos_drm_crtc *crtc, @@ -641,7 +641,7 @@ static void fimd_atomic_flush(struct exynos_drm_crtc *crtc, if (ctx->suspended) return; - fimd_shadow_protect_win(ctx, plane->index, false); + fimd_shadow_protect_win(ctx, plane->config->index, false); } static void fimd_update_plane(struct exynos_drm_crtc *crtc, @@ -654,7 +654,7 @@ static void fimd_update_plane(struct exynos_drm_crtc *crtc, dma_addr_t dma_addr; unsigned long val, size, offset; unsigned int last_x, last_y, buf_offsize, line_size; - unsigned int win = plane->index; + unsigned int win = plane->config->index; unsigned int bpp = fb->bits_per_pixel >> 3; unsigned int pitch = fb->pitches[0]; @@ -740,7 +740,7 @@ static void fimd_disable_plane(struct exynos_drm_crtc *crtc, struct exynos_drm_plane *plane) { struct fimd_context *ctx = crtc->ctx; - unsigned int win = plane->index; + unsigned int win = plane->config->index; if (ctx->suspended) return; @@ -942,9 +942,9 @@ static int fimd_bind(struct device *dev, struct device *master, void *data) for (i = 0; i < WINDOWS_NR; i++) { ctx->configs[i].pixel_formats = fimd_formats; ctx->configs[i].num_pixel_formats = ARRAY_SIZE(fimd_formats); - ctx->configs[i].zpos = i; + ctx->configs[i].index = i; ctx->configs[i].type = fimd_win_types[i]; - ret = exynos_plane_init(drm_dev, &ctx->planes[i], i, + ret = exynos_plane_init(drm_dev, &ctx->planes[i], 1 << ctx->pipe, &ctx->configs[i]); if (ret) return ret; diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index d862272..4d71aa5 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -137,7 +137,7 @@ static void exynos_drm_plane_reset(struct drm_plane *plane) exynos_state = kzalloc(sizeof(*exynos_state), GFP_KERNEL); if (exynos_state) { - exynos_state->zpos = exynos_plane->config->zpos; + exynos_state->zpos = exynos_plane->config->index; plane->state = &exynos_state->base; plane->state->plane = plane; } @@ -323,7 +323,7 @@ static void exynos_plane_attach_zpos_property(struct drm_plane *plane, int exynos_plane_init(struct drm_device *dev, struct exynos_drm_plane *exynos_plane, - unsigned int index, unsigned long possible_crtcs, + unsigned long possible_crtcs, const struct exynos_drm_plane_config *config) { int err; @@ -341,10 +341,9 @@ int exynos_plane_init(struct drm_device *dev, drm_plane_helper_add(&exynos_plane->base, &plane_helper_funcs); - exynos_plane->index = index; exynos_plane->config = config; - exynos_plane_attach_zpos_property(&exynos_plane->base, config->zpos); + exynos_plane_attach_zpos_property(&exynos_plane->base, config->index); return 0; } diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.h b/drivers/gpu/drm/exynos/exynos_drm_plane.h index 9aafad1..0dd0965 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.h +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.h @@ -10,6 +10,6 @@ */ int exynos_plane_init(struct drm_device *dev, - struct exynos_drm_plane *exynos_plane, unsigned int index, + struct exynos_drm_plane *exynos_plane, unsigned long possible_crtcs, const struct exynos_drm_plane_config *config); diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c index 10f02b9..6f91460 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c @@ -458,10 +458,9 @@ static int vidi_bind(struct device *dev, struct device *master, void *data) plane_config.num_pixel_formats = ARRAY_SIZE(formats); for (i = 0; i < WINDOWS_NR; i++) { - plane_config.zpos = i; plane_config.type = vidi_win_types[i]; - ret = exynos_plane_init(drm_dev, &ctx->planes[i], i, + ret = exynos_plane_init(drm_dev, &ctx->planes[i], 1 << ctx->pipe, &plane_config); if (ret) return ret; diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index bf148dc..6bedda7 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -115,21 +115,21 @@ struct mixer_drv_data { static const struct exynos_drm_plane_config plane_configs[MIXER_WIN_NR] = { { - .zpos = 0, + .index = 0, .type = DRM_PLANE_TYPE_PRIMARY, .pixel_formats = mixer_formats, .num_pixel_formats = ARRAY_SIZE(mixer_formats), .capabilities = EXYNOS_DRM_PLANE_CAP_DOUBLE | EXYNOS_DRM_PLANE_CAP_ZPOS, }, { - .zpos = 1, + .index = 1, .type = DRM_PLANE_TYPE_CURSOR, .pixel_formats = mixer_formats, .num_pixel_formats = ARRAY_SIZE(mixer_formats), .capabilities = EXYNOS_DRM_PLANE_CAP_DOUBLE | EXYNOS_DRM_PLANE_CAP_ZPOS, }, { - .zpos = 2, + .index = 2, .type = DRM_PLANE_TYPE_OVERLAY, .pixel_formats = vp_formats, .num_pixel_formats = ARRAY_SIZE(vp_formats), @@ -563,7 +563,7 @@ static void vp_video_buffer(struct mixer_context *ctx, mixer_cfg_scan(ctx, mode->vdisplay); mixer_cfg_rgb_fmt(ctx, mode->vdisplay); - mixer_cfg_layer(ctx, plane->index, state->zpos + 1, true); + mixer_cfg_layer(ctx, plane->config->index, state->zpos + 1, true); mixer_cfg_vp_blend(ctx); mixer_run(ctx); @@ -590,7 +590,7 @@ static void mixer_graph_buffer(struct mixer_context *ctx, struct mixer_resources *res = &ctx->mixer_res; struct drm_framebuffer *fb = state->base.fb; unsigned long flags; - unsigned int win = plane->index; + unsigned int win = plane->config->index; unsigned int x_ratio = 0, y_ratio = 0; unsigned int src_x_offset, src_y_offset, dst_x_offset, dst_y_offset; dma_addr_t dma_addr; @@ -985,12 +985,12 @@ static void mixer_update_plane(struct exynos_drm_crtc *crtc, { struct mixer_context *mixer_ctx = crtc->ctx; - DRM_DEBUG_KMS("win: %d\n", plane->index); + DRM_DEBUG_KMS("win: %d\n", plane->config->index); if (!test_bit(MXR_BIT_POWERED, &mixer_ctx->flags)) return; - if (plane->index == VP_DEFAULT_WIN) + if (plane->config->index == VP_DEFAULT_WIN) vp_video_buffer(mixer_ctx, plane); else mixer_graph_buffer(mixer_ctx, plane); @@ -1003,7 +1003,7 @@ static void mixer_disable_plane(struct exynos_drm_crtc *crtc, struct mixer_resources *res = &mixer_ctx->mixer_res; unsigned long flags; - DRM_DEBUG_KMS("win: %d\n", plane->index); + DRM_DEBUG_KMS("win: %d\n", plane->config->index); if (!test_bit(MXR_BIT_POWERED, &mixer_ctx->flags)) return; @@ -1011,7 +1011,7 @@ static void mixer_disable_plane(struct exynos_drm_crtc *crtc, spin_lock_irqsave(&res->reg_slock, flags); mixer_vsync_set_update(mixer_ctx, false); - mixer_cfg_layer(mixer_ctx, plane->index, 0, false); + mixer_cfg_layer(mixer_ctx, plane->config->index, 0, false); mixer_vsync_set_update(mixer_ctx, true); spin_unlock_irqrestore(&res->reg_slock, flags); @@ -1189,7 +1189,7 @@ static int mixer_bind(struct device *dev, struct device *manager, void *data) if (i == VP_DEFAULT_WIN && !ctx->vp_enabled) continue; - ret = exynos_plane_init(drm_dev, &ctx->planes[i], i, + ret = exynos_plane_init(drm_dev, &ctx->planes[i], 1 << ctx->pipe, &plane_configs[i]); if (ret) return ret;