Skip to content

Commit 3937e32

Browse files
6by9popcornmix
authored andcommitted
drm: Increase plane_mask to 64bit.
The limit of 32 planes per DRM device is dictated by the use of planes_mask returning a u32. Change to a u64 such that 64 planes can be supported by a device. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent c7ef1d3 commit 3937e32

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

drivers/gpu/drm/drm_atomic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ static void drm_atomic_crtc_print_state(struct drm_printer *p,
449449
drm_printf(p, "\tactive_changed=%d\n", state->active_changed);
450450
drm_printf(p, "\tconnectors_changed=%d\n", state->connectors_changed);
451451
drm_printf(p, "\tcolor_mgmt_changed=%d\n", state->color_mgmt_changed);
452-
drm_printf(p, "\tplane_mask=%x\n", state->plane_mask);
452+
drm_printf(p, "\tplane_mask=%llx\n", state->plane_mask);
453453
drm_printf(p, "\tconnector_mask=%x\n", state->connector_mask);
454454
drm_printf(p, "\tencoder_mask=%x\n", state->encoder_mask);
455455
drm_printf(p, "\tmode: " DRM_MODE_FMT "\n", DRM_MODE_ARG(&state->mode));

drivers/gpu/drm/drm_framebuffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ static int atomic_remove_fb(struct drm_framebuffer *fb)
10051005
struct drm_connector *conn __maybe_unused;
10061006
struct drm_connector_state *conn_state;
10071007
int i, ret;
1008-
unsigned plane_mask;
1008+
u64 plane_mask;
10091009
bool disable_crtcs = false;
10101010

10111011
retry_disable:

drivers/gpu/drm/drm_mode_config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ void drm_mode_config_validate(struct drm_device *dev)
660660
struct drm_encoder *encoder;
661661
struct drm_crtc *crtc;
662662
struct drm_plane *plane;
663-
u32 primary_with_crtc = 0, cursor_with_crtc = 0;
663+
u64 primary_with_crtc = 0, cursor_with_crtc = 0;
664664
unsigned int num_primary = 0;
665665

666666
if (!drm_core_check_feature(dev, DRIVER_MODESET))

drivers/gpu/drm/drm_plane.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ static int __drm_universal_plane_init(struct drm_device *dev,
376376
int ret;
377377

378378
/* plane index is used with 32bit bitmasks */
379-
if (WARN_ON(config->num_total_plane >= 32))
379+
if (WARN_ON(config->num_total_plane >= 64))
380380
return -EINVAL;
381381

382382
/*

drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ static int ipu_crtc_atomic_check(struct drm_crtc *crtc,
230230
{
231231
struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state,
232232
crtc);
233-
u32 primary_plane_mask = drm_plane_mask(crtc->primary);
233+
u64 primary_plane_mask = drm_plane_mask(crtc->primary);
234234

235235
if (crtc_state->active && (primary_plane_mask & crtc_state->plane_mask) == 0)
236236
return -EINVAL;

include/drm/drm_crtc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ struct drm_crtc_state {
192192
* @plane_mask: Bitmask of drm_plane_mask(plane) of planes attached to
193193
* this CRTC.
194194
*/
195-
u32 plane_mask;
195+
u64 plane_mask;
196196

197197
/**
198198
* @connector_mask: Bitmask of drm_connector_mask(connector) of

include/drm/drm_plane.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,9 +960,9 @@ static inline unsigned int drm_plane_index(const struct drm_plane *plane)
960960
* drm_plane_mask - find the mask of a registered plane
961961
* @plane: plane to find mask for
962962
*/
963-
static inline u32 drm_plane_mask(const struct drm_plane *plane)
963+
static inline u64 drm_plane_mask(const struct drm_plane *plane)
964964
{
965-
return 1 << drm_plane_index(plane);
965+
return 1ULL << drm_plane_index(plane);
966966
}
967967

968968
struct drm_plane * drm_plane_from_index(struct drm_device *dev, int idx);

0 commit comments

Comments
 (0)