lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFqt6zZ86CMdrGBHAob3VN0_Yc+5zdyjpCchroMCrB2J8=D9mg@mail.gmail.com>
Date:   Tue, 21 Aug 2018 15:20:21 +0530
From:   Souptick Joarder <jrdr.linux@...il.com>
To:     Deepak Singh Rawat <drawat@...are.com>
Cc:     "ajitn.linux@...il.com" <ajitn.linux@...il.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
        linux-graphics-maintainer <linux-graphics-maintainer@...are.com>,
        Sinclair Yeh <syeh@...are.com>,
        Thomas Hellstrom <thellstrom@...are.com>,
        "airlied@...ux.ie" <airlied@...ux.ie>,
        "daniel@...ll.ch" <daniel@...ll.ch>
Subject: Re: [Linux-graphics-maintainer] [PATCH] drm/vmwgfx: Convert drm_atomic_helper_suspend/resume()

On Tue, Aug 21, 2018 at 3:04 AM, Deepak Singh Rawat <drawat@...are.com> wrote:
> Hi, thanks for the patch. Perhaps can get rid of vmw_kms_resume
> and vmw_kms_suspend, otherwise looks good to me.

Ok, will remove in v2.

>
>>
>> convert drm_atomic_helper_suspend/resume() to use
>> drm_mode_config_helper_suspend/resume().
>>
>> suspend_state can be removed from vmw_private as
>> it will not be used anymore.
>>
>> Signed-off-by: Ajit Negi <ajitn.linux@...il.com>
>> Signed-off-by: Souptick Joarder <jrdr.linux@...il.com>
>> ---
>>  drivers/gpu/drm/vmwgfx/vmwgfx_drv.c |  6 +++---
>>  drivers/gpu/drm/vmwgfx/vmwgfx_drv.h |  1 -
>>  drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 25 ++-----------------------
>>  3 files changed, 5 insertions(+), 27 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
>> b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
>> index bb6dbbe..a317cda 100644
>> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
>> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
>> @@ -1521,7 +1521,7 @@ static int vmw_pm_freeze(struct device *kdev)
>>               WARN_ON(vmw_request_device_late(dev_priv));
>>               dev_priv->suspend_locked = false;
>>               ttm_suspend_unlock(&dev_priv->reservation_sem);
>> -             if (dev_priv->suspend_state)
>> +             if (dev->mode_config.suspend_state)
>>                       vmw_kms_resume(dev);
>>               if (dev_priv->enable_fb)
>>                       vmw_fb_on(dev_priv);
>> @@ -1558,8 +1558,8 @@ static int vmw_pm_restore(struct device *kdev)
>>       vmw_fence_fifo_up(dev_priv->fman);
>>       dev_priv->suspend_locked = false;
>>       ttm_suspend_unlock(&dev_priv->reservation_sem);
>> -     if (dev_priv->suspend_state)
>> -             vmw_kms_resume(dev_priv->dev);
>> +     if (dev->mode_config.suspend_state)
>> +             vmw_kms_resume(dev);
>>
>>       if (dev_priv->enable_fb)
>>               vmw_fb_on(dev_priv);
>> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
>> b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
>> index 1abe217..b8e200b 100644
>> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
>> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
>> @@ -438,7 +438,6 @@ struct vmw_private {
>>       struct vmw_framebuffer *implicit_fb;
>>       struct mutex global_kms_state_mutex;
>>       spinlock_t cursor_lock;
>> -     struct drm_atomic_state *suspend_state;
>>
>>       /*
>>        * Context and surface management.
>> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
>> b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
>> index 23beff5..2d011a1 100644
>> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
>> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
>> @@ -3028,19 +3028,7 @@ int vmw_kms_set_config(struct drm_mode_set
>> *set,
>>   */
>>  int vmw_kms_suspend(struct drm_device *dev)
>>  {
>> -     struct vmw_private *dev_priv = vmw_priv(dev);
>> -
>> -     dev_priv->suspend_state = drm_atomic_helper_suspend(dev);
>> -     if (IS_ERR(dev_priv->suspend_state)) {
>> -             int ret = PTR_ERR(dev_priv->suspend_state);
>> -
>> -             DRM_ERROR("Failed kms suspend: %d\n", ret);
>> -             dev_priv->suspend_state = NULL;
>> -
>> -             return ret;
>> -     }
>> -
>> -     return 0;
>> +     return drm_mode_config_helper_suspend(dev);
>>  }
>>
>>
>> @@ -3055,16 +3043,7 @@ int vmw_kms_suspend(struct drm_device *dev)
>>   */
>>  int vmw_kms_resume(struct drm_device *dev)
>>  {
>> -     struct vmw_private *dev_priv = vmw_priv(dev);
>> -     int ret;
>> -
>> -     if (WARN_ON(!dev_priv->suspend_state))
>> -             return 0;
>> -
>> -     ret = drm_atomic_helper_resume(dev, dev_priv->suspend_state);
>> -     dev_priv->suspend_state = NULL;
>> -
>> -     return ret;
>> +     return drm_mode_config_helper_resume(dev);
>>  }
>>
>>  /**
>> --
>> 1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ