Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <webgeek1234@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Cc: stable@vger.kernel.org
Fixes: 473079549f27 ("drm/tegra: dc: Add Tegra186 support")
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20250421-tegra-drm-primary-v2-1-7f740c4c2121@gmail.com

+12 -7
+8 -4
drivers/gpu/drm/tegra/dc.c
··· 1321 1321 if (wgrp->dc == dc->pipe) { 1322 1322 for (j = 0; j < wgrp->num_windows; j++) { 1323 1323 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; 1324 1330 1325 1331 plane = tegra_shared_plane_create(drm, dc, 1326 1332 wgrp->index, 1327 - index); 1333 + index, type); 1328 1334 if (IS_ERR(plane)) 1329 1335 return plane; 1330 1336 ··· 1338 1332 * Choose the first shared plane owned by this 1339 1333 * head as the primary plane. 1340 1334 */ 1341 - if (!primary) { 1342 - plane->type = DRM_PLANE_TYPE_PRIMARY; 1335 + if (!primary) 1343 1336 primary = plane; 1344 - } 1345 1337 } 1346 1338 } 1347 1339 }
+2 -2
drivers/gpu/drm/tegra/hub.c
··· 755 755 struct drm_plane *tegra_shared_plane_create(struct drm_device *drm, 756 756 struct tegra_dc *dc, 757 757 unsigned int wgrp, 758 - unsigned int index) 758 + unsigned int index, 759 + enum drm_plane_type type) 759 760 { 760 - enum drm_plane_type type = DRM_PLANE_TYPE_OVERLAY; 761 761 struct tegra_drm *tegra = drm->dev_private; 762 762 struct tegra_display_hub *hub = tegra->hub; 763 763 struct tegra_shared_plane *plane;
+2 -1
drivers/gpu/drm/tegra/hub.h
··· 80 80 struct drm_plane *tegra_shared_plane_create(struct drm_device *drm, 81 81 struct tegra_dc *dc, 82 82 unsigned int wgrp, 83 - unsigned int index); 83 + unsigned int index, 84 + enum drm_plane_type type); 84 85 85 86 int tegra_display_hub_atomic_check(struct drm_device *drm, 86 87 struct drm_atomic_state *state);