Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/rcar-du: Convert drm_atomic_helper_suspend/resume()

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

remove suspend_state field from the rcar_du_device
structure as it is no more required.

With this conversion, also drm_fbdev_cma_set_suspend_unlocked()
will left with no consumer. So this function can be removed.

Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20180918163903.GA11172@jordon-HP-15-Notebook-PC

authored by

Souptick Joarder and committed by
Daniel Vetter
8dc830e4 43cf1fc0

+2 -40
-18
drivers/gpu/drm/drm_fb_cma_helper.c
··· 221 221 drm_fb_helper_hotplug_event(&fbdev_cma->fb_helper); 222 222 } 223 223 EXPORT_SYMBOL_GPL(drm_fbdev_cma_hotplug_event); 224 - 225 - /** 226 - * drm_fbdev_cma_set_suspend_unlocked - wrapper around 227 - * drm_fb_helper_set_suspend_unlocked 228 - * @fbdev_cma: The drm_fbdev_cma struct, may be NULL 229 - * @state: desired state, zero to resume, non-zero to suspend 230 - * 231 - * Calls drm_fb_helper_set_suspend, which is a wrapper around 232 - * fb_set_suspend implemented by fbdev core. 233 - */ 234 - void drm_fbdev_cma_set_suspend_unlocked(struct drm_fbdev_cma *fbdev_cma, 235 - bool state) 236 - { 237 - if (fbdev_cma) 238 - drm_fb_helper_set_suspend_unlocked(&fbdev_cma->fb_helper, 239 - state); 240 - } 241 - EXPORT_SYMBOL(drm_fbdev_cma_set_suspend_unlocked);
+2 -19
drivers/gpu/drm/rcar-du/rcar_du_drv.c
··· 404 404 static int rcar_du_pm_suspend(struct device *dev) 405 405 { 406 406 struct rcar_du_device *rcdu = dev_get_drvdata(dev); 407 - struct drm_atomic_state *state; 408 407 409 - drm_kms_helper_poll_disable(rcdu->ddev); 410 - drm_fbdev_cma_set_suspend_unlocked(rcdu->fbdev, true); 411 - 412 - state = drm_atomic_helper_suspend(rcdu->ddev); 413 - if (IS_ERR(state)) { 414 - drm_fbdev_cma_set_suspend_unlocked(rcdu->fbdev, false); 415 - drm_kms_helper_poll_enable(rcdu->ddev); 416 - return PTR_ERR(state); 417 - } 418 - 419 - rcdu->suspend_state = state; 420 - 421 - return 0; 408 + return drm_mode_config_helper_suspend(rcdu->ddev); 422 409 } 423 410 424 411 static int rcar_du_pm_resume(struct device *dev) 425 412 { 426 413 struct rcar_du_device *rcdu = dev_get_drvdata(dev); 427 414 428 - drm_atomic_helper_resume(rcdu->ddev, rcdu->suspend_state); 429 - drm_fbdev_cma_set_suspend_unlocked(rcdu->fbdev, false); 430 - drm_kms_helper_poll_enable(rcdu->ddev); 431 - 432 - return 0; 415 + return drm_mode_config_helper_resume(rcdu->ddev); 433 416 } 434 417 #endif 435 418
-1
drivers/gpu/drm/rcar-du/rcar_du_drv.h
··· 79 79 80 80 struct drm_device *ddev; 81 81 struct drm_fbdev_cma *fbdev; 82 - struct drm_atomic_state *suspend_state; 83 82 84 83 struct rcar_du_crtc crtcs[RCAR_DU_MAX_CRTCS]; 85 84 unsigned int num_crtcs;
-2
include/drm/drm_fb_cma_helper.h
··· 26 26 27 27 void drm_fbdev_cma_restore_mode(struct drm_fbdev_cma *fbdev_cma); 28 28 void drm_fbdev_cma_hotplug_event(struct drm_fbdev_cma *fbdev_cma); 29 - void drm_fbdev_cma_set_suspend_unlocked(struct drm_fbdev_cma *fbdev_cma, 30 - bool state); 31 29 32 30 struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb, 33 31 unsigned int plane);