Re: [PATCH 04/15] drm/atomic-helper: remove modeset_lock_all from helper_resume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 3, 2017 at 4:32 AM, Daniel Vetter <daniel.vetter@xxxxxxxx> wrote:
> Atomic code rely shouldn't rely on the magic hidden acquire context.

Repeated rely in commit message.  I'm assuming you mean:
"Atomic code shouldn't rely on the magic hidden acquire context."

>
> v2: Remove unused config local var (gcc).
>
> Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxxx>
> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 8999da789bb0..978dd8f49476 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -2623,14 +2623,22 @@ EXPORT_SYMBOL(drm_atomic_helper_commit_duplicated_state);
>  int drm_atomic_helper_resume(struct drm_device *dev,
>                              struct drm_atomic_state *state)
>  {
> -       struct drm_mode_config *config = &dev->mode_config;
> +       struct drm_modeset_acquire_ctx ctx;
>         int err;
>
>         drm_mode_config_reset(dev);
>
> -       drm_modeset_lock_all(dev);
> -       err = drm_atomic_helper_commit_duplicated_state(state, config->acquire_ctx);
> -       drm_modeset_unlock_all(dev);
> +       drm_modeset_acquire_init(&ctx, 0);
> +       while (1) {
> +               err = drm_atomic_helper_commit_duplicated_state(state, &ctx);
> +               if (err != -EDEADLK)
> +                       break;
> +
> +               drm_modeset_backoff(&ctx);
> +       }
> +
> +       drm_modeset_drop_locks(&ctx);
> +       drm_modeset_acquire_fini(&ctx);
>
>         return err;
>  }
> --
> 2.11.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux