diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2015-12-16 07:21:42 -0500 |
---|---|---|
committer | Inki Dae <daeinki@gmail.com> | 2016-01-12 10:16:33 -0500 |
commit | 40bdfb0a4c4cd3f3af19171d31a6a7e8ab0cc1e7 (patch) | |
tree | 2bd5349a5ff05176c4db7de13a81e1f6c81be7d6 | |
parent | 8a0d560f3e651808ae0a3d9ab9fe476e59de132b (diff) |
drm/exynos: rename zpos to index
This patch renames zpos entry to index, because in most places it is
used as index for selecting hardware layer/window instead of
configurable layer position. This will later enable to make the zpos
property configurable.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
-rw-r--r-- | drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos7_drm_decon.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_drv.h | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fimd.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_plane.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_plane.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_vidi.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_mixer.c | 14 |
8 files changed, 28 insertions, 28 deletions
diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c index c7362b99ce28..77073d8faaa3 100644 --- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c | |||
@@ -256,7 +256,7 @@ static void decon_atomic_begin(struct exynos_drm_crtc *crtc, | |||
256 | if (test_bit(BIT_SUSPENDED, &ctx->flags)) | 256 | if (test_bit(BIT_SUSPENDED, &ctx->flags)) |
257 | return; | 257 | return; |
258 | 258 | ||
259 | decon_shadow_protect_win(ctx, plane->zpos, true); | 259 | decon_shadow_protect_win(ctx, plane->index, true); |
260 | } | 260 | } |
261 | 261 | ||
262 | #define BIT_VAL(x, e, s) (((x) & ((1 << ((e) - (s) + 1)) - 1)) << (s)) | 262 | #define BIT_VAL(x, e, s) (((x) & ((1 << ((e) - (s) + 1)) - 1)) << (s)) |
@@ -270,7 +270,7 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc, | |||
270 | to_exynos_plane_state(plane->base.state); | 270 | to_exynos_plane_state(plane->base.state); |
271 | struct decon_context *ctx = crtc->ctx; | 271 | struct decon_context *ctx = crtc->ctx; |
272 | struct drm_framebuffer *fb = state->base.fb; | 272 | struct drm_framebuffer *fb = state->base.fb; |
273 | unsigned int win = plane->zpos; | 273 | unsigned int win = plane->index; |
274 | unsigned int bpp = fb->bits_per_pixel >> 3; | 274 | unsigned int bpp = fb->bits_per_pixel >> 3; |
275 | unsigned int pitch = fb->pitches[0]; | 275 | unsigned int pitch = fb->pitches[0]; |
276 | dma_addr_t dma_addr = exynos_drm_fb_dma_addr(fb, 0); | 276 | dma_addr_t dma_addr = exynos_drm_fb_dma_addr(fb, 0); |
@@ -320,7 +320,7 @@ static void decon_disable_plane(struct exynos_drm_crtc *crtc, | |||
320 | struct exynos_drm_plane *plane) | 320 | struct exynos_drm_plane *plane) |
321 | { | 321 | { |
322 | struct decon_context *ctx = crtc->ctx; | 322 | struct decon_context *ctx = crtc->ctx; |
323 | unsigned int win = plane->zpos; | 323 | unsigned int win = plane->index; |
324 | 324 | ||
325 | if (test_bit(BIT_SUSPENDED, &ctx->flags)) | 325 | if (test_bit(BIT_SUSPENDED, &ctx->flags)) |
326 | return; | 326 | return; |
@@ -344,7 +344,7 @@ static void decon_atomic_flush(struct exynos_drm_crtc *crtc, | |||
344 | if (test_bit(BIT_SUSPENDED, &ctx->flags)) | 344 | if (test_bit(BIT_SUSPENDED, &ctx->flags)) |
345 | return; | 345 | return; |
346 | 346 | ||
347 | decon_shadow_protect_win(ctx, plane->zpos, false); | 347 | decon_shadow_protect_win(ctx, plane->index, false); |
348 | 348 | ||
349 | if (ctx->out_type == IFTYPE_I80) | 349 | if (ctx->out_type == IFTYPE_I80) |
350 | set_bit(BIT_WIN_UPDATED, &ctx->flags); | 350 | set_bit(BIT_WIN_UPDATED, &ctx->flags); |
@@ -502,7 +502,7 @@ static int decon_bind(struct device *dev, struct device *master, void *data) | |||
502 | ctx->configs[win].zpos = win; | 502 | ctx->configs[win].zpos = win; |
503 | ctx->configs[win].type = decon_win_types[tmp]; | 503 | ctx->configs[win].type = decon_win_types[tmp]; |
504 | 504 | ||
505 | ret = exynos_plane_init(drm_dev, &ctx->planes[win], | 505 | ret = exynos_plane_init(drm_dev, &ctx->planes[win], win, |
506 | 1 << ctx->pipe, &ctx->configs[win]); | 506 | 1 << ctx->pipe, &ctx->configs[win]); |
507 | if (ret) | 507 | if (ret) |
508 | return ret; | 508 | return ret; |
diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c index c47f9af8170b..8911f965b06c 100644 --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c | |||
@@ -393,7 +393,7 @@ static void decon_atomic_begin(struct exynos_drm_crtc *crtc, | |||
393 | if (ctx->suspended) | 393 | if (ctx->suspended) |
394 | return; | 394 | return; |
395 | 395 | ||
396 | decon_shadow_protect_win(ctx, plane->zpos, true); | 396 | decon_shadow_protect_win(ctx, plane->index, true); |
397 | } | 397 | } |
398 | 398 | ||
399 | static void decon_update_plane(struct exynos_drm_crtc *crtc, | 399 | static void decon_update_plane(struct exynos_drm_crtc *crtc, |
@@ -407,7 +407,7 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc, | |||
407 | unsigned long val, alpha; | 407 | unsigned long val, alpha; |
408 | unsigned int last_x; | 408 | unsigned int last_x; |
409 | unsigned int last_y; | 409 | unsigned int last_y; |
410 | unsigned int win = plane->zpos; | 410 | unsigned int win = plane->index; |
411 | unsigned int bpp = fb->bits_per_pixel >> 3; | 411 | unsigned int bpp = fb->bits_per_pixel >> 3; |
412 | unsigned int pitch = fb->pitches[0]; | 412 | unsigned int pitch = fb->pitches[0]; |
413 | 413 | ||
@@ -498,7 +498,7 @@ static void decon_disable_plane(struct exynos_drm_crtc *crtc, | |||
498 | struct exynos_drm_plane *plane) | 498 | struct exynos_drm_plane *plane) |
499 | { | 499 | { |
500 | struct decon_context *ctx = crtc->ctx; | 500 | struct decon_context *ctx = crtc->ctx; |
501 | unsigned int win = plane->zpos; | 501 | unsigned int win = plane->index; |
502 | u32 val; | 502 | u32 val; |
503 | 503 | ||
504 | if (ctx->suspended) | 504 | if (ctx->suspended) |
@@ -525,7 +525,7 @@ static void decon_atomic_flush(struct exynos_drm_crtc *crtc, | |||
525 | if (ctx->suspended) | 525 | if (ctx->suspended) |
526 | return; | 526 | return; |
527 | 527 | ||
528 | decon_shadow_protect_win(ctx, plane->zpos, false); | 528 | decon_shadow_protect_win(ctx, plane->index, false); |
529 | } | 529 | } |
530 | 530 | ||
531 | static void decon_init(struct decon_context *ctx) | 531 | static void decon_init(struct decon_context *ctx) |
@@ -657,7 +657,7 @@ static int decon_bind(struct device *dev, struct device *master, void *data) | |||
657 | ctx->configs[i].zpos = i; | 657 | ctx->configs[i].zpos = i; |
658 | ctx->configs[i].type = decon_win_types[i]; | 658 | ctx->configs[i].type = decon_win_types[i]; |
659 | 659 | ||
660 | ret = exynos_plane_init(drm_dev, &ctx->planes[i], | 660 | ret = exynos_plane_init(drm_dev, &ctx->planes[i], i, |
661 | 1 << ctx->pipe, &ctx->configs[i]); | 661 | 1 << ctx->pipe, &ctx->configs[i]); |
662 | if (ret) | 662 | if (ret) |
663 | return ret; | 663 | return ret; |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 82bbd7f4b316..588b6763f9c7 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h | |||
@@ -76,7 +76,7 @@ to_exynos_plane_state(struct drm_plane_state *state) | |||
76 | * Exynos drm common overlay structure. | 76 | * Exynos drm common overlay structure. |
77 | * | 77 | * |
78 | * @base: plane object | 78 | * @base: plane object |
79 | * @zpos: order of overlay layer(z position). | 79 | * @index: hardware index of the overlay layer |
80 | * | 80 | * |
81 | * this structure is common to exynos SoC and its contents would be copied | 81 | * this structure is common to exynos SoC and its contents would be copied |
82 | * to hardware specific overlay info. | 82 | * to hardware specific overlay info. |
@@ -85,7 +85,7 @@ to_exynos_plane_state(struct drm_plane_state *state) | |||
85 | struct exynos_drm_plane { | 85 | struct exynos_drm_plane { |
86 | struct drm_plane base; | 86 | struct drm_plane base; |
87 | const struct exynos_drm_plane_config *config; | 87 | const struct exynos_drm_plane_config *config; |
88 | unsigned int zpos; | 88 | unsigned int index; |
89 | struct drm_framebuffer *pending_fb; | 89 | struct drm_framebuffer *pending_fb; |
90 | }; | 90 | }; |
91 | 91 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 2e2247126581..6ae1b1e55783 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c | |||
@@ -630,7 +630,7 @@ static void fimd_atomic_begin(struct exynos_drm_crtc *crtc, | |||
630 | if (ctx->suspended) | 630 | if (ctx->suspended) |
631 | return; | 631 | return; |
632 | 632 | ||
633 | fimd_shadow_protect_win(ctx, plane->zpos, true); | 633 | fimd_shadow_protect_win(ctx, plane->index, true); |
634 | } | 634 | } |
635 | 635 | ||
636 | static void fimd_atomic_flush(struct exynos_drm_crtc *crtc, | 636 | static void fimd_atomic_flush(struct exynos_drm_crtc *crtc, |
@@ -641,7 +641,7 @@ static void fimd_atomic_flush(struct exynos_drm_crtc *crtc, | |||
641 | if (ctx->suspended) | 641 | if (ctx->suspended) |
642 | return; | 642 | return; |
643 | 643 | ||
644 | fimd_shadow_protect_win(ctx, plane->zpos, false); | 644 | fimd_shadow_protect_win(ctx, plane->index, false); |
645 | } | 645 | } |
646 | 646 | ||
647 | static void fimd_update_plane(struct exynos_drm_crtc *crtc, | 647 | static void fimd_update_plane(struct exynos_drm_crtc *crtc, |
@@ -654,7 +654,7 @@ static void fimd_update_plane(struct exynos_drm_crtc *crtc, | |||
654 | dma_addr_t dma_addr; | 654 | dma_addr_t dma_addr; |
655 | unsigned long val, size, offset; | 655 | unsigned long val, size, offset; |
656 | unsigned int last_x, last_y, buf_offsize, line_size; | 656 | unsigned int last_x, last_y, buf_offsize, line_size; |
657 | unsigned int win = plane->zpos; | 657 | unsigned int win = plane->index; |
658 | unsigned int bpp = fb->bits_per_pixel >> 3; | 658 | unsigned int bpp = fb->bits_per_pixel >> 3; |
659 | unsigned int pitch = fb->pitches[0]; | 659 | unsigned int pitch = fb->pitches[0]; |
660 | 660 | ||
@@ -740,7 +740,7 @@ static void fimd_disable_plane(struct exynos_drm_crtc *crtc, | |||
740 | struct exynos_drm_plane *plane) | 740 | struct exynos_drm_plane *plane) |
741 | { | 741 | { |
742 | struct fimd_context *ctx = crtc->ctx; | 742 | struct fimd_context *ctx = crtc->ctx; |
743 | unsigned int win = plane->zpos; | 743 | unsigned int win = plane->index; |
744 | 744 | ||
745 | if (ctx->suspended) | 745 | if (ctx->suspended) |
746 | return; | 746 | return; |
@@ -944,7 +944,7 @@ static int fimd_bind(struct device *dev, struct device *master, void *data) | |||
944 | ctx->configs[i].num_pixel_formats = ARRAY_SIZE(fimd_formats); | 944 | ctx->configs[i].num_pixel_formats = ARRAY_SIZE(fimd_formats); |
945 | ctx->configs[i].zpos = i; | 945 | ctx->configs[i].zpos = i; |
946 | ctx->configs[i].type = fimd_win_types[i]; | 946 | ctx->configs[i].type = fimd_win_types[i]; |
947 | ret = exynos_plane_init(drm_dev, &ctx->planes[i], | 947 | ret = exynos_plane_init(drm_dev, &ctx->planes[i], i, |
948 | 1 << ctx->pipe, &ctx->configs[i]); | 948 | 1 << ctx->pipe, &ctx->configs[i]); |
949 | if (ret) | 949 | if (ret) |
950 | return ret; | 950 | return ret; |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index e668fcdbcafc..e45730ad67f2 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c | |||
@@ -280,7 +280,7 @@ static void exynos_plane_attach_zpos_property(struct drm_plane *plane, | |||
280 | 280 | ||
281 | int exynos_plane_init(struct drm_device *dev, | 281 | int exynos_plane_init(struct drm_device *dev, |
282 | struct exynos_drm_plane *exynos_plane, | 282 | struct exynos_drm_plane *exynos_plane, |
283 | unsigned long possible_crtcs, | 283 | unsigned int index, unsigned long possible_crtcs, |
284 | const struct exynos_drm_plane_config *config) | 284 | const struct exynos_drm_plane_config *config) |
285 | { | 285 | { |
286 | int err; | 286 | int err; |
@@ -298,7 +298,7 @@ int exynos_plane_init(struct drm_device *dev, | |||
298 | 298 | ||
299 | drm_plane_helper_add(&exynos_plane->base, &plane_helper_funcs); | 299 | drm_plane_helper_add(&exynos_plane->base, &plane_helper_funcs); |
300 | 300 | ||
301 | exynos_plane->zpos = config->zpos; | 301 | exynos_plane->index = index; |
302 | exynos_plane->config = config; | 302 | exynos_plane->config = config; |
303 | 303 | ||
304 | if (config->type == DRM_PLANE_TYPE_OVERLAY) | 304 | if (config->type == DRM_PLANE_TYPE_OVERLAY) |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.h b/drivers/gpu/drm/exynos/exynos_drm_plane.h index 0dd096548284..9aafad164cdf 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.h +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.h | |||
@@ -10,6 +10,6 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | int exynos_plane_init(struct drm_device *dev, | 12 | int exynos_plane_init(struct drm_device *dev, |
13 | struct exynos_drm_plane *exynos_plane, | 13 | struct exynos_drm_plane *exynos_plane, unsigned int index, |
14 | unsigned long possible_crtcs, | 14 | unsigned long possible_crtcs, |
15 | const struct exynos_drm_plane_config *config); | 15 | const struct exynos_drm_plane_config *config); |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c index 0be29c1b2c05..62ac4e5fa51d 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c | |||
@@ -461,7 +461,7 @@ static int vidi_bind(struct device *dev, struct device *master, void *data) | |||
461 | plane_config.zpos = i; | 461 | plane_config.zpos = i; |
462 | plane_config.type = vidi_win_types[i]; | 462 | plane_config.type = vidi_win_types[i]; |
463 | 463 | ||
464 | ret = exynos_plane_init(drm_dev, &ctx->planes[i], | 464 | ret = exynos_plane_init(drm_dev, &ctx->planes[i], i, |
465 | 1 << ctx->pipe, &plane_config); | 465 | 1 << ctx->pipe, &plane_config); |
466 | if (ret) | 466 | if (ret) |
467 | return ret; | 467 | return ret; |
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index dfb35e2da4db..0dceeb2b532c 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c | |||
@@ -511,7 +511,7 @@ static void vp_video_buffer(struct mixer_context *ctx, | |||
511 | 511 | ||
512 | mixer_cfg_scan(ctx, mode->vdisplay); | 512 | mixer_cfg_scan(ctx, mode->vdisplay); |
513 | mixer_cfg_rgb_fmt(ctx, mode->vdisplay); | 513 | mixer_cfg_rgb_fmt(ctx, mode->vdisplay); |
514 | mixer_cfg_layer(ctx, plane->zpos, true); | 514 | mixer_cfg_layer(ctx, plane->index, true); |
515 | mixer_run(ctx); | 515 | mixer_run(ctx); |
516 | 516 | ||
517 | mixer_vsync_set_update(ctx, true); | 517 | mixer_vsync_set_update(ctx, true); |
@@ -537,7 +537,7 @@ static void mixer_graph_buffer(struct mixer_context *ctx, | |||
537 | struct mixer_resources *res = &ctx->mixer_res; | 537 | struct mixer_resources *res = &ctx->mixer_res; |
538 | struct drm_framebuffer *fb = state->base.fb; | 538 | struct drm_framebuffer *fb = state->base.fb; |
539 | unsigned long flags; | 539 | unsigned long flags; |
540 | unsigned int win = plane->zpos; | 540 | unsigned int win = plane->index; |
541 | unsigned int x_ratio = 0, y_ratio = 0; | 541 | unsigned int x_ratio = 0, y_ratio = 0; |
542 | unsigned int src_x_offset, src_y_offset, dst_x_offset, dst_y_offset; | 542 | unsigned int src_x_offset, src_y_offset, dst_x_offset, dst_y_offset; |
543 | dma_addr_t dma_addr; | 543 | dma_addr_t dma_addr; |
@@ -956,12 +956,12 @@ static void mixer_update_plane(struct exynos_drm_crtc *crtc, | |||
956 | { | 956 | { |
957 | struct mixer_context *mixer_ctx = crtc->ctx; | 957 | struct mixer_context *mixer_ctx = crtc->ctx; |
958 | 958 | ||
959 | DRM_DEBUG_KMS("win: %d\n", plane->zpos); | 959 | DRM_DEBUG_KMS("win: %d\n", plane->index); |
960 | 960 | ||
961 | if (!test_bit(MXR_BIT_POWERED, &mixer_ctx->flags)) | 961 | if (!test_bit(MXR_BIT_POWERED, &mixer_ctx->flags)) |
962 | return; | 962 | return; |
963 | 963 | ||
964 | if (plane->zpos > 1 && mixer_ctx->vp_enabled) | 964 | if (plane->index > 1 && mixer_ctx->vp_enabled) |
965 | vp_video_buffer(mixer_ctx, plane); | 965 | vp_video_buffer(mixer_ctx, plane); |
966 | else | 966 | else |
967 | mixer_graph_buffer(mixer_ctx, plane); | 967 | mixer_graph_buffer(mixer_ctx, plane); |
@@ -974,7 +974,7 @@ static void mixer_disable_plane(struct exynos_drm_crtc *crtc, | |||
974 | struct mixer_resources *res = &mixer_ctx->mixer_res; | 974 | struct mixer_resources *res = &mixer_ctx->mixer_res; |
975 | unsigned long flags; | 975 | unsigned long flags; |
976 | 976 | ||
977 | DRM_DEBUG_KMS("win: %d\n", plane->zpos); | 977 | DRM_DEBUG_KMS("win: %d\n", plane->index); |
978 | 978 | ||
979 | if (!test_bit(MXR_BIT_POWERED, &mixer_ctx->flags)) | 979 | if (!test_bit(MXR_BIT_POWERED, &mixer_ctx->flags)) |
980 | return; | 980 | return; |
@@ -982,7 +982,7 @@ static void mixer_disable_plane(struct exynos_drm_crtc *crtc, | |||
982 | spin_lock_irqsave(&res->reg_slock, flags); | 982 | spin_lock_irqsave(&res->reg_slock, flags); |
983 | mixer_vsync_set_update(mixer_ctx, false); | 983 | mixer_vsync_set_update(mixer_ctx, false); |
984 | 984 | ||
985 | mixer_cfg_layer(mixer_ctx, plane->zpos, false); | 985 | mixer_cfg_layer(mixer_ctx, plane->index, false); |
986 | 986 | ||
987 | mixer_vsync_set_update(mixer_ctx, true); | 987 | mixer_vsync_set_update(mixer_ctx, true); |
988 | spin_unlock_irqrestore(&res->reg_slock, flags); | 988 | spin_unlock_irqrestore(&res->reg_slock, flags); |
@@ -1160,7 +1160,7 @@ static int mixer_bind(struct device *dev, struct device *manager, void *data) | |||
1160 | if (i == VP_DEFAULT_WIN && !ctx->vp_enabled) | 1160 | if (i == VP_DEFAULT_WIN && !ctx->vp_enabled) |
1161 | continue; | 1161 | continue; |
1162 | 1162 | ||
1163 | ret = exynos_plane_init(drm_dev, &ctx->planes[i], | 1163 | ret = exynos_plane_init(drm_dev, &ctx->planes[i], i, |
1164 | 1 << ctx->pipe, &plane_configs[i]); | 1164 | 1 << ctx->pipe, &plane_configs[i]); |
1165 | if (ret) | 1165 | if (ret) |
1166 | return ret; | 1166 | return ret; |