From patchwork Tue Jan 9 10:56:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 123872 Delivered-To: patch@linaro.org Received: by 10.80.140.226 with SMTP id r31csp305647edr; Tue, 9 Jan 2018 02:57:11 -0800 (PST) X-Google-Smtp-Source: ACJfBosCdJTsoMRwv+VK1Uji8skNwFsdvFdJZWH97tGJMDSsO0SqievuVO1pihK6+Jattzb+UzJu X-Received: by 10.159.245.150 with SMTP id a22mr6242591pls.60.1515495431821; Tue, 09 Jan 2018 02:57:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515495431; cv=none; d=google.com; s=arc-20160816; b=SuOXmIUYlPU6ODayQPz9Q1hrHTeEetBLb1bGtUWwyEexpVzM0C64tXSwYtRBeGUBA+ dPr7xpv83JJESlmOWCC2TYVXexsIvO5TlVzS8pFAwhBXvsISf0YeNTNqe8CVCBIPTcLE 22MI0HBTxuGHA18iACi71j3nY6SYvsidUPsy0zPWaOOK+5wxvbzopY5f8G9cTmZ+1r4a C+3m4RuegV35rOejFuEg9USwXNaFvMPcjJ/plLyysfyyVvp+KRhmhLtw4biZkMzTCcFr T6ErWXXHwLR8pt16gEuWnwgjQx5HQIS1VX++hStSQwbvu461JCjrf7u5b9Why48guzGj aM+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=DP/Cji8/q3F3bw1wBDY2ut03Ca9gQGho9+OO5yEa8Gs=; b=gws8+BRKy+ntHUQP1cVjtnf2gj5Bs0n7/DHsfIgekbXFIlRGTvMHESB1MAVmSWdSVk 0TX9yUKT+ivAPOifW1sH4b0cRwlZjUy8dI7nExkxUGoGDumHUbygkBxBgo3Q/FNLIUwH sp7dcOf861XHtARrkSHv4xyZhOpJtcvfHk8jHYXF4HU2Xaq4LcGhDHKGysB8p0VNZu4V 1uxL2B+Uzq7VJWF7u+cuAwqHH3d4equi4mOQIJXHZCHqGw8PLCL5ZvvnHWbKdLJ5oikM uhdYd9p8ZvKphwZJ9RGmVLbdOwpLmbN381+loOvjs3BfKvwH2+eFWZy2vC47Oa/3fcQO P5CQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v17si4426184pgn.551.2018.01.09.02.57.11; Tue, 09 Jan 2018 02:57:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932221AbeAIK5G (ORCPT + 28 others); Tue, 9 Jan 2018 05:57:06 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:50924 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754162AbeAIK5D (ORCPT ); Tue, 9 Jan 2018 05:57:03 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id 375AD2066A; Tue, 9 Jan 2018 11:57:01 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id BCD0B2074A; Tue, 9 Jan 2018 11:56:42 +0100 (CET) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard , Daniel Vetter , Jani Nikula , Sean Paul Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thomas Petazzoni , thomas@vitsch.nl, Boris Brezillon Subject: [PATCH 02/19] drm/atmel-hlcdc: Use the alpha format helper Date: Tue, 9 Jan 2018 11:56:21 +0100 Message-Id: <22c5a25fbdd56193ece1de90dc17cfa8747e7136.1515494838.git-series.maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that the core has a drm format helper to tell if a format embeds an alpha component in it, let's use it. Cc: Boris Brezillon Signed-off-by: Maxime Ripard --- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 20 ++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) -- git-series 0.9.1 Acked-by: Boris Brezillon diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c index 703c2d13603f..1a9318810a29 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c @@ -194,20 +194,6 @@ static int atmel_hlcdc_format_to_plane_mode(u32 format, u32 *mode) return 0; } -static bool atmel_hlcdc_format_embeds_alpha(u32 format) -{ - int i; - - for (i = 0; i < sizeof(format); i++) { - char tmp = (format >> (8 * i)) & 0xff; - - if (tmp == 'A') - return true; - } - - return false; -} - static u32 heo_downscaling_xcoef[] = { 0x11343311, 0x000000f7, @@ -395,7 +381,7 @@ atmel_hlcdc_plane_update_general_settings(struct atmel_hlcdc_plane *plane, cfg |= ATMEL_HLCDC_LAYER_OVR | ATMEL_HLCDC_LAYER_ITER2BL | ATMEL_HLCDC_LAYER_ITER; - if (atmel_hlcdc_format_embeds_alpha(format)) + if (drm_format_has_alpha(format)) cfg |= ATMEL_HLCDC_LAYER_LAEN; else cfg |= ATMEL_HLCDC_LAYER_GAEN | @@ -566,7 +552,7 @@ atmel_hlcdc_plane_prepare_disc_area(struct drm_crtc_state *c_state) ovl_state = drm_plane_state_to_atmel_hlcdc_plane_state(ovl_s); if (!ovl_s->fb || - atmel_hlcdc_format_embeds_alpha(ovl_s->fb->format->format) || + drm_format_has_alpha(ovl_s->fb->format->format) || ovl_state->alpha != 255) continue; @@ -769,7 +755,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, if ((state->crtc_h != state->src_h || state->crtc_w != state->src_w) && (!desc->layout.memsize || - atmel_hlcdc_format_embeds_alpha(state->base.fb->format->format))) + drm_format_has_alpha(state->base.fb->format->format))) return -EINVAL; if (state->crtc_x < 0 || state->crtc_y < 0) From patchwork Tue Jan 9 10:56:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 123875 Delivered-To: patch@linaro.org Received: by 10.80.140.226 with SMTP id r31csp305763edr; Tue, 9 Jan 2018 02:57:20 -0800 (PST) X-Google-Smtp-Source: ACJfBovMpXDAZHkzfHMZTeAHdEo6CXsrSV+K1tSM9JWvbWh/O8InHt1eLdM7Andcj/wVWrHHkEvN X-Received: by 10.99.189.81 with SMTP id d17mr12100669pgp.370.1515495440209; Tue, 09 Jan 2018 02:57:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515495440; cv=none; d=google.com; s=arc-20160816; b=T+KxOQ6rdNV+SEBIw1Rbn9TfjJ96ttc2ZO+ClWlXF4LMTcjwzro+JN5qR+Ume6jJzu 0o/QJutNSn683AmkImytVDrwXFxwyxirOncJaAPOAyAsbemFaheJ+fe/Va3EM+EzSjAU e9ZssNkllqHXGQaejuD8SMWtrJXsoEO6wk6E0PUtz6szK8k0QHZ4mw9slswjmuM8TT++ RQdCxupvwuJc0o5RFgrKY+qHAWQfsf/lr4BIrJfTQEAhSC754CsSPdDixUbB1MiBzP5E 0DrTLgH0kXGv1Cey4H+EPswoflmIFF42k/NYqyn+HGn4l59RDKFbM9PN/zehHrwxCNtn Bwtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=bSlb7ek6T9sa8FFqztnDf6QT4HIqpAVuEHcHBOoIPdg=; b=ZIc2RTp5lBe8MrAOqvNTPh59/faiH8yfffCqoNtXglwieF3w05wbHsezTuOLPuAfmY i/czXocmkyIGQbW3PpqsEZ22kgdlQeDfuXEsBXnF1mFrcbAOBgKX/PXV+S+QBgWUJ6L6 p6kmmlJ5Zvojc/xjSsZYRy/dk8xF1LlBtKAlkxsSReXcg/pFUnZ6/pHQkQ4akiSX7Pzz 90oEkWs6ww5bINdQkaNbqkvuGciMp/cfJVsO5Cbu4Pf6iPTOgkTl5rPKmx5aT+E3+LBS QbT4kx5IZIilt9D7x7AmREifPI+ZLbCoOoPt9nSaEQC1ilHGz4gq/YosM1gjvr2r/A1/ r7+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g7si8914643pgf.712.2018.01.09.02.57.19; Tue, 09 Jan 2018 02:57:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932297AbeAIK5Q (ORCPT + 28 others); Tue, 9 Jan 2018 05:57:16 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:50993 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932201AbeAIK5G (ORCPT ); Tue, 9 Jan 2018 05:57:06 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id 3A81C207D8; Tue, 9 Jan 2018 11:57:02 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 170B120849; Tue, 9 Jan 2018 11:56:45 +0100 (CET) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard , Daniel Vetter , Jani Nikula , Sean Paul Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thomas Petazzoni , thomas@vitsch.nl, Laurent Pinchart Subject: [PATCH 08/19] drm/rcar-du: Convert to the new generic alpha property Date: Tue, 9 Jan 2018 11:56:27 +0100 Message-Id: X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that we have support for per-plane alpha in the core, let's use it. Cc: Laurent Pinchart Signed-off-by: Maxime Ripard --- drivers/gpu/drm/rcar-du/rcar_du_drv.h | 1 +- drivers/gpu/drm/rcar-du/rcar_du_kms.c | 5 +--- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 15 +++------ drivers/gpu/drm/rcar-du/rcar_du_plane.h | 2 +- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 42 ++------------------------ drivers/gpu/drm/rcar-du/rcar_du_vsp.h | 2 +- 6 files changed, 9 insertions(+), 58 deletions(-) -- git-series 0.9.1 diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.h b/drivers/gpu/drm/rcar-du/rcar_du_drv.h index f8cd79488ece..aff04adaae53 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.h +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.h @@ -89,7 +89,6 @@ struct rcar_du_device { struct rcar_du_vsp vsps[RCAR_DU_MAX_VSPS]; struct { - struct drm_property *alpha; struct drm_property *colorkey; } props; diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c index 566d1a948c8f..e1b5a7b460cc 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c @@ -417,11 +417,6 @@ static int rcar_du_encoders_init(struct rcar_du_device *rcdu) static int rcar_du_properties_init(struct rcar_du_device *rcdu) { - rcdu->props.alpha = - drm_property_create_range(rcdu->ddev, 0, "alpha", 0, 255); - if (rcdu->props.alpha == NULL) - return -ENOMEM; - /* * The color key is expressed as an RGB888 triplet stored in a 32-bit * integer in XRGB8888 format. Bit 24 is used as a flag to disable (0) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/rcar-du/rcar_du_plane.c index 61833cc1c699..5b34e8092c8b 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c @@ -423,7 +423,7 @@ static void rcar_du_plane_setup_mode(struct rcar_du_group *rgrp, rcar_du_plane_write(rgrp, index, PnALPHAR, PnALPHAR_ABIT_0); else rcar_du_plane_write(rgrp, index, PnALPHAR, - PnALPHAR_ABIT_X | state->alpha); + PnALPHAR_ABIT_X | state->state.alpha); pnmr = PnMR_BM_MD | state->format->pnmr; @@ -667,11 +667,11 @@ static void rcar_du_plane_reset(struct drm_plane *plane) state->hwindex = -1; state->source = RCAR_DU_PLANE_MEMORY; - state->alpha = 255; state->colorkey = RCAR_DU_COLORKEY_NONE; state->state.zpos = plane->type == DRM_PLANE_TYPE_PRIMARY ? 0 : 1; plane->state = &state->state; + plane->state->alpha = 255; plane->state->plane = plane; } @@ -683,9 +683,7 @@ static int rcar_du_plane_atomic_set_property(struct drm_plane *plane, struct rcar_du_plane_state *rstate = to_rcar_plane_state(state); struct rcar_du_device *rcdu = to_rcar_plane(plane)->group->dev; - if (property == rcdu->props.alpha) - rstate->alpha = val; - else if (property == rcdu->props.colorkey) + if (property == rcdu->props.colorkey) rstate->colorkey = val; else return -EINVAL; @@ -701,9 +699,7 @@ static int rcar_du_plane_atomic_get_property(struct drm_plane *plane, container_of(state, const struct rcar_du_plane_state, state); struct rcar_du_device *rcdu = to_rcar_plane(plane)->group->dev; - if (property == rcdu->props.alpha) - *val = rstate->alpha; - else if (property == rcdu->props.colorkey) + if (property == rcdu->props.colorkey) *val = rstate->colorkey; else return -EINVAL; @@ -772,10 +768,9 @@ int rcar_du_planes_init(struct rcar_du_group *rgrp) continue; drm_object_attach_property(&plane->plane.base, - rcdu->props.alpha, 255); - drm_object_attach_property(&plane->plane.base, rcdu->props.colorkey, RCAR_DU_COLORKEY_NONE); + drm_plane_create_alpha_property(&plane->plane, 255); drm_plane_create_zpos_property(&plane->plane, 1, 1, 7); } diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.h b/drivers/gpu/drm/rcar-du/rcar_du_plane.h index f62e09f195de..2dc793ebd1a2 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_plane.h +++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.h @@ -50,7 +50,6 @@ static inline struct rcar_du_plane *to_rcar_plane(struct drm_plane *plane) * @state: base DRM plane state * @format: information about the pixel format used by the plane * @hwindex: 0-based hardware plane index, -1 means unused - * @alpha: value of the plane alpha property * @colorkey: value of the plane colorkey property */ struct rcar_du_plane_state { @@ -60,7 +59,6 @@ struct rcar_du_plane_state { int hwindex; enum rcar_du_plane_source source; - unsigned int alpha; unsigned int colorkey; }; diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c index 2c96147bc444..ee85f6fdffad 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c @@ -54,6 +54,7 @@ void rcar_du_vsp_enable(struct rcar_du_crtc *crtc) }; struct rcar_du_plane_state state = { .state = { + .alpha = 255, .crtc = &crtc->crtc, .crtc_x = 0, .crtc_y = 0, @@ -67,7 +68,6 @@ void rcar_du_vsp_enable(struct rcar_du_crtc *crtc) }, .format = rcar_du_format_info(DRM_FORMAT_ARGB8888), .source = RCAR_DU_PLANE_VSPD1, - .alpha = 255, .colorkey = 0, }; @@ -173,7 +173,7 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane) struct vsp1_du_atomic_config cfg = { .pixelformat = 0, .pitch = fb->pitches[0], - .alpha = state->alpha, + .alpha = state->state.alpha, .zpos = state->state.zpos, }; unsigned int i; @@ -351,44 +351,13 @@ static void rcar_du_vsp_plane_reset(struct drm_plane *plane) if (state == NULL) return; - state->alpha = 255; + state->state.alpha = 255; state->state.zpos = plane->type == DRM_PLANE_TYPE_PRIMARY ? 0 : 1; plane->state = &state->state; plane->state->plane = plane; } -static int rcar_du_vsp_plane_atomic_set_property(struct drm_plane *plane, - struct drm_plane_state *state, struct drm_property *property, - uint64_t val) -{ - struct rcar_du_vsp_plane_state *rstate = to_rcar_vsp_plane_state(state); - struct rcar_du_device *rcdu = to_rcar_vsp_plane(plane)->vsp->dev; - - if (property == rcdu->props.alpha) - rstate->alpha = val; - else - return -EINVAL; - - return 0; -} - -static int rcar_du_vsp_plane_atomic_get_property(struct drm_plane *plane, - const struct drm_plane_state *state, struct drm_property *property, - uint64_t *val) -{ - const struct rcar_du_vsp_plane_state *rstate = - container_of(state, const struct rcar_du_vsp_plane_state, state); - struct rcar_du_device *rcdu = to_rcar_vsp_plane(plane)->vsp->dev; - - if (property == rcdu->props.alpha) - *val = rstate->alpha; - else - return -EINVAL; - - return 0; -} - static const struct drm_plane_funcs rcar_du_vsp_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, @@ -396,8 +365,6 @@ static const struct drm_plane_funcs rcar_du_vsp_plane_funcs = { .destroy = drm_plane_cleanup, .atomic_duplicate_state = rcar_du_vsp_plane_atomic_duplicate_state, .atomic_destroy_state = rcar_du_vsp_plane_atomic_destroy_state, - .atomic_set_property = rcar_du_vsp_plane_atomic_set_property, - .atomic_get_property = rcar_du_vsp_plane_atomic_get_property, }; int rcar_du_vsp_init(struct rcar_du_vsp *vsp, struct device_node *np, @@ -454,8 +421,7 @@ int rcar_du_vsp_init(struct rcar_du_vsp *vsp, struct device_node *np, if (type == DRM_PLANE_TYPE_PRIMARY) continue; - drm_object_attach_property(&plane->plane.base, - rcdu->props.alpha, 255); + drm_plane_create_alpha_property(&plane->plane, 255); drm_plane_create_zpos_property(&plane->plane, 1, 1, vsp->num_planes - 1); } diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.h b/drivers/gpu/drm/rcar-du/rcar_du_vsp.h index f876c512163c..8b19914761e4 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.h +++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.h @@ -44,7 +44,6 @@ static inline struct rcar_du_vsp_plane *to_rcar_vsp_plane(struct drm_plane *p) * @state: base DRM plane state * @format: information about the pixel format used by the plane * @sg_tables: scatter-gather tables for the frame buffer memory - * @alpha: value of the plane alpha property * @zpos: value of the plane zpos property */ struct rcar_du_vsp_plane_state { @@ -53,7 +52,6 @@ struct rcar_du_vsp_plane_state { const struct rcar_du_format_info *format; struct sg_table sg_tables[3]; - unsigned int alpha; unsigned int zpos; }; From patchwork Tue Jan 9 10:56:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 123874 Delivered-To: patch@linaro.org Received: by 10.80.140.226 with SMTP id r31csp305724edr; Tue, 9 Jan 2018 02:57:17 -0800 (PST) X-Google-Smtp-Source: ACJfBouZ4FdbnVXsBTJZF4LZyGV4LbwAs1DG9Cs84eEWMLLQj0StQuX8xwqSl0fOjLvBs/5HHGhR X-Received: by 10.159.241.19 with SMTP id q19mr15507134plr.160.1515495437004; Tue, 09 Jan 2018 02:57:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515495436; cv=none; d=google.com; s=arc-20160816; b=R8VSQ3ltGW2GvnYx3AbOdB/UoQSNddySRohXnFBp09O42/RcEQtSVQCSYzd/DMHxic VyU8HSD6nGVxY3r+65h3zqC6mc3y4KN0myeZhsie4utpNCGRUMgjAdNZUqkNI3e5TeXB AGBgb8rpiTSit8hzQsVJGvfMxd4jZvwPIgs8rHWxGDbLf4G+ivCuymBB7LUstW4z1hVY 3rG6T7Sq3i0rhgmvBcZ7p1tqwW6nMe06H8xU+VDqstzvHJl0Sz4zdSLYzgAYrijbhD6h XOxWnqb7pGvQIGli15wlsrbG701b4xb8OiVMbcO752kcMAU2D7ZS7fsUXFYofMUHGxrK Q5bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=jFTdDzsM61Ay1qkD4N55bH4FyX636waYOpR0HZPfIag=; b=rdf8UsCtXDEr5AWf/3cy5lT1835fVuB1gOfcBmz0u8XSpbgehTXvsj6PzIIYEsxLNp M88WOCmWsN/SamYb1S42MJ5sU/g+BPt9p86bMEwQMkZrcWdNHvRmsNJHaH7q6dK823YH pul5J/v8yQsIRkKyX+DlybCyQAB/KREUFm36wTIrlNvDOaxKZRRrtzXCnuCtgQq8dKY+ FogP4LaHFkDBCmtm0BUrqEFT613s2D7NNx0xokBX9rqgUBIS6iKKlWJPQ41OBzpaSY2s 7j66nL+qq/hQm3FFJ+LzpdPoGqnl0kVt1MwwzjaKVb7lUWZ+1eVGJaCndfDzdXRPOITZ qM0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p2si8819922pgu.812.2018.01.09.02.57.16; Tue, 09 Jan 2018 02:57:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932272AbeAIK5O (ORCPT + 28 others); Tue, 9 Jan 2018 05:57:14 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:50994 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932202AbeAIK5G (ORCPT ); Tue, 9 Jan 2018 05:57:06 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id B49B72081A; Tue, 9 Jan 2018 11:57:03 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 7933620931; Tue, 9 Jan 2018 11:56:45 +0100 (CET) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard , Daniel Vetter , Jani Nikula , Sean Paul Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thomas Petazzoni , thomas@vitsch.nl Subject: [PATCH 09/19] drm/sun4i: backend: Fix structure indentation Date: Tue, 9 Jan 2018 11:56:28 +0100 Message-Id: <70ef1982341be561bf81479efe0090c7276891fa.1515494838.git-series.maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The sun4i_plane_desc structure was somehow indented to two tabulations instead of one as we shoud do. Fix that. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun4i_layer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- git-series 0.9.1 diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c index 4652b25be0d2..f03da16eb92a 100644 --- a/drivers/gpu/drm/sun4i/sun4i_layer.c +++ b/drivers/gpu/drm/sun4i/sun4i_layer.c @@ -20,10 +20,10 @@ #include "sunxi_engine.h" struct sun4i_plane_desc { - enum drm_plane_type type; - u8 pipe; - const uint32_t *formats; - uint32_t nformats; + enum drm_plane_type type; + u8 pipe; + const uint32_t *formats; + uint32_t nformats; }; static void sun4i_backend_layer_reset(struct drm_plane *plane) From patchwork Tue Jan 9 10:56:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 123869 Delivered-To: patch@linaro.org Received: by 10.80.140.226 with SMTP id r31csp305499edr; Tue, 9 Jan 2018 02:57:01 -0800 (PST) X-Google-Smtp-Source: ACJfBotH6aiGg2u/EtH5/Jxqt5CKbPdpI7uGYqzwCo7kg9iNSUXE6SwA2vP4+FvbEvonea/JCYFy X-Received: by 10.98.11.130 with SMTP id 2mr6787039pfl.190.1515495421145; Tue, 09 Jan 2018 02:57:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515495421; cv=none; d=google.com; s=arc-20160816; b=XtwcB5S9SHswzloD3YRfaPh66dt2ehAF+HWpzM1AMFL9Ir1IIlTiq5aQHtmU3GrFEU +/uMRouXMIr8Roa+4mEr0uzv47W4mfermGp4vNDi6/QUDZU8m55YJy/Oie9XntEEqx6k qvUTX8xwH9UDzhCzKfy4p5zEoKP+dEok42dFxRagDaquAhzTVfD028pTo9UmC1f46Zxb zlLtnYznqy5aPnxlrCbD9yTg+vhBDczjMmRzmhUtIdnN3NUxwM1KUb9JCQZFIvuhUvnN FDYY6p4dF3NLFrBaEKrqHvwGckYp0IbXwtBTGyzoo6izb2dEsku1zZbjeE+scWDjjzJY BsQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=eJ2yt85OclTIAUExgZwTRTosvgTYRmatAqg7L7zldDY=; b=uDMcVp5MHgfA9DzO0VFEszQsRRBFpKkzipLqf13HnClfraaZhdaKKfb3zJrwDu/DIU 4uL6x06Y2/L9fFFJJD24VzwqduuomHxmju6qoD+irChs1uxh5J6xGOZjZsytCyS4qazu yOFNYqAaIKBJiZKwqh5rZXG9wSyoB/v6bJRNbHX7OAWy7Ppk8vSOkNoExuW0FwooVvgp TkKwwl52SvusfIGqUQrCbPhSgMSkPRUoNp5irN223YfuyopqWuW4EBpQUafpYf+D6UX4 RQcvXvTsBJEvuW82O4kXcMr+6zIhXogFz85rtckq02VmoFV4t2RpWJ89Q2U/vgKjOfeI /fSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q13si1206480pgp.262.2018.01.09.02.57.00; Tue, 09 Jan 2018 02:57:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932139AbeAIK47 (ORCPT + 28 others); Tue, 9 Jan 2018 05:56:59 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:50862 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754118AbeAIK4x (ORCPT ); Tue, 9 Jan 2018 05:56:53 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id D52AE2099A; Tue, 9 Jan 2018 11:56:51 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 8F2B1203B4; Tue, 9 Jan 2018 11:56:41 +0100 (CET) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard , Daniel Vetter , Jani Nikula , Sean Paul Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thomas Petazzoni , thomas@vitsch.nl Subject: [PATCH 11/19] drm/sun4i: framebuffer: Add a custom atomic_check Date: Tue, 9 Jan 2018 11:56:30 +0100 Message-Id: <74cd1157b24d511b8e81a256c9b029d64558d61d.1515494838.git-series.maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In order to support normalized zpos, we need to call drm_atomic_normalize_zpos in our driver's drm_mode_config_funcs' atomic_check. Let's duplicate the definition of drm_atomic_helper_check for now. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun4i_framebuffer.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) -- git-series 0.9.1 diff --git a/drivers/gpu/drm/sun4i/sun4i_framebuffer.c b/drivers/gpu/drm/sun4i/sun4i_framebuffer.c index a01a5b7d46e6..e68004844abe 100644 --- a/drivers/gpu/drm/sun4i/sun4i_framebuffer.c +++ b/drivers/gpu/drm/sun4i/sun4i_framebuffer.c @@ -26,9 +26,21 @@ static void sun4i_de_output_poll_changed(struct drm_device *drm) drm_fbdev_cma_hotplug_event(drv->fbdev); } +static int sun4i_de_atomic_check(struct drm_device *dev, + struct drm_atomic_state *state) +{ + int ret; + + ret = drm_atomic_helper_check_modeset(dev, state); + if (ret) + return ret; + + return drm_atomic_helper_check_planes(dev, state); +} + static const struct drm_mode_config_funcs sun4i_de_mode_config_funcs = { .output_poll_changed = sun4i_de_output_poll_changed, - .atomic_check = drm_atomic_helper_check, + .atomic_check = sun4i_de_atomic_check, .atomic_commit = drm_atomic_helper_commit, .fb_create = drm_gem_fb_create, }; From patchwork Tue Jan 9 10:56:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 123870 Delivered-To: patch@linaro.org Received: by 10.80.140.226 with SMTP id r31csp305536edr; Tue, 9 Jan 2018 02:57:04 -0800 (PST) X-Google-Smtp-Source: ACJfBotLs+teYhU2LtS77e6xue6bfYHfZnLScs5reqH8ynwZnymLeo1Qu8rzfTX4l//wFOSuJIUU X-Received: by 10.84.160.236 with SMTP id v41mr15196970plg.40.1515495424365; Tue, 09 Jan 2018 02:57:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515495424; cv=none; d=google.com; s=arc-20160816; b=L1M7eJU7A3W5rt00tVHdJy3gky7kGCRmPKX/uN6RHbVyWxVmlpzlX+zFJpTtM8gbMl 9HV6KUTt4inKi6YVtf5CpCptFMsNNzdb1Xch67M31fRJnoudpy5YAKV/VquIBMCk9Z4P YVQl3BcJliBzYtD4J+4zO0k7YZZ2C8wLtTteydUNkSFaB4x9/aDtSUIHKANboXBgGAkV 1MsfE7L1IbMODPciltjfWTB0X1zyyeaS7qYrQQlnA6W43rHq7sk9bg7fnTirGAXsT+Uu D5CFmr56LL/mVKCo2s1rfCROPU1zCsSRBp7++KH8cE2Fzdsi9uAuuiYiYTr5tq4nZbHc JMEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=gQUdQ+gr8TwzHoRwuT45m3zqHz/4QX+3rAa77ofAboY=; b=VPdoQIn9UtjtSnP4+Z889erd8PATeoxP6WLmts0la4cQsYYysGoc9GE8kbHtG3n0/y NmcN1uTKg40xOGoIDRN92rq+WE2ZezZmrfqXPV8RtQBUcs5+3p/pcm0s/mTByY6DWPZ3 cbqfRg06Fwojf16UyizjYokiCsdo0mfMcqbt8ZUhrE4HaEHRo+sa71IFBwyF0FGa9oUE RU60eLqvOn0Zic57YOwxFNPtlGWpmXCW67nzwR+t1fLrOvszszvlXnGBSkwVamc4MSRC +hlL0w5JVRIYHbIv+Qk05K6ML7R4tHBMFandYPg/UkLZ4V604GKUheByve1qyk+0QRVy MEcA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q13si1206480pgp.262.2018.01.09.02.57.04; Tue, 09 Jan 2018 02:57:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932179AbeAIK5A (ORCPT + 28 others); Tue, 9 Jan 2018 05:57:00 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:50872 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754162AbeAIK4y (ORCPT ); Tue, 9 Jan 2018 05:56:54 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id 1BC38203B4; Tue, 9 Jan 2018 11:56:52 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id ECA8B20377; Tue, 9 Jan 2018 11:56:41 +0100 (CET) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard , Daniel Vetter , Jani Nikula , Sean Paul Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thomas Petazzoni , thomas@vitsch.nl Subject: [PATCH 12/19] drm/sun4i: backend: Move the coord function in the shared part Date: Tue, 9 Jan 2018 11:56:31 +0100 Message-Id: X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The function supposed to update a plane's coordinates is called in both branches of our function. Let's move it out the if statement. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun4i_layer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- git-series 0.9.1 diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c index f03da16eb92a..c448cb6b9fa9 100644 --- a/drivers/gpu/drm/sun4i/sun4i_layer.c +++ b/drivers/gpu/drm/sun4i/sun4i_layer.c @@ -106,14 +106,13 @@ static void sun4i_backend_layer_atomic_update(struct drm_plane *plane, DRM_FORMAT_ARGB8888); sun4i_backend_update_layer_frontend(backend, layer->id, DRM_FORMAT_ARGB8888); - sun4i_backend_update_layer_coord(backend, layer->id, plane); sun4i_frontend_enable(frontend); } else { - sun4i_backend_update_layer_coord(backend, layer->id, plane); sun4i_backend_update_layer_formats(backend, layer->id, plane); sun4i_backend_update_layer_buffer(backend, layer->id, plane); } + sun4i_backend_update_layer_coord(backend, layer->id, plane); sun4i_backend_layer_enable(backend, layer->id, true); } From patchwork Tue Jan 9 10:56:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 123886 Delivered-To: patch@linaro.org Received: by 10.80.140.226 with SMTP id r31csp306650edr; Tue, 9 Jan 2018 02:58:30 -0800 (PST) X-Google-Smtp-Source: ACJfBotJVBVlr8dFKk68laCIFGK0qDH50a+k3L8HGPnPnjD1e1h5rUjZtfvN0wHTfeP0BBwH02aO X-Received: by 10.84.137.169 with SMTP id 38mr15549806pln.246.1515495510474; Tue, 09 Jan 2018 02:58:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515495510; cv=none; d=google.com; s=arc-20160816; b=tSTYV9gL4AIgtHUMZ1iVSH+oJtCRbG7vYDYJMcZ0XuqKC8m10cymdkOZ/+rwh51g2C Twp1tS5u5JZ0iU4c5X5Sa0/nJFNKwJqW/8+hZMLENg8danbHzylhrdBB5aEOZDKWVits hrpcYVcHt3PfhwWW4Tze2D27AoWsUPmjV393iP2bdwyqKZ7eGNy/2lJSkDoiDscOhz0F tVmsyBnhinY+AZkTLNQwBdfT1cDwmxnKp4+177uy6X6RMHokKRmnIo8mVRlb/cjY82uC bOLJoZrnuzTJc76bLRSX/1KxTmow5c64n2P/DSCNJKEa7n81AJi8TjCJGo/kBY0ERwrS 8KkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=6xuHv+GcnuQqacuYD6mrfyt0JkRDejmUwWJXtOGqvJs=; b=rLhLiCVJs+voUxlA6OcsCvVXVLedCy+TryUoT4XBdqbfsomAUIXNtOiiPpLNK/lnN8 BdCxB6e2orGBlauJv1AvMlYfJXgiD+9lWhCGn4x9+jVDWN62amp4Pqe4sdB8CxYnS/u/ LpytV4UePphMy6b9kdeY5/4aChkmCMOGs1Zmc4P9mg9KLGU8DrY3VbDwrVZt60Gjhxab PvyP+5pWFH3BAzntuVtzHb3JZFXBzYp7WUzgLXHsClTsMJQ61+PD3E2qa3jFxqs0vk9U HZyeGmpu/xNgpOLONw/nB6BOKBJ94yrMKJKEfIwGp8fnjDwhu62fL14jphSyy5Osj6Nj cJ1w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e126si9891592pfc.292.2018.01.09.02.58.30; Tue, 09 Jan 2018 02:58:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932461AbeAIK5y (ORCPT + 28 others); Tue, 9 Jan 2018 05:57:54 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:50981 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932225AbeAIK5L (ORCPT ); Tue, 9 Jan 2018 05:57:11 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id D60EE20949; Tue, 9 Jan 2018 11:57:09 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 2E7BE2095C; Tue, 9 Jan 2018 11:56:47 +0100 (CET) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard , Daniel Vetter , Jani Nikula , Sean Paul Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thomas Petazzoni , thomas@vitsch.nl Subject: [PATCH 17/19] drm/sun4i: backend: Make zpos configurable Date: Tue, 9 Jan 2018 11:56:36 +0100 Message-Id: X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that we have everything in place, we can make zpos configurable now. Change the zpos property from an immutable one to a regular. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun4i_layer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- git-series 0.9.1 diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c index ec7b906dbb84..9e538f761dcb 100644 --- a/drivers/gpu/drm/sun4i/sun4i_layer.c +++ b/drivers/gpu/drm/sun4i/sun4i_layer.c @@ -163,6 +163,9 @@ static struct sun4i_layer *sun4i_layer_init_one(struct drm_device *drm, &sun4i_backend_layer_helper_funcs); layer->backend = backend; + drm_plane_create_zpos_property(&layer->plane, 0, 0, + SUN4I_BACKEND_NUM_LAYERS - 1); + return layer; } @@ -189,8 +192,6 @@ struct drm_plane **sun4i_layers_init(struct drm_device *drm, return ERR_CAST(layer); }; - drm_plane_create_zpos_immutable_property(&layer->plane, i); - layer->id = i; planes[i] = &layer->plane; }; From patchwork Tue Jan 9 10:56:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 123881 Delivered-To: patch@linaro.org Received: by 10.80.140.226 with SMTP id r31csp306157edr; Tue, 9 Jan 2018 02:57:52 -0800 (PST) X-Google-Smtp-Source: ACJfBovGyUoQtCjibyv79RIuUWC+rk5sL+Pxmz2LATDZHrHUECaGzuVrTHZN3htk9fXfdFTmX30J X-Received: by 10.98.20.20 with SMTP id 20mr557838pfu.152.1515495472625; Tue, 09 Jan 2018 02:57:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515495472; cv=none; d=google.com; s=arc-20160816; b=yQ8Uo1ySoexkzP16/o8fqguR+UhHKNm0tT3fAlto8IC+D6qHdYLn01l9S0a2gBWB9z mr+r89ayRhaeX5zpsENQ5ZUsqrRXQ4b4AUZjhvmFJZhBECcfGfpSmCuzmMUSSBSGmc+w 7m0MmG5aw5eHKoV7jpS5QvWd9EqIkJLddOHhBQhusJ9uPunne6JU1GwP7w1xSl8PvgEf FX+f8U4Od8195MDXw1ahWOZfoANxbPFJyVskHV53iCjoZKEWieyNW1jVXQRlDIJcqFLH oOF49vnl3E1t1vTkIGE3OJtQMluU1nrMRFM57kAfhF65WIfBmdSCnQ2HZM0gbjYJW0C7 5UZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=EuVzHvVQ/I7ZXblm95xX6AYaab7XZvGlyGSJtoQTb9Q=; b=CapFqexzrc05BTAEOT+XRpK86sgK1RtNwBC1QdWYaAX1a3B9ZdRpSNB41ueImlVtOM PNR3UYA2KT+7FoTllZMPffIkny3dOoeeKyuuNFwIYbaE8ZLPu78ZBaEUD+m0eOTa2tuu 1m1pKMMfd+xiSpn+/JDFwstusBsbrv/Qx80Ylcsj9CBztDIeKsAfoM3f9Bxzkea6C7vZ dvcg9apDAXrsYGJrR+YwHh1h01ye2dJZONwr+q18/wVj/hnH5xwdA2IZR+Xwe11tmlVK oI0f4sPi9vv6CMDFBqMle2WGRp9p40IGvfQpc1fZY1tvBM0Nwq4+xlRNCv2ZHZUu4a3l 1MFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g6si762754pln.755.2018.01.09.02.57.52; Tue, 09 Jan 2018 02:57:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932354AbeAIK5t (ORCPT + 28 others); Tue, 9 Jan 2018 05:57:49 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:51042 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932231AbeAIK5M (ORCPT ); Tue, 9 Jan 2018 05:57:12 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id F0B0720986; Tue, 9 Jan 2018 11:57:09 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 86A1020974; Tue, 9 Jan 2018 11:56:47 +0100 (CET) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard , Daniel Vetter , Jani Nikula , Sean Paul Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thomas Petazzoni , thomas@vitsch.nl Subject: [PATCH 18/19] drm/sun4i: Add support for plane alpha Date: Tue, 9 Jan 2018 11:56:37 +0100 Message-Id: <44c9e74546fcb9be347c5c373392e8a719c0b11c.1515494838.git-series.maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Our backend supports a per-plane alpha property. Support it through our new helper. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun4i_backend.c | 18 +++++++++++++++--- drivers/gpu/drm/sun4i/sun4i_backend.h | 3 +++ drivers/gpu/drm/sun4i/sun4i_layer.c | 2 ++ 3 files changed, 20 insertions(+), 3 deletions(-) -- git-series 0.9.1 diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.c b/drivers/gpu/drm/sun4i/sun4i_backend.c index ad370ce66b4d..ec47098bfdb2 100644 --- a/drivers/gpu/drm/sun4i/sun4i_backend.c +++ b/drivers/gpu/drm/sun4i/sun4i_backend.c @@ -191,6 +191,15 @@ int sun4i_backend_update_layer_formats(struct sun4i_backend *backend, DRM_DEBUG_DRIVER("Switching display backend interlaced mode %s\n", interlaced ? "on" : "off"); + val = SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA(state->alpha); + if (state->alpha != 255) + val |= SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA_EN; + regmap_update_bits(backend->engine.regs, + SUN4I_BACKEND_ATTCTL_REG0(layer), + SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA_MASK | + SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA_EN, + val); + ret = sun4i_backend_drm_format_to_layer(plane, fb->format->format, &val); if (ret) { @@ -366,7 +375,8 @@ static int sun4i_backend_atomic_check(struct sunxi_engine *engine, DRM_DEBUG_DRIVER("Plane FB format is %s\n", drm_get_format_name(fb->format->format, &format_name)); - if (drm_format_has_alpha(fb->format->format)) + if (drm_format_has_alpha(fb->format->format) || + (plane_state->alpha != 255)) num_alpha_planes++; DRM_DEBUG_DRIVER("Plane zpos is %d\n", @@ -419,7 +429,8 @@ static int sun4i_backend_atomic_check(struct sunxi_engine *engine, } /* We can't have an alpha plane at the lowest position */ - if (drm_format_has_alpha(plane_states[0]->fb->format->format)) + if (drm_format_has_alpha(plane_states[0]->fb->format->format) || + (plane_states[0]->alpha != 255)) return -EINVAL; for (i = 1; i < num_planes; i++) { @@ -431,7 +442,8 @@ static int sun4i_backend_atomic_check(struct sunxi_engine *engine, * The only alpha position is the lowest plane of the * second pipe. */ - if (drm_format_has_alpha(fb->format->format)) + if (drm_format_has_alpha(fb->format->format) || + (p_state->alpha != 255)) current_pipe++; s_state->pipe = current_pipe; diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.h b/drivers/gpu/drm/sun4i/sun4i_backend.h index 52e77591186a..03294d5dd1a2 100644 --- a/drivers/gpu/drm/sun4i/sun4i_backend.h +++ b/drivers/gpu/drm/sun4i/sun4i_backend.h @@ -68,11 +68,14 @@ #define SUN4I_BACKEND_CKMIN_REG 0x884 #define SUN4I_BACKEND_CKCFG_REG 0x888 #define SUN4I_BACKEND_ATTCTL_REG0(l) (0x890 + (0x4 * (l))) +#define SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA_MASK GENMASK(31, 24) +#define SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA(x) ((x) << 24) #define SUN4I_BACKEND_ATTCTL_REG0_LAY_PIPESEL_MASK BIT(15) #define SUN4I_BACKEND_ATTCTL_REG0_LAY_PIPESEL(x) ((x) << 15) #define SUN4I_BACKEND_ATTCTL_REG0_LAY_PRISEL_MASK GENMASK(11, 10) #define SUN4I_BACKEND_ATTCTL_REG0_LAY_PRISEL(x) ((x) << 10) #define SUN4I_BACKEND_ATTCTL_REG0_LAY_VDOEN BIT(1) +#define SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA_EN BIT(0) #define SUN4I_BACKEND_ATTCTL_REG1(l) (0x8a0 + (0x4 * (l))) #define SUN4I_BACKEND_ATTCTL_REG1_LAY_HSCAFCT GENMASK(15, 14) diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c index 9e538f761dcb..d5598de92f85 100644 --- a/drivers/gpu/drm/sun4i/sun4i_layer.c +++ b/drivers/gpu/drm/sun4i/sun4i_layer.c @@ -37,6 +37,7 @@ static void sun4i_backend_layer_reset(struct drm_plane *plane) if (state) { plane->state = &state->state; plane->state->plane = plane; + plane->state->alpha = 255; plane->state->zpos = layer->id; } } @@ -163,6 +164,7 @@ static struct sun4i_layer *sun4i_layer_init_one(struct drm_device *drm, &sun4i_backend_layer_helper_funcs); layer->backend = backend; + drm_plane_create_alpha_property(&layer->plane, 255); drm_plane_create_zpos_property(&layer->plane, 0, 0, SUN4I_BACKEND_NUM_LAYERS - 1);