* [PATCH v2 02/22] drm/tegra: plane: switch to plane reset helper
[not found] <20220221095918.18763-1-maxime@cerno.tech>
@ 2022-02-21 9:58 ` Maxime Ripard
2022-02-21 9:58 ` [PATCH v2 03/22] drm/tegra: hub: Fix zpos initial value mismatch Maxime Ripard
2022-02-21 9:59 ` [PATCH v2 08/22] drm/tegra: plane: Remove redundant zpos initialisation Maxime Ripard
2 siblings, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2022-02-21 9:58 UTC (permalink / raw)
To: Daniel Vetter, David Airlie
Cc: Dave Stevenson, Phil Elwell, Tim Gover, Dom Cobley, dri-devel,
Maarten Lankhorst, Thomas Zimmermann, Maxime Ripard, linux-tegra,
Jonathan Hunter, Thierry Reding
tegra_plane_reset() does the state initialisation by copying a lot of
the code found in the __drm_atomic_helper_plane_reset(). Let's switch to
that helper and reduce the boilerplate.
Cc: linux-tegra@vger.kernel.org
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
drivers/gpu/drm/tegra/plane.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/tegra/plane.c b/drivers/gpu/drm/tegra/plane.c
index 321cb1f13da6..ec0822c86926 100644
--- a/drivers/gpu/drm/tegra/plane.c
+++ b/drivers/gpu/drm/tegra/plane.c
@@ -37,8 +37,7 @@ static void tegra_plane_reset(struct drm_plane *plane)
state = kzalloc(sizeof(*state), GFP_KERNEL);
if (state) {
- plane->state = &state->base;
- plane->state->plane = plane;
+ __drm_atomic_helper_plane_reset(plane, &state->base);
plane->state->zpos = p->index;
plane->state->normalized_zpos = p->index;
--
2.35.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2 03/22] drm/tegra: hub: Fix zpos initial value mismatch
[not found] <20220221095918.18763-1-maxime@cerno.tech>
2022-02-21 9:58 ` [PATCH v2 02/22] drm/tegra: plane: switch to plane reset helper Maxime Ripard
@ 2022-02-21 9:58 ` Maxime Ripard
2022-02-21 9:59 ` [PATCH v2 08/22] drm/tegra: plane: Remove redundant zpos initialisation Maxime Ripard
2 siblings, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2022-02-21 9:58 UTC (permalink / raw)
To: Daniel Vetter, David Airlie
Cc: Dave Stevenson, Phil Elwell, Tim Gover, Dom Cobley, dri-devel,
Maarten Lankhorst, Thomas Zimmermann, Maxime Ripard, linux-tegra,
Jonathan Hunter, Thierry Reding
While the tegra_shared_plane_create() function calls
drm_plane_create_zpos_property() with an initial value of 0,
tegra_plane_reset() will force it to the plane index.
Fix the discrepancy by setting the initial zpos value to the plane index
in the function call.
Cc: linux-tegra@vger.kernel.org
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
drivers/gpu/drm/tegra/hub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/tegra/hub.c b/drivers/gpu/drm/tegra/hub.c
index b910155f80c4..7f68a142d922 100644
--- a/drivers/gpu/drm/tegra/hub.c
+++ b/drivers/gpu/drm/tegra/hub.c
@@ -788,7 +788,7 @@ struct drm_plane *tegra_shared_plane_create(struct drm_device *drm,
}
drm_plane_helper_add(p, &tegra_shared_plane_helper_funcs);
- drm_plane_create_zpos_property(p, 0, 0, 255);
+ drm_plane_create_zpos_property(p, index, 0, 255);
return p;
}
--
2.35.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2 08/22] drm/tegra: plane: Remove redundant zpos initialisation
[not found] <20220221095918.18763-1-maxime@cerno.tech>
2022-02-21 9:58 ` [PATCH v2 02/22] drm/tegra: plane: switch to plane reset helper Maxime Ripard
2022-02-21 9:58 ` [PATCH v2 03/22] drm/tegra: hub: Fix zpos initial value mismatch Maxime Ripard
@ 2022-02-21 9:59 ` Maxime Ripard
2 siblings, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2022-02-21 9:59 UTC (permalink / raw)
To: Daniel Vetter, David Airlie
Cc: Dave Stevenson, Phil Elwell, Tim Gover, Dom Cobley, dri-devel,
Maarten Lankhorst, Thomas Zimmermann, Maxime Ripard, linux-tegra,
Jonathan Hunter, Thierry Reding
The tegra KMS driver will call drm_plane_create_zpos_property() with an
init value of the plane index.
Since the initial value wasn't carried over in the state, the driver had
to set it again in tegra_plane_reset(). However, the helpers have been
adjusted to set it properly at reset, so this is not needed anymore.
Cc: linux-tegra@vger.kernel.org
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
drivers/gpu/drm/tegra/plane.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/gpu/drm/tegra/plane.c b/drivers/gpu/drm/tegra/plane.c
index ec0822c86926..a00913d064d3 100644
--- a/drivers/gpu/drm/tegra/plane.c
+++ b/drivers/gpu/drm/tegra/plane.c
@@ -25,7 +25,6 @@ static void tegra_plane_destroy(struct drm_plane *plane)
static void tegra_plane_reset(struct drm_plane *plane)
{
- struct tegra_plane *p = to_tegra_plane(plane);
struct tegra_plane_state *state;
unsigned int i;
@@ -38,8 +37,6 @@ static void tegra_plane_reset(struct drm_plane *plane)
state = kzalloc(sizeof(*state), GFP_KERNEL);
if (state) {
__drm_atomic_helper_plane_reset(plane, &state->base);
- plane->state->zpos = p->index;
- plane->state->normalized_zpos = p->index;
for (i = 0; i < 3; i++)
state->iova[i] = DMA_MAPPING_ERROR;
--
2.35.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-02-21 10:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20220221095918.18763-1-maxime@cerno.tech>
2022-02-21 9:58 ` [PATCH v2 02/22] drm/tegra: plane: switch to plane reset helper Maxime Ripard
2022-02-21 9:58 ` [PATCH v2 03/22] drm/tegra: hub: Fix zpos initial value mismatch Maxime Ripard
2022-02-21 9:59 ` [PATCH v2 08/22] drm/tegra: plane: Remove redundant zpos initialisation Maxime Ripard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).