From patchwork Tue Sep 29 18:10:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King X-Patchwork-Id: 7289411 Return-Path: X-Original-To: patchwork-dri-devel@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 E6DAD9F302 for ; Tue, 29 Sep 2015 18:17:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 15A0020687 for ; Tue, 29 Sep 2015 18:17:48 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id BDE4C206C7 for ; Tue, 29 Sep 2015 18:17:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 193E16E1E2; Tue, 29 Sep 2015 11:17:46 -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 610946E7AF for ; Tue, 29 Sep 2015 11:17:44 -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=u+GQksyF9vczMzISEYscmR80adz/7ubC7QG3CV5t+0k=; b=eIXKAfnwhrklHRLy7ZtQUpQbcgmKhRbDuXEZV5eMFblFIxfgeEe7M/1QBTGslybONdGFrp7IEFJqGurDFi/dvF6zgool5DpnReTzVDSwffpzxoMTo9eDeNqW96RwlRffkeaYaS/YAV8BWPWiWSEsdBwqgA2oZ4l2uq1u6b2ise0=; Received: from e0022681537dd.dyn.arm.linux.org.uk ([2002:4e20:1eda:1:222:68ff:fe15:37dd]:44974 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 1ZgzMF-0004KX-Lp for dri-devel@lists.freedesktop.org; Tue, 29 Sep 2015 19:10:31 +0100 Received: from rmk by rmk-PC.arm.linux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1ZgzME-0003lf-J4 for dri-devel@lists.freedesktop.org; Tue, 29 Sep 2015 19:10:30 +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 12/20] drm/armada: allocate primary plane ourselves MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 29 Sep 2015 19:10:30 +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 Allocate our own primary plane as an armada_plane. Signed-off-by: Russell King --- drivers/gpu/drm/armada/armada_crtc.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c index b96b77b61337..f146fcf6b274 100644 --- a/drivers/gpu/drm/armada/armada_crtc.c +++ b/drivers/gpu/drm/armada/armada_crtc.c @@ -1059,6 +1059,12 @@ static struct drm_crtc_funcs armada_crtc_funcs = { .set_property = armada_drm_crtc_set_property, }; +static const struct drm_plane_funcs armada_primary_plane_funcs = { + .update_plane = drm_primary_helper_update, + .disable_plane = drm_primary_helper_disable, + .destroy = drm_primary_helper_destroy, +}; + static struct drm_prop_enum_list armada_drm_csc_yuv_enum_list[] = { { CSC_AUTO, "Auto" }, { CSC_YUV_CCIR601, "CCIR601" }, @@ -1097,7 +1103,7 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev, { struct armada_private *priv = drm->dev_private; struct armada_crtc *dcrtc; - struct drm_plane *primary; + struct armada_plane *primary; void __iomem *base; int ret; @@ -1167,12 +1173,21 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev, dcrtc->crtc.port = port; - primary = drm_primary_helper_create_plane(drm, armada_primary_formats, - ARRAY_SIZE(armada_primary_formats)); + primary = kzalloc(sizeof(*primary), GFP_KERNEL); if (!primary) return -ENOMEM; - ret = drm_crtc_init_with_planes(drm, &dcrtc->crtc, primary, NULL, + ret = drm_universal_plane_init(drm, &primary->base, 0, + &armada_primary_plane_funcs, + armada_primary_formats, + ARRAY_SIZE(armada_primary_formats), + DRM_PLANE_TYPE_PRIMARY); + if (ret) { + kfree(primary); + return ret; + } + + ret = drm_crtc_init_with_planes(drm, &dcrtc->crtc, &primary->base, NULL, &armada_crtc_funcs); if (ret) goto err_crtc_init; @@ -1187,7 +1202,7 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev, return armada_overlay_plane_create(drm, 1 << dcrtc->num); err_crtc_init: - primary->funcs->destroy(primary); + primary->base.funcs->destroy(&primary->base); return ret; }