From patchwork Thu May 12 10:28:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 67638 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp676222qge; Thu, 12 May 2016 03:28:54 -0700 (PDT) X-Received: by 10.67.14.68 with SMTP id fe4mr12499956pad.93.1463048934411; Thu, 12 May 2016 03:28:54 -0700 (PDT) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTP id u4si16592720pfu.157.2016.05.12.03.28.54; Thu, 12 May 2016 03:28:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 56E186E80B; Thu, 12 May 2016 10:28:53 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4A0566E80B for ; Thu, 12 May 2016 10:28:47 +0000 (UTC) Received: by mail-wm0-x22f.google.com with SMTP id a17so127935892wme.0 for ; Thu, 12 May 2016 03:28:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ioXhOIa7AEr90x+PouWy338p7fbCoo+lGdwvYBKqa74=; b=ctf01kerh3jFa8DF0fKjIZ5DFrqMe2jW2fRq5OdKRixVS3AhpkQ7mo5nyDVTj01FPZ drEfBG/iwUxL8AjdDnJNdUMymMQsekeLWSYDQZYJT7EjjNaBs8K4PMleE21C0s84jhpL plXLUmLNN+Yjo9I+XCTqSVH/Rbq9Un6kS0I7M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ioXhOIa7AEr90x+PouWy338p7fbCoo+lGdwvYBKqa74=; b=XXtSyWnE5CYDLK+Hmlp3U4llgYy9Nu2/a2CswUDc0rtBV7qjexEdp4EMwAyELG5SaJ gjAThJXoPq/4nrG8y5lt5WQDrODje0tmsEdFzHDjh8hlYui6/jOClFRnZ6T7HnpC0KC0 A4+2b6FX3w0yt59C6bO83bQhJ7xg5L7T9xnHGrJV3n6OwRWR6FPgyrKTPc8OxCo4wth6 uftlssh7zG1AqU3PrOvaMqwJowmjSwNCMI5Xmw7QPvF5Zi4sjxUZK+wMoTm8zbqxs7Ik 2h/Rusw/sQedrydSA5AQ7Aph2/iIu+f4OHYTLrDcGpc4/NrXfHzYc7kLzsBPFOlfcvdJ T1hw== X-Gm-Message-State: AOPr4FUQ+vJ1gUXhH3e2mLdqG/rMCe5RIMsKk4LuCHZLjSvAN4cB6A0b+Y1C7oZyZ+PdgnUT X-Received: by 10.194.203.227 with SMTP id kt3mr8850907wjc.73.1463048925921; Thu, 12 May 2016 03:28:45 -0700 (PDT) Received: from lmenx321.st.com. ([80.12.35.32]) by smtp.gmail.com with ESMTPSA id ib1sm12627339wjb.48.2016.05.12.03.28.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 May 2016 03:28:45 -0700 (PDT) From: Benjamin Gaignard To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, daniel@ffwll.ch Subject: [PATCH 4/4] drm: rcar: use generic code for managing zpos plane property Date: Thu, 12 May 2016 12:28:22 +0200 Message-Id: <1463048902-9388-4-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1463048902-9388-1-git-send-email-benjamin.gaignard@linaro.org> References: <1463048902-9388-1-git-send-email-benjamin.gaignard@linaro.org> Cc: linaro-mm-sig@lists.linaro.org, Marek Szyprowski , Benjamin Gaignard , Laurent Pinchart 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" This patch replaces zpos property handling custom code in rcar DRM driver with calls to generic DRM code. Signed-off-by: Benjamin Gaignard Cc: Daniel Vetter Cc: Ville Syrjala Cc: Laurent Pinchart Cc: Marek Szyprowski --- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 2 +- 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 | 9 ++------- drivers/gpu/drm/rcar-du/rcar_du_plane.h | 2 -- 5 files changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c index 0d8bdda..28d2cb6 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c @@ -196,7 +196,7 @@ void rcar_du_crtc_route_output(struct drm_crtc *crtc, static unsigned int plane_zpos(struct rcar_du_plane *plane) { - return to_rcar_plane_state(plane->plane.state)->zpos; + return plane->plane.state->normalized_zpos; } static const struct rcar_du_format_info * diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.h b/drivers/gpu/drm/rcar-du/rcar_du_drv.h index ed35467..c843c31 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.h +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.h @@ -92,7 +92,6 @@ struct rcar_du_device { struct { struct drm_property *alpha; struct drm_property *colorkey; - struct drm_property *zpos; } props; unsigned int dpad0_source; diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c index e70a4f3..4ace0aa 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c @@ -527,11 +527,6 @@ static int rcar_du_properties_init(struct rcar_du_device *rcdu) if (rcdu->props.colorkey == NULL) return -ENOMEM; - rcdu->props.zpos = - drm_property_create_range(rcdu->ddev, 0, "zpos", 1, 7); - if (rcdu->props.zpos == NULL) - return -ENOMEM; - return 0; } diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/rcar-du/rcar_du_plane.c index 8460ae1..4764afc 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c @@ -656,7 +656,7 @@ static void rcar_du_plane_reset(struct drm_plane *plane) state->source = RCAR_DU_PLANE_MEMORY; state->alpha = 255; state->colorkey = RCAR_DU_COLORKEY_NONE; - state->zpos = plane->type == DRM_PLANE_TYPE_PRIMARY ? 0 : 1; + plane->state->zpos = plane->type == DRM_PLANE_TYPE_PRIMARY ? 0 : 1; plane->state = &state->state; plane->state->plane = plane; @@ -674,8 +674,6 @@ static int rcar_du_plane_atomic_set_property(struct drm_plane *plane, rstate->alpha = val; else if (property == rcdu->props.colorkey) rstate->colorkey = val; - else if (property == rcdu->props.zpos) - rstate->zpos = val; else return -EINVAL; @@ -694,8 +692,6 @@ static int rcar_du_plane_atomic_get_property(struct drm_plane *plane, *val = rstate->alpha; else if (property == rcdu->props.colorkey) *val = rstate->colorkey; - else if (property == rcdu->props.zpos) - *val = rstate->zpos; else return -EINVAL; @@ -767,8 +763,7 @@ int rcar_du_planes_init(struct rcar_du_group *rgrp) drm_object_attach_property(&plane->plane.base, rcdu->props.colorkey, RCAR_DU_COLORKEY_NONE); - drm_object_attach_property(&plane->plane.base, - rcdu->props.zpos, 1); + drm_plane_create_zpos_property(&plane->plane, 1, 7); } return 0; diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.h b/drivers/gpu/drm/rcar-du/rcar_du_plane.h index b18b7b2..8b91dd3 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_plane.h +++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.h @@ -51,7 +51,6 @@ static inline struct rcar_du_plane *to_rcar_plane(struct drm_plane *plane) * @hwindex: 0-based hardware plane index, -1 means unused * @alpha: value of the plane alpha property * @colorkey: value of the plane colorkey property - * @zpos: value of the plane zpos property */ struct rcar_du_plane_state { struct drm_plane_state state; @@ -62,7 +61,6 @@ struct rcar_du_plane_state { unsigned int alpha; unsigned int colorkey; - unsigned int zpos; }; static inline struct rcar_du_plane_state *