Commit 9ff4fdf4 authored by Thierry Reding's avatar Thierry Reding
Browse files

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: default avatarAaron Kling <webgeek1234@gmail.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Cc: stable@vger.kernel.org
Fixes: 47307954 ("drm/tegra: dc: Add Tegra186 support")
Signed-off-by: default avatarAaron Kling <webgeek1234@gmail.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20250421-tegra-drm-primary-v2-1-7f740c4c2121@gmail.com
parent a6c0a91c
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -1321,10 +1321,16 @@ static struct drm_plane *tegra_dc_add_shared_planes(struct drm_device *drm,
		if (wgrp->dc == dc->pipe) {
			for (j = 0; j < wgrp->num_windows; j++) {
				unsigned int index = wgrp->windows[j];
				enum drm_plane_type type;

				if (primary)
					type = DRM_PLANE_TYPE_OVERLAY;
				else
					type = DRM_PLANE_TYPE_PRIMARY;

				plane = tegra_shared_plane_create(drm, dc,
								  wgrp->index,
								  index);
								  index, type);
				if (IS_ERR(plane))
					return plane;

@@ -1332,13 +1338,11 @@ static struct drm_plane *tegra_dc_add_shared_planes(struct drm_device *drm,
				 * Choose the first shared plane owned by this
				 * head as the primary plane.
				 */
				if (!primary) {
					plane->type = DRM_PLANE_TYPE_PRIMARY;
				if (!primary)
					primary = plane;
			}
		}
	}
	}

	return primary;
}
+2 −2
Original line number Diff line number Diff line
@@ -755,9 +755,9 @@ static const struct drm_plane_helper_funcs tegra_shared_plane_helper_funcs = {
struct drm_plane *tegra_shared_plane_create(struct drm_device *drm,
					    struct tegra_dc *dc,
					    unsigned int wgrp,
					    unsigned int index)
					    unsigned int index,
					    enum drm_plane_type type)
{
	enum drm_plane_type type = DRM_PLANE_TYPE_OVERLAY;
	struct tegra_drm *tegra = drm->dev_private;
	struct tegra_display_hub *hub = tegra->hub;
	struct tegra_shared_plane *plane;
+2 −1
Original line number Diff line number Diff line
@@ -80,7 +80,8 @@ void tegra_display_hub_cleanup(struct tegra_display_hub *hub);
struct drm_plane *tegra_shared_plane_create(struct drm_device *drm,
					    struct tegra_dc *dc,
					    unsigned int wgrp,
					    unsigned int index);
					    unsigned int index,
					    enum drm_plane_type type);

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