Skip to content

Commit 9ff4fdf

Browse files
committed
drm/tegra: Assign plane type before registration
Changes to a plane's type after it has been registered aren't propagated to userspace automatically. This could possibly be achieved by updating the property, but since we can already determine which type this should be before the registration, passing in the right type from the start is a much better solution. Suggested-by: Aaron Kling <[email protected]> Signed-off-by: Thierry Reding <[email protected]> Cc: [email protected] Fixes: 4730795 ("drm/tegra: dc: Add Tegra186 support") Signed-off-by: Aaron Kling <[email protected]> Signed-off-by: Thierry Reding <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent a6c0a91 commit 9ff4fdf

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

drivers/gpu/drm/tegra/dc.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,21 +1321,25 @@ static struct drm_plane *tegra_dc_add_shared_planes(struct drm_device *drm,
13211321
if (wgrp->dc == dc->pipe) {
13221322
for (j = 0; j < wgrp->num_windows; j++) {
13231323
unsigned int index = wgrp->windows[j];
1324+
enum drm_plane_type type;
1325+
1326+
if (primary)
1327+
type = DRM_PLANE_TYPE_OVERLAY;
1328+
else
1329+
type = DRM_PLANE_TYPE_PRIMARY;
13241330

13251331
plane = tegra_shared_plane_create(drm, dc,
13261332
wgrp->index,
1327-
index);
1333+
index, type);
13281334
if (IS_ERR(plane))
13291335
return plane;
13301336

13311337
/*
13321338
* Choose the first shared plane owned by this
13331339
* head as the primary plane.
13341340
*/
1335-
if (!primary) {
1336-
plane->type = DRM_PLANE_TYPE_PRIMARY;
1341+
if (!primary)
13371342
primary = plane;
1338-
}
13391343
}
13401344
}
13411345
}

drivers/gpu/drm/tegra/hub.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,9 +755,9 @@ static const struct drm_plane_helper_funcs tegra_shared_plane_helper_funcs = {
755755
struct drm_plane *tegra_shared_plane_create(struct drm_device *drm,
756756
struct tegra_dc *dc,
757757
unsigned int wgrp,
758-
unsigned int index)
758+
unsigned int index,
759+
enum drm_plane_type type)
759760
{
760-
enum drm_plane_type type = DRM_PLANE_TYPE_OVERLAY;
761761
struct tegra_drm *tegra = drm->dev_private;
762762
struct tegra_display_hub *hub = tegra->hub;
763763
struct tegra_shared_plane *plane;

drivers/gpu/drm/tegra/hub.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ void tegra_display_hub_cleanup(struct tegra_display_hub *hub);
8080
struct drm_plane *tegra_shared_plane_create(struct drm_device *drm,
8181
struct tegra_dc *dc,
8282
unsigned int wgrp,
83-
unsigned int index);
83+
unsigned int index,
84+
enum drm_plane_type type);
8485

8586
int tegra_display_hub_atomic_check(struct drm_device *drm,
8687
struct drm_atomic_state *state);

0 commit comments

Comments
 (0)