diff options
| author | Joonyoung Shim <jy0922.shim@samsung.com> | 2012-06-27 01:27:02 -0400 |
|---|---|---|
| committer | Inki Dae <inki.dae@samsung.com> | 2012-07-26 22:13:53 -0400 |
| commit | d249ce024bf6da9cc26cbd236aca25a22cbbe36e (patch) | |
| tree | cde0ac10bbf8352ccf10823fa99102eeba256960 /drivers/gpu | |
| parent | aeb292245af4bdfda00c0e46647d9e140e3f5cd0 (diff) | |
drm/exynos: fix to set pipe of crtc
It is enough to set pipe of crtc to manager only when do mode_set of
crtc.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu')
| -rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_crtc.c | 8 | ||||
| -rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_encoder.c | 33 | ||||
| -rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_encoder.h | 1 |
3 files changed, 24 insertions, 18 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index 552e0ebe60ba..a3fa7cd6d36a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c | |||
| @@ -67,8 +67,7 @@ static void exynos_drm_crtc_apply(struct drm_crtc *crtc) | |||
| 67 | 67 | ||
| 68 | exynos_drm_fn_encoder(crtc, overlay, | 68 | exynos_drm_fn_encoder(crtc, overlay, |
| 69 | exynos_drm_encoder_crtc_mode_set); | 69 | exynos_drm_encoder_crtc_mode_set); |
| 70 | exynos_drm_fn_encoder(crtc, &exynos_crtc->pipe, | 70 | exynos_drm_fn_encoder(crtc, NULL, exynos_drm_encoder_crtc_commit); |
| 71 | exynos_drm_encoder_crtc_commit); | ||
| 72 | } | 71 | } |
| 73 | 72 | ||
| 74 | int exynos_drm_overlay_update(struct exynos_drm_overlay *overlay, | 73 | int exynos_drm_overlay_update(struct exynos_drm_overlay *overlay, |
| @@ -231,8 +230,7 @@ static void exynos_drm_crtc_commit(struct drm_crtc *crtc) | |||
| 231 | exynos_drm_encoder_dpms_from_crtc); | 230 | exynos_drm_encoder_dpms_from_crtc); |
| 232 | } | 231 | } |
| 233 | 232 | ||
| 234 | exynos_drm_fn_encoder(crtc, &exynos_crtc->pipe, | 233 | exynos_drm_fn_encoder(crtc, NULL, exynos_drm_encoder_crtc_commit); |
| 235 | exynos_drm_encoder_crtc_commit); | ||
| 236 | } | 234 | } |
| 237 | 235 | ||
| 238 | static bool | 236 | static bool |
| @@ -253,6 +251,7 @@ exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode, | |||
| 253 | { | 251 | { |
| 254 | struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); | 252 | struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); |
| 255 | struct exynos_drm_overlay *overlay = &exynos_crtc->overlay; | 253 | struct exynos_drm_overlay *overlay = &exynos_crtc->overlay; |
| 254 | int pipe = exynos_crtc->pipe; | ||
| 256 | int ret; | 255 | int ret; |
| 257 | 256 | ||
| 258 | DRM_DEBUG_KMS("%s\n", __FILE__); | 257 | DRM_DEBUG_KMS("%s\n", __FILE__); |
| @@ -268,6 +267,7 @@ exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode, | |||
| 268 | return ret; | 267 | return ret; |
| 269 | 268 | ||
| 270 | exynos_drm_fn_encoder(crtc, overlay, exynos_drm_encoder_crtc_mode_set); | 269 | exynos_drm_fn_encoder(crtc, overlay, exynos_drm_encoder_crtc_mode_set); |
| 270 | exynos_drm_fn_encoder(crtc, &pipe, exynos_drm_encoder_crtc_pipe); | ||
| 271 | 271 | ||
| 272 | return 0; | 272 | return 0; |
| 273 | } | 273 | } |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c b/drivers/gpu/drm/exynos/exynos_drm_encoder.c index 652b901d8afe..33f3c41869d7 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c +++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c | |||
| @@ -30,7 +30,6 @@ | |||
| 30 | #include "drm_crtc_helper.h" | 30 | #include "drm_crtc_helper.h" |
| 31 | 31 | ||
| 32 | #include "exynos_drm_drv.h" | 32 | #include "exynos_drm_drv.h" |
| 33 | #include "exynos_drm_crtc.h" | ||
| 34 | #include "exynos_drm_encoder.h" | 33 | #include "exynos_drm_encoder.h" |
| 35 | 34 | ||
| 36 | #define to_exynos_encoder(x) container_of(x, struct exynos_drm_encoder,\ | 35 | #define to_exynos_encoder(x) container_of(x, struct exynos_drm_encoder,\ |
| @@ -303,8 +302,8 @@ void exynos_drm_enable_vblank(struct drm_encoder *encoder, void *data) | |||
| 303 | struct exynos_drm_manager_ops *manager_ops = manager->ops; | 302 | struct exynos_drm_manager_ops *manager_ops = manager->ops; |
| 304 | int crtc = *(int *)data; | 303 | int crtc = *(int *)data; |
| 305 | 304 | ||
| 306 | if (manager->pipe == -1) | 305 | if (manager->pipe != crtc) |
| 307 | manager->pipe = crtc; | 306 | return; |
| 308 | 307 | ||
| 309 | if (manager_ops->enable_vblank) | 308 | if (manager_ops->enable_vblank) |
| 310 | manager_ops->enable_vblank(manager->dev); | 309 | manager_ops->enable_vblank(manager->dev); |
| @@ -317,8 +316,8 @@ void exynos_drm_disable_vblank(struct drm_encoder *encoder, void *data) | |||
| 317 | struct exynos_drm_manager_ops *manager_ops = manager->ops; | 316 | struct exynos_drm_manager_ops *manager_ops = manager->ops; |
| 318 | int crtc = *(int *)data; | 317 | int crtc = *(int *)data; |
| 319 | 318 | ||
| 320 | if (manager->pipe == -1) | 319 | if (manager->pipe != crtc) |
| 321 | manager->pipe = crtc; | 320 | return; |
| 322 | 321 | ||
| 323 | if (manager_ops->disable_vblank) | 322 | if (manager_ops->disable_vblank) |
| 324 | manager_ops->disable_vblank(manager->dev); | 323 | manager_ops->disable_vblank(manager->dev); |
| @@ -341,19 +340,10 @@ void exynos_drm_encoder_crtc_plane_commit(struct drm_encoder *encoder, | |||
| 341 | 340 | ||
| 342 | void exynos_drm_encoder_crtc_commit(struct drm_encoder *encoder, void *data) | 341 | void exynos_drm_encoder_crtc_commit(struct drm_encoder *encoder, void *data) |
| 343 | { | 342 | { |
| 344 | struct exynos_drm_manager *manager = | ||
| 345 | to_exynos_encoder(encoder)->manager; | ||
| 346 | int crtc = *(int *)data; | ||
| 347 | int zpos = DEFAULT_ZPOS; | 343 | int zpos = DEFAULT_ZPOS; |
| 348 | 344 | ||
| 349 | DRM_DEBUG_KMS("%s\n", __FILE__); | 345 | DRM_DEBUG_KMS("%s\n", __FILE__); |
| 350 | 346 | ||
| 351 | /* | ||
| 352 | * when crtc is detached from encoder, this pipe is used | ||
| 353 | * to select manager operation | ||
| 354 | */ | ||
| 355 | manager->pipe = crtc; | ||
| 356 | |||
| 357 | exynos_drm_encoder_crtc_plane_commit(encoder, &zpos); | 347 | exynos_drm_encoder_crtc_plane_commit(encoder, &zpos); |
| 358 | } | 348 | } |
| 359 | 349 | ||
| @@ -429,3 +419,18 @@ void exynos_drm_encoder_crtc_disable(struct drm_encoder *encoder, void *data) | |||
| 429 | if (overlay_ops && overlay_ops->disable) | 419 | if (overlay_ops && overlay_ops->disable) |
| 430 | overlay_ops->disable(manager->dev, zpos); | 420 | overlay_ops->disable(manager->dev, zpos); |
| 431 | } | 421 | } |
| 422 | |||
| 423 | void exynos_drm_encoder_crtc_pipe(struct drm_encoder *encoder, void *data) | ||
| 424 | { | ||
| 425 | struct exynos_drm_manager *manager = | ||
| 426 | to_exynos_encoder(encoder)->manager; | ||
| 427 | int pipe = *(int *)data; | ||
| 428 | |||
| 429 | DRM_DEBUG_KMS("%s\n", __FILE__); | ||
| 430 | |||
| 431 | /* | ||
| 432 | * when crtc is detached from encoder, this pipe is used | ||
| 433 | * to select manager operation | ||
| 434 | */ | ||
| 435 | manager->pipe = pipe; | ||
| 436 | } | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.h b/drivers/gpu/drm/exynos/exynos_drm_encoder.h index eb7d2316847e..14dab25a09f5 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_encoder.h +++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.h | |||
| @@ -48,5 +48,6 @@ void exynos_drm_encoder_dpms_from_crtc(struct drm_encoder *encoder, | |||
| 48 | void exynos_drm_encoder_crtc_dpms(struct drm_encoder *encoder, void *data); | 48 | void exynos_drm_encoder_crtc_dpms(struct drm_encoder *encoder, void *data); |
| 49 | void exynos_drm_encoder_crtc_mode_set(struct drm_encoder *encoder, void *data); | 49 | void exynos_drm_encoder_crtc_mode_set(struct drm_encoder *encoder, void *data); |
| 50 | void exynos_drm_encoder_crtc_disable(struct drm_encoder *encoder, void *data); | 50 | void exynos_drm_encoder_crtc_disable(struct drm_encoder *encoder, void *data); |
| 51 | void exynos_drm_encoder_crtc_pipe(struct drm_encoder *encoder, void *data); | ||
| 51 | 52 | ||
| 52 | #endif | 53 | #endif |
