From: Patrik Jakobsson Date: Fri, 12 Jul 2013 13:38:52 +0000 (+0200) Subject: drm/gma500: Add generic set_config() function X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=924cb5ffd81d66cc6461de955f7cb144cb3b7b6d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm/gma500: Add generic set_config() function Signed-off-by: Patrik Jakobsson --- diff --git a/drivers/gpu/drm/gma500/gma_display.c b/drivers/gpu/drm/gma500/gma_display.c index cca40c0b64e4..2a3e9254e651 100644 --- a/drivers/gpu/drm/gma500/gma_display.c +++ b/drivers/gpu/drm/gma500/gma_display.c @@ -519,6 +519,22 @@ void gma_crtc_destroy(struct drm_crtc *crtc) kfree(psb_intel_crtc); } +int gma_crtc_set_config(struct drm_mode_set *set) +{ + struct drm_device *dev = set->crtc->dev; + struct drm_psb_private *dev_priv = dev->dev_private; + int ret; + + if (!dev_priv->rpm_enabled) + return drm_crtc_helper_set_config(set); + + pm_runtime_forbid(&dev->pdev->dev); + ret = drm_crtc_helper_set_config(set); + pm_runtime_allow(&dev->pdev->dev); + + return ret; +} + /** * Save HW states of given crtc */ diff --git a/drivers/gpu/drm/gma500/gma_display.h b/drivers/gpu/drm/gma500/gma_display.h index 8847de069516..1044c165c714 100644 --- a/drivers/gpu/drm/gma500/gma_display.h +++ b/drivers/gpu/drm/gma500/gma_display.h @@ -22,6 +22,8 @@ #ifndef _GMA_DISPLAY_H_ #define _GMA_DISPLAY_H_ +#include + struct gma_clock_t { /* given values */ int n; @@ -80,6 +82,7 @@ extern void gma_crtc_prepare(struct drm_crtc *crtc); extern void gma_crtc_commit(struct drm_crtc *crtc); extern void gma_crtc_disable(struct drm_crtc *crtc); extern void gma_crtc_destroy(struct drm_crtc *crtc); +extern int gma_crtc_set_config(struct drm_mode_set *set); extern void gma_crtc_save(struct drm_crtc *crtc); extern void gma_crtc_restore(struct drm_crtc *crtc);