diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-03-05 04:32:44 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-03-10 04:59:35 -0400 |
commit | 3461b30b3e171e16498f3d7bc59ab703aec475c8 (patch) | |
tree | 03e202bd9def50b8ee28d7e925ca0b4bd61beb0f | |
parent | ead8610d42105a3d01f755522f11b96c60dc648f (diff) |
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: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
-rw-r--r-- | drivers/gpu/drm/drm_plane_helper.c | 26 | ||||
-rw-r--r-- | 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 813a06627eb3..8e56783265e1 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 = { | |||
344 | }; | 344 | }; |
345 | EXPORT_SYMBOL(drm_primary_helper_funcs); | 345 | EXPORT_SYMBOL(drm_primary_helper_funcs); |
346 | 346 | ||
347 | /** | 347 | static struct drm_plane *create_primary_plane(struct drm_device *dev) |
348 | * drm_primary_helper_create_plane() - Create a generic primary plane | ||
349 | * @dev: drm device | ||
350 | * @formats: pixel formats supported, or NULL for a default safe list | ||
351 | * @num_formats: size of @formats; ignored if @formats is NULL | ||
352 | * | ||
353 | * Allocates and initializes a primary plane that can be used with the primary | ||
354 | * plane helpers. Drivers that wish to use driver-specific plane structures or | ||
355 | * provide custom handler functions may perform their own allocation and | ||
356 | * initialization rather than calling this function. | ||
357 | */ | ||
358 | struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev, | ||
359 | const uint32_t *formats, | ||
360 | int num_formats) | ||
361 | { | 348 | { |
362 | struct drm_plane *primary; | 349 | struct drm_plane *primary; |
363 | int ret; | 350 | int ret; |
@@ -368,15 +355,11 @@ struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev, | |||
368 | return NULL; | 355 | return NULL; |
369 | } | 356 | } |
370 | 357 | ||
371 | if (formats == NULL) { | ||
372 | formats = safe_modeset_formats; | ||
373 | num_formats = ARRAY_SIZE(safe_modeset_formats); | ||
374 | } | ||
375 | |||
376 | /* possible_crtc's will be filled in later by crtc_init */ | 358 | /* possible_crtc's will be filled in later by crtc_init */ |
377 | ret = drm_universal_plane_init(dev, primary, 0, | 359 | ret = drm_universal_plane_init(dev, primary, 0, |
378 | &drm_primary_helper_funcs, | 360 | &drm_primary_helper_funcs, |
379 | formats, num_formats, | 361 | safe_modeset_formats, |
362 | ARRAY_SIZE(safe_modeset_formats), | ||
380 | DRM_PLANE_TYPE_PRIMARY); | 363 | DRM_PLANE_TYPE_PRIMARY); |
381 | if (ret) { | 364 | if (ret) { |
382 | kfree(primary); | 365 | kfree(primary); |
@@ -385,7 +368,6 @@ struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev, | |||
385 | 368 | ||
386 | return primary; | 369 | return primary; |
387 | } | 370 | } |
388 | EXPORT_SYMBOL(drm_primary_helper_create_plane); | ||
389 | 371 | ||
390 | /** | 372 | /** |
391 | * drm_crtc_init - Legacy CRTC initialization function | 373 | * drm_crtc_init - Legacy CRTC initialization function |
@@ -404,7 +386,7 @@ int drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc, | |||
404 | { | 386 | { |
405 | struct drm_plane *primary; | 387 | struct drm_plane *primary; |
406 | 388 | ||
407 | primary = drm_primary_helper_create_plane(dev, NULL, 0); | 389 | primary = create_primary_plane(dev); |
408 | return drm_crtc_init_with_planes(dev, crtc, primary, NULL, funcs); | 390 | return drm_crtc_init_with_planes(dev, crtc, primary, NULL, funcs); |
409 | } | 391 | } |
410 | EXPORT_SYMBOL(drm_crtc_init); | 392 | EXPORT_SYMBOL(drm_crtc_init); |
diff --git a/include/drm/drm_plane_helper.h b/include/drm/drm_plane_helper.h index 72ddab02ebd9..e48157a5a59c 100644 --- a/include/drm/drm_plane_helper.h +++ b/include/drm/drm_plane_helper.h | |||
@@ -100,10 +100,6 @@ extern int drm_primary_helper_update(struct drm_plane *plane, | |||
100 | extern int drm_primary_helper_disable(struct drm_plane *plane); | 100 | extern int drm_primary_helper_disable(struct drm_plane *plane); |
101 | extern void drm_primary_helper_destroy(struct drm_plane *plane); | 101 | extern void drm_primary_helper_destroy(struct drm_plane *plane); |
102 | extern const struct drm_plane_funcs drm_primary_helper_funcs; | 102 | extern const struct drm_plane_funcs drm_primary_helper_funcs; |
103 | extern struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev, | ||
104 | const uint32_t *formats, | ||
105 | int num_formats); | ||
106 | |||
107 | 103 | ||
108 | int drm_plane_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, | 104 | int drm_plane_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, |
109 | struct drm_framebuffer *fb, | 105 | struct drm_framebuffer *fb, |