All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/plane-helper: unexport drm_primary_helper_create_plane
@ 2015-03-05 10:01 Daniel Vetter
  2015-03-05 15:07 ` Matt Roper
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Vetter @ 2015-03-05 10:01 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Laurent Pinchart, Daniel Vetter

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 <laurent.pinchart@ideasonboard.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 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,
-- 
2.1.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/plane-helper: unexport drm_primary_helper_create_plane
  2015-03-05 10:01 [PATCH] drm/plane-helper: unexport drm_primary_helper_create_plane Daniel Vetter
@ 2015-03-05 15:07 ` Matt Roper
  2015-03-05 15:48   ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Roper @ 2015-03-05 15:07 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, Laurent Pinchart, DRI Development

On Thu, Mar 05, 2015 at 11:01:08AM +0100, Daniel Vetter wrote:
> 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 <laurent.pinchart@ideasonboard.com>
> Cc: Matt Roper <matthew.d.roper@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>

> ---
>  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,
> -- 
> 2.1.4
> 

-- 
Matt Roper
Graphics Software Engineer
IoTG Platform Enabling & Development
Intel Corporation
(916) 356-2795
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/plane-helper: unexport drm_primary_helper_create_plane
  2015-03-05 15:07 ` Matt Roper
@ 2015-03-05 15:48   ` Daniel Vetter
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2015-03-05 15:48 UTC (permalink / raw)
  To: Matt Roper
  Cc: Daniel Vetter, Laurent Pinchart, DRI Development, Daniel Vetter

On Thu, Mar 05, 2015 at 07:07:30AM -0800, Matt Roper wrote:
> On Thu, Mar 05, 2015 at 11:01:08AM +0100, Daniel Vetter wrote:
> > 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 <laurent.pinchart@ideasonboard.com>
> > Cc: Matt Roper <matthew.d.roper@intel.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> 
> Reviewed-by: Matt Roper <matthew.d.roper@intel.com>

Merged to drm-misc, thanks for the review.
-Daniel

> 
> > ---
> >  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,
> > -- 
> > 2.1.4
> > 
> 
> -- 
> Matt Roper
> Graphics Software Engineer
> IoTG Platform Enabling & Development
> Intel Corporation
> (916) 356-2795

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-05 15:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-05 10:01 [PATCH] drm/plane-helper: unexport drm_primary_helper_create_plane Daniel Vetter
2015-03-05 15:07 ` Matt Roper
2015-03-05 15:48   ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.