From: Daniel Vetter Subject: Re: [PATCH] drm/plane-helper: Use proper plane init function Date: Tue, 8 Jul 2014 15:40:03 +0200 Message-ID: <20140708134003.GE17271@phenom.ffwll.local> References: <1404167871-29917-1-git-send-email-matthew.d.roper@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by gabe.freedesktop.org (Postfix) with ESMTP id D4E4C6E159 for ; Tue, 8 Jul 2014 06:39:52 -0700 (PDT) Received: by mail-wi0-f173.google.com with SMTP id cc10so1014596wib.6 for ; Tue, 08 Jul 2014 06:39:52 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1404167871-29917-1-git-send-email-matthew.d.roper@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Matt Roper Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Mon, Jun 30, 2014 at 03:37:51PM -0700, Matt Roper wrote: > 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 Applied to topic/core-stuff. -Daniel > --- > 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; > -- > 1.8.5.1 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch