From patchwork Tue Sep 29 18:10:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King X-Patchwork-Id: 7289291 Return-Path: X-Original-To: patchwork-dri-devel@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 10B29BF90C for ; Tue, 29 Sep 2015 18:17:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3028920687 for ; Tue, 29 Sep 2015 18:17:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C1EC8206C7 for ; Tue, 29 Sep 2015 18:17:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 29E136E1E1; Tue, 29 Sep 2015 11:17:14 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from pandora.arm.linux.org.uk (pandora.arm.linux.org.uk [78.32.30.218]) by gabe.freedesktop.org (Postfix) with ESMTPS id 826BF6E1E1 for ; Tue, 29 Sep 2015 11:17:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=pandora-2014; h=Date:Sender:Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Subject:To:From:References:In-Reply-To; bh=RL79/nyskZKVfoaCZVuYF4sCu/HD5tCGE9LDG0ehLWo=; b=h3Hq42py5MTlrBGQKae5lYe7QlwnXMlIrRaAXeO1DMXstWhdXUjHtJmydGY+4r4vLRB6WoPDrIv2Vx8LuEgYQaZd641gvcLVmR8ziHE1JKiXxpd3RmD0B9MhN7OC7XV24TcgEj5wclGVnreHE+Pm8fjozD6DwOty1PTc8PuQjKY=; Received: from e0022681537dd.dyn.arm.linux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:59277 helo=rmk-PC.arm.linux.org.uk) by pandora.arm.linux.org.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1ZgzM4-0004KN-Ti for dri-devel@lists.freedesktop.org; Tue, 29 Sep 2015 19:10:20 +0100 Received: from rmk by rmk-PC.arm.linux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1ZgzM3-0003lT-SA for dri-devel@lists.freedesktop.org; Tue, 29 Sep 2015 19:10:20 +0100 In-Reply-To: <20150929180843.GP21513@n2100.arm.linux.org.uk> References: <20150929180843.GP21513@n2100.arm.linux.org.uk> From: Russell King To: dri-devel@lists.freedesktop.org Subject: [PATCH 10/20] drm/armada: introduce generic armada_plane struct MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 29 Sep 2015 19:10:19 +0100 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_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 Introduce a generic armada_plane struct which will eventually be used for both the primary and overlay planes. Signed-off-by: Russell King --- drivers/gpu/drm/armada/armada_crtc.h | 5 +++++ drivers/gpu/drm/armada/armada_overlay.c | 17 +++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/armada/armada_crtc.h b/drivers/gpu/drm/armada/armada_crtc.h index a86243ef4a51..549b5f538266 100644 --- a/drivers/gpu/drm/armada/armada_crtc.h +++ b/drivers/gpu/drm/armada/armada_crtc.h @@ -34,6 +34,11 @@ struct armada_regs { struct armada_frame_work; struct armada_variant; +struct armada_plane { + struct drm_plane base; +}; +#define drm_to_armada_plane(p) container_of(p, struct armada_plane, base) + struct armada_crtc { struct drm_crtc crtc; const struct armada_variant *variant; diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/gpu/drm/armada/armada_overlay.c index 4609ae8de042..e5a5b73a08cb 100644 --- a/drivers/gpu/drm/armada/armada_overlay.c +++ b/drivers/gpu/drm/armada/armada_overlay.c @@ -30,7 +30,7 @@ struct armada_ovl_plane_properties { }; struct armada_ovl_plane { - struct drm_plane base; + struct armada_plane base; struct drm_framebuffer *old_fb; uint32_t src_hw; uint32_t dst_hw; @@ -43,7 +43,8 @@ struct armada_ovl_plane { } vbl; struct armada_ovl_plane_properties prop; }; -#define drm_to_armada_ovl_plane(p) container_of(p, struct armada_ovl_plane, base) +#define drm_to_armada_ovl_plane(p) \ + container_of(p, struct armada_ovl_plane, base.base) static void @@ -266,10 +267,10 @@ static int armada_ovl_plane_disable(struct drm_plane *plane) struct drm_framebuffer *fb; struct armada_crtc *dcrtc; - if (!dplane->base.crtc) + if (!dplane->base.base.crtc) return 0; - dcrtc = drm_to_armada_crtc(dplane->base.crtc); + dcrtc = drm_to_armada_crtc(dplane->base.base.crtc); dcrtc->plane = NULL; spin_lock_irq(&dcrtc->irq_lock); @@ -362,9 +363,9 @@ static int armada_ovl_plane_set_property(struct drm_plane *plane, update_attr = true; } - if (update_attr && dplane->base.crtc) + if (update_attr && dplane->base.base.crtc) armada_ovl_update_attr(&dplane->prop, - drm_to_armada_crtc(dplane->base.crtc)); + drm_to_armada_crtc(dplane->base.base.crtc)); return 0; } @@ -461,7 +462,7 @@ int armada_overlay_plane_create(struct drm_device *dev, unsigned long crtcs) armada_drm_vbl_event_init(&dplane->vbl.update, armada_ovl_plane_vbl, dplane); - ret = drm_universal_plane_init(dev, &dplane->base, crtcs, + ret = drm_universal_plane_init(dev, &dplane->base.base, crtcs, &armada_ovl_plane_funcs, armada_ovl_formats, ARRAY_SIZE(armada_ovl_formats), @@ -479,7 +480,7 @@ int armada_overlay_plane_create(struct drm_device *dev, unsigned long crtcs) dplane->prop.contrast = 0x4000; dplane->prop.saturation = 0x4000; - mobj = &dplane->base.base; + mobj = &dplane->base.base.base; drm_object_attach_property(mobj, priv->colorkey_prop, 0x0101fe); drm_object_attach_property(mobj, priv->colorkey_min_prop,