Skip to content

Commit 7221941

Browse files
author
Thomas Zimmermann
committed
drm/plane: Remove drm_plane_init()
Open-code drm_plane_init() and remove the function from DRM. The implementation of drm_plane_init() is a simple wrapper around a call to drm_universal_plane_init(), so drivers can just use that instead. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Lyude Paul <[email protected]> # nouveau Acked-by: Jyri Sarha <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent ee34b77 commit 7221941

File tree

6 files changed

+17
-55
lines changed

6 files changed

+17
-55
lines changed

drivers/gpu/drm/drm_modeset_helper.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ EXPORT_SYMBOL(drm_helper_mode_fill_fb_struct);
100100
* This is the minimal list of formats that seem to be safe for modeset use
101101
* with all current DRM drivers. Most hardware can actually support more
102102
* formats than this and drivers may specify a more accurate list when
103-
* creating the primary plane. However drivers that still call
104-
* drm_plane_init() will use this minimal format list as the default.
103+
* creating the primary plane.
105104
*/
106105
static const uint32_t safe_modeset_formats[] = {
107106
DRM_FORMAT_XRGB8888,

drivers/gpu/drm/drm_plane.c

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -482,38 +482,6 @@ void drm_plane_unregister_all(struct drm_device *dev)
482482
}
483483
}
484484

485-
/**
486-
* drm_plane_init - Initialize a legacy plane
487-
* @dev: DRM device
488-
* @plane: plane object to init
489-
* @possible_crtcs: bitmask of possible CRTCs
490-
* @funcs: callbacks for the new plane
491-
* @formats: array of supported formats (DRM_FORMAT\_\*)
492-
* @format_count: number of elements in @formats
493-
* @is_primary: plane type (primary vs overlay)
494-
*
495-
* Legacy API to initialize a DRM plane.
496-
*
497-
* New drivers should call drm_universal_plane_init() instead.
498-
*
499-
* Returns:
500-
* Zero on success, error code on failure.
501-
*/
502-
int drm_plane_init(struct drm_device *dev, struct drm_plane *plane,
503-
uint32_t possible_crtcs,
504-
const struct drm_plane_funcs *funcs,
505-
const uint32_t *formats, unsigned int format_count,
506-
bool is_primary)
507-
{
508-
enum drm_plane_type type;
509-
510-
type = is_primary ? DRM_PLANE_TYPE_PRIMARY : DRM_PLANE_TYPE_OVERLAY;
511-
return drm_universal_plane_init(dev, plane, possible_crtcs, funcs,
512-
formats, format_count,
513-
NULL, type, NULL);
514-
}
515-
EXPORT_SYMBOL(drm_plane_init);
516-
517485
/**
518486
* drm_plane_cleanup - Clean up the core plane usage
519487
* @plane: plane to cleanup

drivers/gpu/drm/nouveau/dispnv04/overlay.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,10 @@ nv10_overlay_init(struct drm_device *device)
296296
break;
297297
}
298298

299-
ret = drm_plane_init(device, &plane->base, 3 /* both crtc's */,
300-
&nv10_plane_funcs,
301-
formats, num_formats, false);
299+
ret = drm_universal_plane_init(device, &plane->base, 3 /* both crtc's */,
300+
&nv10_plane_funcs,
301+
formats, num_formats, NULL,
302+
DRM_PLANE_TYPE_OVERLAY, NULL);
302303
if (ret)
303304
goto err;
304305

@@ -475,9 +476,9 @@ nv04_overlay_init(struct drm_device *device)
475476
if (!plane)
476477
return;
477478

478-
ret = drm_plane_init(device, &plane->base, 1 /* single crtc */,
479-
&nv04_plane_funcs,
480-
formats, 2, false);
479+
ret = drm_universal_plane_init(device, &plane->base, 1 /* single crtc */,
480+
&nv04_plane_funcs, formats, 2, NULL,
481+
DRM_PLANE_TYPE_OVERLAY, NULL);
481482
if (ret)
482483
goto err;
483484

drivers/gpu/drm/shmobile/shmob_drm_plane.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,10 @@ int shmob_drm_plane_create(struct shmob_drm_device *sdev, unsigned int index)
252252
splane->index = index;
253253
splane->alpha = 255;
254254

255-
ret = drm_plane_init(sdev->ddev, &splane->plane, 1,
256-
&shmob_drm_plane_funcs, formats,
257-
ARRAY_SIZE(formats), false);
255+
ret = drm_universal_plane_init(sdev->ddev, &splane->plane, 1,
256+
&shmob_drm_plane_funcs,
257+
formats, ARRAY_SIZE(formats), NULL,
258+
DRM_PLANE_TYPE_OVERLAY, NULL);
258259

259260
return ret;
260261
}

drivers/gpu/drm/tilcdc/tilcdc_plane.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,10 @@ int tilcdc_plane_init(struct drm_device *dev,
105105
struct tilcdc_drm_private *priv = dev->dev_private;
106106
int ret;
107107

108-
ret = drm_plane_init(dev, plane, 1,
109-
&tilcdc_plane_funcs,
110-
priv->pixelformats,
111-
priv->num_pixelformats,
112-
true);
108+
ret = drm_universal_plane_init(dev, plane, 1, &tilcdc_plane_funcs,
109+
priv->pixelformats,
110+
priv->num_pixelformats,
111+
NULL, DRM_PLANE_TYPE_PRIMARY, NULL);
113112
if (ret) {
114113
dev_err(dev->dev, "Failed to initialize plane: %d\n", ret);
115114
return ret;

include/drm/drm_plane.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ struct drm_plane {
631631
unsigned int format_count;
632632
/**
633633
* @format_default: driver hasn't supplied supported formats for the
634-
* plane. Used by the drm_plane_init compatibility wrapper only.
634+
* plane. Used by the non-atomic driver compatibility wrapper only.
635635
*/
636636
bool format_default;
637637

@@ -762,12 +762,6 @@ int drm_universal_plane_init(struct drm_device *dev,
762762
const uint64_t *format_modifiers,
763763
enum drm_plane_type type,
764764
const char *name, ...);
765-
int drm_plane_init(struct drm_device *dev,
766-
struct drm_plane *plane,
767-
uint32_t possible_crtcs,
768-
const struct drm_plane_funcs *funcs,
769-
const uint32_t *formats, unsigned int format_count,
770-
bool is_primary);
771765
void drm_plane_cleanup(struct drm_plane *plane);
772766

773767
__printf(10, 11)

0 commit comments

Comments
 (0)