All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/imx: Convert drm_atomic_helper_suspend/resume()
@ 2018-07-31 19:28 Souptick Joarder
  2018-08-02  9:27   ` Philipp Zabel
  0 siblings, 1 reply; 3+ messages in thread
From: Souptick Joarder @ 2018-07-31 19:28 UTC (permalink / raw)
  To: p.zabel, airlied, ajitn.linux, leonard.crestez
  Cc: dri-devel, linux-kernel, daniel

convert drm_atomic_helper_suspend/resume() to use
drm_mode_config_helper_suspend/resume().

with this conversion, both the members of struct
imx_drm_device pipes and state will be no more
useful and it could be removed forever.

Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Signed-off-by: Ajit Negi <ajitn.linux@gmail.com>
---
v2: Address Philipp's comment. Remove
    struct imx_drm_device.

 drivers/gpu/drm/imx/imx-drm-core.c | 43 ++------------------------------------
 1 file changed, 2 insertions(+), 41 deletions(-)

diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
index 1d053bb..a692d68 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -35,12 +35,6 @@
 
 #define MAX_CRTC	4
 
-struct imx_drm_device {
-	struct drm_device			*drm;
-	unsigned int				pipes;
-	struct drm_atomic_state			*state;
-};
-
 #if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION)
 static int legacyfb_depth = 16;
 module_param(legacyfb_depth, int, 0444);
@@ -219,22 +213,12 @@ static int compare_of(struct device *dev, void *data)
 static int imx_drm_bind(struct device *dev)
 {
 	struct drm_device *drm;
-	struct imx_drm_device *imxdrm;
 	int ret;
 
 	drm = drm_dev_alloc(&imx_drm_driver, dev);
 	if (IS_ERR(drm))
 		return PTR_ERR(drm);
 
-	imxdrm = devm_kzalloc(dev, sizeof(*imxdrm), GFP_KERNEL);
-	if (!imxdrm) {
-		ret = -ENOMEM;
-		goto err_unref;
-	}
-
-	imxdrm->drm = drm;
-	drm->dev_private = imxdrm;
-
 	/*
 	 * enable drm irq mode.
 	 * - with irq_enabled = true, we can use the vblank feature.
@@ -306,7 +290,6 @@ static int imx_drm_bind(struct device *dev)
 	component_unbind_all(drm->dev, drm);
 err_kms:
 	drm_mode_config_cleanup(drm);
-err_unref:
 	drm_dev_unref(drm);
 
 	return ret;
@@ -355,37 +338,15 @@ static int imx_drm_platform_remove(struct platform_device *pdev)
 static int imx_drm_suspend(struct device *dev)
 {
 	struct drm_device *drm_dev = dev_get_drvdata(dev);
-	struct imx_drm_device *imxdrm;
-
-	/* The drm_dev is NULL before .load hook is called */
-	if (drm_dev == NULL)
-		return 0;
-
-	drm_kms_helper_poll_disable(drm_dev);
 
-	imxdrm = drm_dev->dev_private;
-	imxdrm->state = drm_atomic_helper_suspend(drm_dev);
-	if (IS_ERR(imxdrm->state)) {
-		drm_kms_helper_poll_enable(drm_dev);
-		return PTR_ERR(imxdrm->state);
-	}
-
-	return 0;
+	return drm_mode_config_helper_suspend(drm_dev);
 }
 
 static int imx_drm_resume(struct device *dev)
 {
 	struct drm_device *drm_dev = dev_get_drvdata(dev);
-	struct imx_drm_device *imx_drm;
 
-	if (drm_dev == NULL)
-		return 0;
-
-	imx_drm = drm_dev->dev_private;
-	drm_atomic_helper_resume(drm_dev, imx_drm->state);
-	drm_kms_helper_poll_enable(drm_dev);
-
-	return 0;
+	return drm_mode_config_helper_resume(drm_dev);
 }
 #endif
 
-- 
1.9.1


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

* Re: [PATCH v2] drm/imx: Convert drm_atomic_helper_suspend/resume()
  2018-07-31 19:28 [PATCH v2] drm/imx: Convert drm_atomic_helper_suspend/resume() Souptick Joarder
@ 2018-08-02  9:27   ` Philipp Zabel
  0 siblings, 0 replies; 3+ messages in thread
From: Philipp Zabel @ 2018-08-02  9:27 UTC (permalink / raw)
  To: Souptick Joarder, airlied, ajitn.linux, leonard.crestez
  Cc: dri-devel, linux-kernel, daniel

Hi Souptick,

On Wed, 2018-08-01 at 00:58 +0530, Souptick Joarder wrote:
> convert drm_atomic_helper_suspend/resume() to use
> drm_mode_config_helper_suspend/resume().
> 
> with this conversion, both the members of struct
> imx_drm_device pipes and state will be no more
> useful and it could be removed forever.
> 
> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
> Signed-off-by: Ajit Negi <ajitn.linux@gmail.com>

I have rebased this patch onto drm-next and applied it to imx-drm/next.

regards
Philipp

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

* Re: [PATCH v2] drm/imx: Convert drm_atomic_helper_suspend/resume()
@ 2018-08-02  9:27   ` Philipp Zabel
  0 siblings, 0 replies; 3+ messages in thread
From: Philipp Zabel @ 2018-08-02  9:27 UTC (permalink / raw)
  To: Souptick Joarder, airlied, ajitn.linux, leonard.crestez
  Cc: linux-kernel, dri-devel

Hi Souptick,

On Wed, 2018-08-01 at 00:58 +0530, Souptick Joarder wrote:
> convert drm_atomic_helper_suspend/resume() to use
> drm_mode_config_helper_suspend/resume().
> 
> with this conversion, both the members of struct
> imx_drm_device pipes and state will be no more
> useful and it could be removed forever.
> 
> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
> Signed-off-by: Ajit Negi <ajitn.linux@gmail.com>

I have rebased this patch onto drm-next and applied it to imx-drm/next.

regards
Philipp
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2018-08-02  9:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-31 19:28 [PATCH v2] drm/imx: Convert drm_atomic_helper_suspend/resume() Souptick Joarder
2018-08-02  9:27 ` Philipp Zabel
2018-08-02  9:27   ` Philipp Zabel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.