Commit 3461b30b authored by Daniel Vetter's avatar Daniel Vetter

drm/plane-helper: unexport drm_primary_helper_create_plane

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>
Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
parent ead8610d
...@@ -344,20 +344,7 @@ const struct drm_plane_funcs drm_primary_helper_funcs = { ...@@ -344,20 +344,7 @@ const struct drm_plane_funcs drm_primary_helper_funcs = {
}; };
EXPORT_SYMBOL(drm_primary_helper_funcs); EXPORT_SYMBOL(drm_primary_helper_funcs);
/** static struct drm_plane *create_primary_plane(struct drm_device *dev)
* 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)
{ {
struct drm_plane *primary; struct drm_plane *primary;
int ret; int ret;
...@@ -368,15 +355,11 @@ struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev, ...@@ -368,15 +355,11 @@ struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev,
return NULL; 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 */ /* possible_crtc's will be filled in later by crtc_init */
ret = drm_universal_plane_init(dev, primary, 0, ret = drm_universal_plane_init(dev, primary, 0,
&drm_primary_helper_funcs, &drm_primary_helper_funcs,
formats, num_formats, safe_modeset_formats,
ARRAY_SIZE(safe_modeset_formats),
DRM_PLANE_TYPE_PRIMARY); DRM_PLANE_TYPE_PRIMARY);
if (ret) { if (ret) {
kfree(primary); kfree(primary);
...@@ -385,7 +368,6 @@ struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev, ...@@ -385,7 +368,6 @@ struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev,
return primary; return primary;
} }
EXPORT_SYMBOL(drm_primary_helper_create_plane);
/** /**
* drm_crtc_init - Legacy CRTC initialization function * drm_crtc_init - Legacy CRTC initialization function
...@@ -404,7 +386,7 @@ int drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc, ...@@ -404,7 +386,7 @@ int drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
{ {
struct drm_plane *primary; 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); return drm_crtc_init_with_planes(dev, crtc, primary, NULL, funcs);
} }
EXPORT_SYMBOL(drm_crtc_init); EXPORT_SYMBOL(drm_crtc_init);
......
...@@ -100,10 +100,6 @@ extern int drm_primary_helper_update(struct drm_plane *plane, ...@@ -100,10 +100,6 @@ extern int drm_primary_helper_update(struct drm_plane *plane,
extern int drm_primary_helper_disable(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 void drm_primary_helper_destroy(struct drm_plane *plane);
extern const struct drm_plane_funcs drm_primary_helper_funcs; 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, int drm_plane_helper_update(struct drm_plane *plane, struct drm_crtc *crtc,
struct drm_framebuffer *fb, struct drm_framebuffer *fb,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment