Skip to contentSkip to conversation

drm/tegra: hub: Use state directly

PATCH In review Stefan Schake 2 participants 3 messages Apr 18, 2018 – May 4, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/tegra: hub: Use state directly

Using drm_atomic_get_private_obj_state after state has been swapped will return old state.

Fixes 0281c4149021 ("drm/tegra: hub: Use private object for global state")
---
 drivers/gpu/drm/tegra/hub.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/tegra/hub.c +2 -3
index 9a3f23d4780f..bdd2cdd0745c 100644
@@ -683,12 +683,11 @@ void tegra_display_hub_atomic_commit(struct drm_device *drm,
 {
 	struct tegra_drm *tegra = drm->dev_private;
 	struct tegra_display_hub *hub = tegra->hub;
-	struct tegra_display_hub_state *hub_state;
+	struct tegra_display_hub_state *hub_state =
+		to_tegra_display_hub_state(hub->base.state);
 	struct device *dev = hub->client.dev;
 	int err;
 
-	hub_state = tegra_display_hub_get_state(hub, state);
-
 	if (hub_state->clk) {
 		err = clk_set_rate(hub_state->clk, hub_state->rate);
 		if (err < 0)
Signature · 6 lines
2.14.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 29 lines · Stefan Schake

Using drm_atomic_get_private_obj_state after state has been swapped will return old state.

Fixes 0281c4149021 ("drm/tegra: hub: Use private object for global state")
---
 drivers/gpu/drm/tegra/hub.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/tegra/hub.c +2 -4
index 9a3f23d4780f..bdd2cdd0745c 100644
@@ -683,12 +683,11 @@ void tegra_display_hub_atomic_commit(struct drm_device *drm,
 {
        struct tegra_drm *tegra = drm->dev_private;
        struct tegra_display_hub *hub = tegra->hub;
-       struct tegra_display_hub_state *hub_state;
+       struct tegra_display_hub_state *hub_state =
+               to_tegra_display_hub_state(hub->base.state);
        struct device *dev = hub->client.dev;
        int err;
 
-       hub_state = tegra_display_hub_get_state(hub, state);
-
        if (hub_state->clk) {
                err = clk_set_rate(hub_state->clk, hub_state->rate);
                if (err < 0)
--
Quoted 2 lines

2.14.1

Ping. I don't really have Tegra hardware to begin with but this is one of the few examples of DRM private driver state so I figured I'd send a quick fixup before anyone else tries to copy it.

Thanks,
Stefan
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
In reply to Stefan Schake
Quoted 8 lines · Stefan Schake

Using drm_atomic_get_private_obj_state after state has been swapped will return old state.

Fixes 0281c4149021 ("drm/tegra: hub: Use private object for global state")
---
 drivers/gpu/drm/tegra/hub.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

I've had an almost identical patch in my local tree but never got around to sending it out for review, sorry. I've applied your patch but made a tiny change to compress the diff a little (kept the assignment separate from the variable declaration as it used to be).

Thanks,
Thierry