From patchwork Thu Mar 5 10:01:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 5944421 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 50F4A9F691 for ; Thu, 5 Mar 2015 09:59:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 63AF42037F for ; Thu, 5 Mar 2015 09:59:38 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DBC8B20383 for ; Thu, 5 Mar 2015 09:59:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6BF7A6E335; Thu, 5 Mar 2015 01:59:34 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by gabe.freedesktop.org (Postfix) with ESMTP id F2BBA6E0B6 for ; Thu, 5 Mar 2015 01:59:32 -0800 (PST) Received: by wivr20 with SMTP id r20so5439938wiv.5 for ; Thu, 05 Mar 2015 01:59:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id; bh=wGxIAavjpdJUXm1qnaJ8Y3aGiuHEEclOB+/YXNJJnpI=; b=WbtmBbdL1aCtLrJmL7OCVs9FlRxcKkmZd8MUmm40jFyolbUHaukbXgcu20f6Du7DYx NaSPAP+OqjXedhY11PQVocQvOZDoQr4uy8jCG4JQvei8lZV9xy+i4osGvXijqe2kOjHM x3icwYIlr4/9XCuIA5063pS/KMksxFHw4SXjk= 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; bh=wGxIAavjpdJUXm1qnaJ8Y3aGiuHEEclOB+/YXNJJnpI=; b=S7+NNGblff8aXnEHUThp4099P97VtYwNFoljfXy4zi3g2D8KzI/zwV8pMAkkeHCmJB XGEKFwziYyuzD4EhO5Um1ZjlWKeuwiEC3EpJ2NfCIVIiGix9i4BIaB6TVKIZQ/Ybdyno IQqNW1V2G8BNKFwG5rbr1v3AiZAOFqCPou9EWPMwb1bPQc92J1b6VYxUzU/+cahe6ndj 8aPr4Xroy+Q/yKGZmAy17jpVdafPB5OSBYRbpbsRudf0FgJ3w/3m4erCY2EJbhy1p0X3 0E9tZ9Afn6qd4nMc9v+pQkVsRGwj9WHXTEd+FNxzkuYu8WI0d2QxzfdSSgNt8pVn+GJ5 4Akw== X-Gm-Message-State: ALoCoQl8Uv3/ZXqIe9MVMUbP0z4GSj33iJsPrxIy4YJzrMK7OWHA3rJogNLBoIBZs6P7jhqsgh1b X-Received: by 10.194.59.199 with SMTP id b7mr17225026wjr.26.1425549572235; Thu, 05 Mar 2015 01:59:32 -0800 (PST) Received: from phenom.ffwll.local (212-51-149-109.fiber7.init7.net. [212.51.149.109]) by mx.google.com with ESMTPSA id h11sm28964791wic.14.2015.03.05.01.59.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Mar 2015 01:59:31 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH] drm/plane-helper: unexport drm_primary_helper_create_plane Date: Thu, 5 Mar 2015 11:01:08 +0100 Message-Id: <1425549668-2744-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.1.4 Cc: Daniel Vetter , Laurent Pinchart , Daniel Vetter 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" 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 We shouldn't tempt driver writers into using this since it uses a default format list which is likely wrong. And when that's done we can simplify the code a bit, too. Noticed while reviewing a patch from Laurent. Cc: Laurent Pinchart Cc: Matt Roper Signed-off-by: Daniel Vetter Reviewed-by: Matt Roper --- drivers/gpu/drm/drm_plane_helper.c | 26 ++++---------------------- include/drm/drm_plane_helper.h | 4 ---- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c index 5ba5792bfdba..de8c6565bc55 100644 --- a/drivers/gpu/drm/drm_plane_helper.c +++ b/drivers/gpu/drm/drm_plane_helper.c @@ -344,20 +344,7 @@ const struct drm_plane_funcs drm_primary_helper_funcs = { }; EXPORT_SYMBOL(drm_primary_helper_funcs); -/** - * drm_primary_helper_create_plane() - Create a generic primary plane - * @dev: drm device - * @formats: pixel formats supported, or NULL for a default safe list - * @num_formats: size of @formats; ignored if @formats is NULL - * - * Allocates and initializes a primary plane that can be used with the primary - * plane helpers. Drivers that wish to use driver-specific plane structures or - * provide custom handler functions may perform their own allocation and - * initialization rather than calling this function. - */ -struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev, - const uint32_t *formats, - int num_formats) +static struct drm_plane *create_primary_plane(struct drm_device *dev) { struct drm_plane *primary; int ret; @@ -368,15 +355,11 @@ struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev, return NULL; } - if (formats == NULL) { - formats = safe_modeset_formats; - num_formats = ARRAY_SIZE(safe_modeset_formats); - } - /* possible_crtc's will be filled in later by crtc_init */ ret = drm_universal_plane_init(dev, primary, 0, &drm_primary_helper_funcs, - formats, num_formats, + safe_modeset_formats, + ARRAY_SIZE(safe_modeset_formats), DRM_PLANE_TYPE_PRIMARY); if (ret) { kfree(primary); @@ -385,7 +368,6 @@ struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev, return primary; } -EXPORT_SYMBOL(drm_primary_helper_create_plane); /** * drm_crtc_init - Legacy CRTC initialization function @@ -404,7 +386,7 @@ int drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc, { struct drm_plane *primary; - primary = drm_primary_helper_create_plane(dev, NULL, 0); + primary = create_primary_plane(dev); return drm_crtc_init_with_planes(dev, crtc, primary, NULL, funcs); } EXPORT_SYMBOL(drm_crtc_init); diff --git a/include/drm/drm_plane_helper.h b/include/drm/drm_plane_helper.h index 31c11d36fae6..695f9791659d 100644 --- a/include/drm/drm_plane_helper.h +++ b/include/drm/drm_plane_helper.h @@ -98,10 +98,6 @@ extern int drm_primary_helper_update(struct drm_plane *plane, extern int drm_primary_helper_disable(struct drm_plane *plane); extern void drm_primary_helper_destroy(struct drm_plane *plane); extern const struct drm_plane_funcs drm_primary_helper_funcs; -extern struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev, - const uint32_t *formats, - int num_formats); - int drm_plane_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, struct drm_framebuffer *fb,