From patchwork Mon Jun 30 22:37:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Roper X-Patchwork-Id: 4455291 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BDAA09F358 for ; Mon, 30 Jun 2014 22:37:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 029322038E for ; Mon, 30 Jun 2014 22:37:14 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DE7DA2037A for ; Mon, 30 Jun 2014 22:37:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5DEB26E4D6; Mon, 30 Jun 2014 15:37:11 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id 1BEBC6E4D6 for ; Mon, 30 Jun 2014 15:37:10 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 30 Jun 2014 15:31:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,578,1400050800"; d="scan'208";a="555494890" Received: from mdroper-hswdev.fm.intel.com (HELO mdroper-hswdev) ([10.1.134.215]) by fmsmga001.fm.intel.com with ESMTP; 30 Jun 2014 15:37:09 -0700 Received: from mattrope by mdroper-hswdev with local (Exim 4.82) (envelope-from ) id 1X1kCx-0007n7-9A; Mon, 30 Jun 2014 15:37:55 -0700 From: Matt Roper To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/plane-helper: Use proper plane init function Date: Mon, 30 Jun 2014 15:37:51 -0700 Message-Id: <1404167871-29917-1-git-send-email-matthew.d.roper@intel.com> X-Mailer: git-send-email 1.8.5.1 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 drm_plane_init() (the legacy plane initialization function) takes a bool as its final parameter; originally this indicated whether a plane was 'private' to the driver (before the DRM core understood non-overlay planes), now it indicates whether the plane is a primary plane (private planes were used by some drivers to represent primary planes internally). The newer drm_universal_plane_init() take an 'enum drm_plane_type' as its final parameter to allow the caller to specify the specific plane type desired (primary, cursor, or overlay). Due to a rebasing mistake, the primary plane helper is currently passing DRM_PLANE_TYPE_PRIMARY (enum value = 1) for drm_plane_init()'s boolean 'is_primary' parameter. This winds up giving the correct behavior since DRM_PLANE_TYPE_PRIMARY evaluates as true, but is confusing to anyone reading the code since we're passing an enum value (one of three possible values) for a boolean parameter. Replace the primary plane helper's call to drm_plane_init() with drm_universal_plane_init() so that the parameter and value types match up as expected. Signed-off-by: Matt Roper --- drivers/gpu/drm/drm_plane_helper.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c index 6d13314..827ec1a 100644 --- a/drivers/gpu/drm/drm_plane_helper.c +++ b/drivers/gpu/drm/drm_plane_helper.c @@ -335,9 +335,10 @@ struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev, } /* possible_crtc's will be filled in later by crtc_init */ - ret = drm_plane_init(dev, primary, 0, &drm_primary_helper_funcs, - formats, num_formats, - DRM_PLANE_TYPE_PRIMARY); + ret = drm_universal_plane_init(dev, primary, 0, + &drm_primary_helper_funcs, + formats, num_formats, + DRM_PLANE_TYPE_PRIMARY); if (ret) { kfree(primary); primary = NULL;