dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Inki Dae <inki.dae@samsung.com>
To: Andrzej Hajda <a.hajda@samsung.com>
Cc: linux-samsung-soc@vger.kernel.org,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	dri-devel@lists.freedesktop.org,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Subject: Re: [PATCH] drm/exynos: simplify sleep PM ops
Date: Wed, 02 Dec 2015 11:03:20 +0900	[thread overview]
Message-ID: <565E5168.3060803@samsung.com> (raw)
In-Reply-To: <1448634765-19480-1-git-send-email-a.hajda@samsung.com>

Hi Andrzej,

2015년 11월 27일 23:32에 Andrzej Hajda 이(가) 쓴 글:
> PM ops in exynos_drm_drv were split into two separate function as they were
> used also by drm device. Since PM ops have been removed from drm device, the
> functions can be merged together.
> 
> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
> ---
> Hi Inki,
> 
> This is the patch I have promised during our discussion about
> PM callbcks in components.

Thanks for your patch. I will check it.

Thanks,
Inki Dae

> 
> Regards
> Andrzej
> 
>  drivers/gpu/drm/exynos/exynos_drm_drv.c | 76 +++++++++++++--------------------
>  1 file changed, 30 insertions(+), 46 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> index 2c6019d..9756797a 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> @@ -304,45 +304,6 @@ int exynos_atomic_commit(struct drm_device *dev, struct drm_atomic_state *state,
>  	return 0;
>  }
>  
> -#ifdef CONFIG_PM_SLEEP
> -static int exynos_drm_suspend(struct drm_device *dev, pm_message_t state)
> -{
> -	struct drm_connector *connector;
> -
> -	drm_modeset_lock_all(dev);
> -	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
> -		int old_dpms = connector->dpms;
> -
> -		if (connector->funcs->dpms)
> -			connector->funcs->dpms(connector, DRM_MODE_DPMS_OFF);
> -
> -		/* Set the old mode back to the connector for resume */
> -		connector->dpms = old_dpms;
> -	}
> -	drm_modeset_unlock_all(dev);
> -
> -	return 0;
> -}
> -
> -static int exynos_drm_resume(struct drm_device *dev)
> -{
> -	struct drm_connector *connector;
> -
> -	drm_modeset_lock_all(dev);
> -	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
> -		if (connector->funcs->dpms) {
> -			int dpms = connector->dpms;
> -
> -			connector->dpms = DRM_MODE_DPMS_OFF;
> -			connector->funcs->dpms(connector, dpms);
> -		}
> -	}
> -	drm_modeset_unlock_all(dev);
> -
> -	return 0;
> -}
> -#endif
> -
>  static int exynos_drm_open(struct drm_device *dev, struct drm_file *file)
>  {
>  	struct drm_exynos_file_private *file_priv;
> @@ -476,31 +437,54 @@ static struct drm_driver exynos_drm_driver = {
>  };
>  
>  #ifdef CONFIG_PM_SLEEP
> -static int exynos_drm_sys_suspend(struct device *dev)
> +static int exynos_drm_suspend(struct device *dev)
>  {
>  	struct drm_device *drm_dev = dev_get_drvdata(dev);
> -	pm_message_t message;
> +	struct drm_connector *connector;
>  
>  	if (pm_runtime_suspended(dev) || !drm_dev)
>  		return 0;
>  
> -	message.event = PM_EVENT_SUSPEND;
> -	return exynos_drm_suspend(drm_dev, message);
> +	drm_modeset_lock_all(drm_dev);
> +	drm_for_each_connector(connector, drm_dev) {
> +		int old_dpms = connector->dpms;
> +
> +		if (connector->funcs->dpms)
> +			connector->funcs->dpms(connector, DRM_MODE_DPMS_OFF);
> +
> +		/* Set the old mode back to the connector for resume */
> +		connector->dpms = old_dpms;
> +	}
> +	drm_modeset_unlock_all(drm_dev);
> +
> +	return 0;
>  }
>  
> -static int exynos_drm_sys_resume(struct device *dev)
> +static int exynos_drm_resume(struct device *dev)
>  {
>  	struct drm_device *drm_dev = dev_get_drvdata(dev);
> +	struct drm_connector *connector;
>  
>  	if (pm_runtime_suspended(dev) || !drm_dev)
>  		return 0;
>  
> -	return exynos_drm_resume(drm_dev);
> +	drm_modeset_lock_all(drm_dev);
> +	drm_for_each_connector(connector, drm_dev) {
> +		if (connector->funcs->dpms) {
> +			int dpms = connector->dpms;
> +
> +			connector->dpms = DRM_MODE_DPMS_OFF;
> +			connector->funcs->dpms(connector, dpms);
> +		}
> +	}
> +	drm_modeset_unlock_all(drm_dev);
> +
> +	return 0;
>  }
>  #endif
>  
>  static const struct dev_pm_ops exynos_drm_pm_ops = {
> -	SET_SYSTEM_SLEEP_PM_OPS(exynos_drm_sys_suspend, exynos_drm_sys_resume)
> +	SET_SYSTEM_SLEEP_PM_OPS(exynos_drm_suspend, exynos_drm_resume)
>  };
>  
>  /* forward declaration */
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2015-12-02  2:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-27 14:32 [PATCH] drm/exynos: simplify sleep PM ops Andrzej Hajda
2015-12-02  2:03 ` Inki Dae [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=565E5168.3060803@samsung.com \
    --to=inki.dae@samsung.com \
    --cc=a.hajda@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox