linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/tegra: hub: Use state directly
@ 2018-04-18 10:40 Stefan Schake
  2018-04-30 11:56 ` Stefan Schake
  2018-05-04  9:38 ` Thierry Reding
  0 siblings, 2 replies; 3+ messages in thread
From: Stefan Schake @ 2018-04-18 10:40 UTC (permalink / raw)
  To: thierry.reding
  Cc: airlied, jonathanh, dri-devel, linux-tegra, linux-kernel, 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")
Signed-off-by: Stefan Schake <stschake@gmail.com>
---
 drivers/gpu/drm/tegra/hub.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/tegra/hub.c b/drivers/gpu/drm/tegra/hub.c
index 9a3f23d4780f..bdd2cdd0745c 100644
--- a/drivers/gpu/drm/tegra/hub.c
+++ b/drivers/gpu/drm/tegra/hub.c
@@ -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)
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/tegra: hub: Use state directly
  2018-04-18 10:40 [PATCH] drm/tegra: hub: Use state directly Stefan Schake
@ 2018-04-30 11:56 ` Stefan Schake
  2018-05-04  9:38 ` Thierry Reding
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Schake @ 2018-04-30 11:56 UTC (permalink / raw)
  To: Thierry Reding
  Cc: David Airlie, jonathanh, dri-devel, linux-tegra, linux-kernel,
	Stefan Schake

On Wed, Apr 18, 2018 at 12:40 PM, Stefan Schake <stschake@gmail.com> wrote:
> 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")
> Signed-off-by: Stefan Schake <stschake@gmail.com>
> ---
>  drivers/gpu/drm/tegra/hub.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/tegra/hub.c b/drivers/gpu/drm/tegra/hub.c
> index 9a3f23d4780f..bdd2cdd0745c 100644
> --- a/drivers/gpu/drm/tegra/hub.c
> +++ b/drivers/gpu/drm/tegra/hub.c
> @@ -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)
> --
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/tegra: hub: Use state directly
  2018-04-18 10:40 [PATCH] drm/tegra: hub: Use state directly Stefan Schake
  2018-04-30 11:56 ` Stefan Schake
@ 2018-05-04  9:38 ` Thierry Reding
  1 sibling, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2018-05-04  9:38 UTC (permalink / raw)
  To: Stefan Schake; +Cc: airlied, jonathanh, dri-devel, linux-tegra, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 690 bytes --]

On Wed, Apr 18, 2018 at 03:40:19AM -0700, Stefan Schake wrote:
> 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")
> Signed-off-by: Stefan Schake <stschake@gmail.com>
> ---
>  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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-04  9:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-18 10:40 [PATCH] drm/tegra: hub: Use state directly Stefan Schake
2018-04-30 11:56 ` Stefan Schake
2018-05-04  9:38 ` Thierry Reding

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).