drm/exynos: fix display power call issue.
authorInki Dae <inki.dae@samsung.com>
Mon, 24 Sep 2012 11:04:24 +0000 (20:04 +0900)
committerInki Dae <inki.dae@samsung.com>
Thu, 4 Oct 2012 01:06:01 +0000 (10:06 +0900)
Changelog v3:
make exynos_drm_display_power function use exynos_drm_best_encoder
function instead of connector->encoder to get a valid encoder.
connector->encoder could be NULL because with DRM_IOCTL_MODE_RMFB
request, connector->encoder is NULL so fix this issue.

Changelog v2:
remove static prefix so that exynos_drm_best_encoder function
could be called by other modules.

Changelog v1:
this patch fixes the issue that display power callback isn't called.
with DRM_IOCTL_MODE_RMFB request, encoder->connector becomes NULL
so display_ops->power_on() wouldn't be called so this patch makes
exynos_drm_best_encoder function to be used to get a valid encoder
of each connector.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
drivers/gpu/drm/exynos/exynos_drm_connector.c
drivers/gpu/drm/exynos/exynos_drm_connector.h
drivers/gpu/drm/exynos/exynos_drm_encoder.c

index 87cf3783efdc40fa508f22eef38e9b434b197364..da074746967c036e5e1cfa050c3fabdd8d3f6a9f 100644 (file)
@@ -199,8 +199,7 @@ static int exynos_drm_connector_mode_valid(struct drm_connector *connector,
        return ret;
 }
 
-static struct drm_encoder *exynos_drm_best_encoder(
-                                               struct drm_connector *connector)
+struct drm_encoder *exynos_drm_best_encoder(struct drm_connector *connector)
 {
        struct drm_device *dev = connector->dev;
        struct exynos_drm_connector *exynos_connector =
@@ -231,7 +230,7 @@ static struct drm_connector_helper_funcs exynos_connector_helper_funcs = {
 
 void exynos_drm_display_power(struct drm_connector *connector, int mode)
 {
-       struct drm_encoder *encoder = connector->encoder;
+       struct drm_encoder *encoder = exynos_drm_best_encoder(connector);
        struct exynos_drm_connector *exynos_connector;
        struct exynos_drm_manager *manager = exynos_drm_get_manager(encoder);
        struct exynos_drm_display_ops *display_ops = manager->display_ops;
index 40a55c2de4bc6d89fe7cb6e26e9c31ba7883d92d..22f6cc442c3d94e816d9302faa2cef12b25f7fa6 100644 (file)
@@ -31,6 +31,8 @@
 struct drm_connector *exynos_drm_connector_create(struct drm_device *dev,
                                                   struct drm_encoder *encoder);
 
+struct drm_encoder *exynos_drm_best_encoder(struct drm_connector *connector);
+
 void exynos_drm_display_power(struct drm_connector *connector, int mode);
 
 #endif
index 96a10c38cd729046738d1c8cf7ef7639c1ac819e..db1f7edc53ae0fbe52797a0ac8825937697b74e7 100644 (file)
@@ -57,7 +57,7 @@ static void exynos_drm_connector_power(struct drm_encoder *encoder, int mode)
        struct drm_connector *connector;
 
        list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
-               if (connector->encoder == encoder) {
+               if (exynos_drm_best_encoder(connector) == encoder) {
                        DRM_DEBUG_KMS("connector[%d] dpms[%d]\n",
                                        connector->base.id, mode);