diff options
author | Inki Dae <inki.dae@samsung.com> | 2019-04-15 04:13:38 -0400 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2019-04-23 22:23:20 -0400 |
commit | 8b9550344d3914cf606f365b6fa4279fb3cd4684 (patch) | |
tree | ce31587968943b58107eb5eb704da1ee9f124466 | |
parent | df90a64eaf57b89ebc910ad0e4e2b4c3dc1567b9 (diff) |
drm/ipp: clean up debug messages
Print out debug messages with correct device name.
As for this, this patch adds device pointer to exynos_drm_ipp structure,
and in case of exynos_drm_ipp_task structure, replace drm_device pointer
with device one. This will make each ipp driver to print out debug
messages with correct device name.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fimc.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_gsc.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_ipp.c | 46 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_ipp.h | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_rotator.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_scaler.c | 6 |
6 files changed, 40 insertions, 37 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 71b0cb123a56..c50b0f9270a4 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c | |||
@@ -1134,9 +1134,10 @@ static int fimc_bind(struct device *dev, struct device *master, void *data) | |||
1134 | struct exynos_drm_ipp *ipp = &ctx->ipp; | 1134 | struct exynos_drm_ipp *ipp = &ctx->ipp; |
1135 | 1135 | ||
1136 | ctx->drm_dev = drm_dev; | 1136 | ctx->drm_dev = drm_dev; |
1137 | ipp->drm_dev = drm_dev; | ||
1137 | exynos_drm_register_dma(drm_dev, dev); | 1138 | exynos_drm_register_dma(drm_dev, dev); |
1138 | 1139 | ||
1139 | exynos_drm_ipp_register(drm_dev, ipp, &ipp_funcs, | 1140 | exynos_drm_ipp_register(dev, ipp, &ipp_funcs, |
1140 | DRM_EXYNOS_IPP_CAP_CROP | DRM_EXYNOS_IPP_CAP_ROTATE | | 1141 | DRM_EXYNOS_IPP_CAP_CROP | DRM_EXYNOS_IPP_CAP_ROTATE | |
1141 | DRM_EXYNOS_IPP_CAP_SCALE | DRM_EXYNOS_IPP_CAP_CONVERT, | 1142 | DRM_EXYNOS_IPP_CAP_SCALE | DRM_EXYNOS_IPP_CAP_CONVERT, |
1142 | ctx->formats, ctx->num_formats, "fimc"); | 1143 | ctx->formats, ctx->num_formats, "fimc"); |
@@ -1153,7 +1154,7 @@ static void fimc_unbind(struct device *dev, struct device *master, | |||
1153 | struct drm_device *drm_dev = data; | 1154 | struct drm_device *drm_dev = data; |
1154 | struct exynos_drm_ipp *ipp = &ctx->ipp; | 1155 | struct exynos_drm_ipp *ipp = &ctx->ipp; |
1155 | 1156 | ||
1156 | exynos_drm_ipp_unregister(drm_dev, ipp); | 1157 | exynos_drm_ipp_unregister(dev, ipp); |
1157 | exynos_drm_unregister_dma(drm_dev, dev); | 1158 | exynos_drm_unregister_dma(drm_dev, dev); |
1158 | } | 1159 | } |
1159 | 1160 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 433df3ef731b..0bfb5e9f6e91 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c | |||
@@ -1170,9 +1170,10 @@ static int gsc_bind(struct device *dev, struct device *master, void *data) | |||
1170 | struct exynos_drm_ipp *ipp = &ctx->ipp; | 1170 | struct exynos_drm_ipp *ipp = &ctx->ipp; |
1171 | 1171 | ||
1172 | ctx->drm_dev = drm_dev; | 1172 | ctx->drm_dev = drm_dev; |
1173 | ctx->drm_dev = drm_dev; | ||
1173 | exynos_drm_register_dma(drm_dev, dev); | 1174 | exynos_drm_register_dma(drm_dev, dev); |
1174 | 1175 | ||
1175 | exynos_drm_ipp_register(drm_dev, ipp, &ipp_funcs, | 1176 | exynos_drm_ipp_register(dev, ipp, &ipp_funcs, |
1176 | DRM_EXYNOS_IPP_CAP_CROP | DRM_EXYNOS_IPP_CAP_ROTATE | | 1177 | DRM_EXYNOS_IPP_CAP_CROP | DRM_EXYNOS_IPP_CAP_ROTATE | |
1177 | DRM_EXYNOS_IPP_CAP_SCALE | DRM_EXYNOS_IPP_CAP_CONVERT, | 1178 | DRM_EXYNOS_IPP_CAP_SCALE | DRM_EXYNOS_IPP_CAP_CONVERT, |
1178 | ctx->formats, ctx->num_formats, "gsc"); | 1179 | ctx->formats, ctx->num_formats, "gsc"); |
@@ -1189,7 +1190,7 @@ static void gsc_unbind(struct device *dev, struct device *master, | |||
1189 | struct drm_device *drm_dev = data; | 1190 | struct drm_device *drm_dev = data; |
1190 | struct exynos_drm_ipp *ipp = &ctx->ipp; | 1191 | struct exynos_drm_ipp *ipp = &ctx->ipp; |
1191 | 1192 | ||
1192 | exynos_drm_ipp_unregister(drm_dev, ipp); | 1193 | exynos_drm_ipp_unregister(dev, ipp); |
1193 | exynos_drm_unregister_dma(drm_dev, dev); | 1194 | exynos_drm_unregister_dma(drm_dev, dev); |
1194 | } | 1195 | } |
1195 | 1196 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index a1ee5416927d..c862099723a0 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c | |||
@@ -43,7 +43,7 @@ static LIST_HEAD(ipp_list); | |||
43 | * Returns: | 43 | * Returns: |
44 | * Zero on success, error code on failure. | 44 | * Zero on success, error code on failure. |
45 | */ | 45 | */ |
46 | int exynos_drm_ipp_register(struct drm_device *dev, struct exynos_drm_ipp *ipp, | 46 | int exynos_drm_ipp_register(struct device *dev, struct exynos_drm_ipp *ipp, |
47 | const struct exynos_drm_ipp_funcs *funcs, unsigned int caps, | 47 | const struct exynos_drm_ipp_funcs *funcs, unsigned int caps, |
48 | const struct exynos_drm_ipp_formats *formats, | 48 | const struct exynos_drm_ipp_formats *formats, |
49 | unsigned int num_formats, const char *name) | 49 | unsigned int num_formats, const char *name) |
@@ -67,7 +67,7 @@ int exynos_drm_ipp_register(struct drm_device *dev, struct exynos_drm_ipp *ipp, | |||
67 | list_add_tail(&ipp->head, &ipp_list); | 67 | list_add_tail(&ipp->head, &ipp_list); |
68 | ipp->id = num_ipp++; | 68 | ipp->id = num_ipp++; |
69 | 69 | ||
70 | DRM_DEV_DEBUG_DRIVER(dev->dev, "Registered ipp %d\n", ipp->id); | 70 | DRM_DEV_DEBUG_DRIVER(dev, "Registered ipp %d\n", ipp->id); |
71 | 71 | ||
72 | return 0; | 72 | return 0; |
73 | } | 73 | } |
@@ -77,7 +77,7 @@ int exynos_drm_ipp_register(struct drm_device *dev, struct exynos_drm_ipp *ipp, | |||
77 | * @dev: DRM device | 77 | * @dev: DRM device |
78 | * @ipp: ipp module | 78 | * @ipp: ipp module |
79 | */ | 79 | */ |
80 | void exynos_drm_ipp_unregister(struct drm_device *dev, | 80 | void exynos_drm_ipp_unregister(struct device *dev, |
81 | struct exynos_drm_ipp *ipp) | 81 | struct exynos_drm_ipp *ipp) |
82 | { | 82 | { |
83 | WARN_ON(ipp->task); | 83 | WARN_ON(ipp->task); |
@@ -268,7 +268,7 @@ static inline struct exynos_drm_ipp_task * | |||
268 | task->src.rect.h = task->dst.rect.h = UINT_MAX; | 268 | task->src.rect.h = task->dst.rect.h = UINT_MAX; |
269 | task->transform.rotation = DRM_MODE_ROTATE_0; | 269 | task->transform.rotation = DRM_MODE_ROTATE_0; |
270 | 270 | ||
271 | DRM_DEV_DEBUG_DRIVER(ipp->dev->dev, "Allocated task %pK\n", task); | 271 | DRM_DEV_DEBUG_DRIVER(task->dev, "Allocated task %pK\n", task); |
272 | 272 | ||
273 | return task; | 273 | return task; |
274 | } | 274 | } |
@@ -335,7 +335,7 @@ static int exynos_drm_ipp_task_set(struct exynos_drm_ipp_task *task, | |||
335 | size -= map[i].size; | 335 | size -= map[i].size; |
336 | } | 336 | } |
337 | 337 | ||
338 | DRM_DEV_DEBUG_DRIVER(task->dev->dev, | 338 | DRM_DEV_DEBUG_DRIVER(task->dev, |
339 | "Got task %pK configuration from userspace\n", | 339 | "Got task %pK configuration from userspace\n", |
340 | task); | 340 | task); |
341 | return 0; | 341 | return 0; |
@@ -391,12 +391,12 @@ static void exynos_drm_ipp_task_release_buf(struct exynos_drm_ipp_buffer *buf) | |||
391 | static void exynos_drm_ipp_task_free(struct exynos_drm_ipp *ipp, | 391 | static void exynos_drm_ipp_task_free(struct exynos_drm_ipp *ipp, |
392 | struct exynos_drm_ipp_task *task) | 392 | struct exynos_drm_ipp_task *task) |
393 | { | 393 | { |
394 | DRM_DEV_DEBUG_DRIVER(ipp->dev->dev, "Freeing task %pK\n", task); | 394 | DRM_DEV_DEBUG_DRIVER(task->dev, "Freeing task %pK\n", task); |
395 | 395 | ||
396 | exynos_drm_ipp_task_release_buf(&task->src); | 396 | exynos_drm_ipp_task_release_buf(&task->src); |
397 | exynos_drm_ipp_task_release_buf(&task->dst); | 397 | exynos_drm_ipp_task_release_buf(&task->dst); |
398 | if (task->event) | 398 | if (task->event) |
399 | drm_event_cancel_free(ipp->dev, &task->event->base); | 399 | drm_event_cancel_free(ipp->drm_dev, &task->event->base); |
400 | kfree(task); | 400 | kfree(task); |
401 | } | 401 | } |
402 | 402 | ||
@@ -555,7 +555,7 @@ static int exynos_drm_ipp_check_format(struct exynos_drm_ipp_task *task, | |||
555 | buf == src ? DRM_EXYNOS_IPP_FORMAT_SOURCE : | 555 | buf == src ? DRM_EXYNOS_IPP_FORMAT_SOURCE : |
556 | DRM_EXYNOS_IPP_FORMAT_DESTINATION); | 556 | DRM_EXYNOS_IPP_FORMAT_DESTINATION); |
557 | if (!fmt) { | 557 | if (!fmt) { |
558 | DRM_DEV_DEBUG_DRIVER(task->dev->dev, | 558 | DRM_DEV_DEBUG_DRIVER(task->dev, |
559 | "Task %pK: %s format not supported\n", | 559 | "Task %pK: %s format not supported\n", |
560 | task, buf == src ? "src" : "dst"); | 560 | task, buf == src ? "src" : "dst"); |
561 | return -EINVAL; | 561 | return -EINVAL; |
@@ -606,7 +606,7 @@ static int exynos_drm_ipp_task_check(struct exynos_drm_ipp_task *task) | |||
606 | bool rotate = (rotation != DRM_MODE_ROTATE_0); | 606 | bool rotate = (rotation != DRM_MODE_ROTATE_0); |
607 | bool scale = false; | 607 | bool scale = false; |
608 | 608 | ||
609 | DRM_DEV_DEBUG_DRIVER(ipp->dev->dev, "Checking task %pK\n", task); | 609 | DRM_DEV_DEBUG_DRIVER(task->dev, "Checking task %pK\n", task); |
610 | 610 | ||
611 | if (src->rect.w == UINT_MAX) | 611 | if (src->rect.w == UINT_MAX) |
612 | src->rect.w = src->buf.width; | 612 | src->rect.w = src->buf.width; |
@@ -621,7 +621,7 @@ static int exynos_drm_ipp_task_check(struct exynos_drm_ipp_task *task) | |||
621 | src->rect.y + src->rect.h > (src->buf.height) || | 621 | src->rect.y + src->rect.h > (src->buf.height) || |
622 | dst->rect.x + dst->rect.w > (dst->buf.width) || | 622 | dst->rect.x + dst->rect.w > (dst->buf.width) || |
623 | dst->rect.y + dst->rect.h > (dst->buf.height)) { | 623 | dst->rect.y + dst->rect.h > (dst->buf.height)) { |
624 | DRM_DEV_DEBUG_DRIVER(ipp->dev->dev, | 624 | DRM_DEV_DEBUG_DRIVER(task->dev, |
625 | "Task %pK: defined area is outside provided buffers\n", | 625 | "Task %pK: defined area is outside provided buffers\n", |
626 | task); | 626 | task); |
627 | return -EINVAL; | 627 | return -EINVAL; |
@@ -639,7 +639,7 @@ static int exynos_drm_ipp_task_check(struct exynos_drm_ipp_task *task) | |||
639 | (!(ipp->capabilities & DRM_EXYNOS_IPP_CAP_SCALE) && scale) || | 639 | (!(ipp->capabilities & DRM_EXYNOS_IPP_CAP_SCALE) && scale) || |
640 | (!(ipp->capabilities & DRM_EXYNOS_IPP_CAP_CONVERT) && | 640 | (!(ipp->capabilities & DRM_EXYNOS_IPP_CAP_CONVERT) && |
641 | src->buf.fourcc != dst->buf.fourcc)) { | 641 | src->buf.fourcc != dst->buf.fourcc)) { |
642 | DRM_DEV_DEBUG_DRIVER(ipp->dev->dev, "Task %pK: hw capabilities exceeded\n", | 642 | DRM_DEV_DEBUG_DRIVER(task->dev, "Task %pK: hw capabilities exceeded\n", |
643 | task); | 643 | task); |
644 | return -EINVAL; | 644 | return -EINVAL; |
645 | } | 645 | } |
@@ -652,7 +652,7 @@ static int exynos_drm_ipp_task_check(struct exynos_drm_ipp_task *task) | |||
652 | if (ret) | 652 | if (ret) |
653 | return ret; | 653 | return ret; |
654 | 654 | ||
655 | DRM_DEV_DEBUG_DRIVER(ipp->dev->dev, "Task %pK: all checks done.\n", | 655 | DRM_DEV_DEBUG_DRIVER(ipp->dev, "Task %pK: all checks done.\n", |
656 | task); | 656 | task); |
657 | 657 | ||
658 | return ret; | 658 | return ret; |
@@ -664,25 +664,25 @@ static int exynos_drm_ipp_task_setup_buffers(struct exynos_drm_ipp_task *task, | |||
664 | struct exynos_drm_ipp_buffer *src = &task->src, *dst = &task->dst; | 664 | struct exynos_drm_ipp_buffer *src = &task->src, *dst = &task->dst; |
665 | int ret = 0; | 665 | int ret = 0; |
666 | 666 | ||
667 | DRM_DEV_DEBUG_DRIVER(task->dev->dev, "Setting buffer for task %pK\n", | 667 | DRM_DEV_DEBUG_DRIVER(task->dev, "Setting buffer for task %pK\n", |
668 | task); | 668 | task); |
669 | 669 | ||
670 | ret = exynos_drm_ipp_task_setup_buffer(src, filp); | 670 | ret = exynos_drm_ipp_task_setup_buffer(src, filp); |
671 | if (ret) { | 671 | if (ret) { |
672 | DRM_DEV_DEBUG_DRIVER(task->dev->dev, | 672 | DRM_DEV_DEBUG_DRIVER(task->dev, |
673 | "Task %pK: src buffer setup failed\n", | 673 | "Task %pK: src buffer setup failed\n", |
674 | task); | 674 | task); |
675 | return ret; | 675 | return ret; |
676 | } | 676 | } |
677 | ret = exynos_drm_ipp_task_setup_buffer(dst, filp); | 677 | ret = exynos_drm_ipp_task_setup_buffer(dst, filp); |
678 | if (ret) { | 678 | if (ret) { |
679 | DRM_DEV_DEBUG_DRIVER(task->dev->dev, | 679 | DRM_DEV_DEBUG_DRIVER(task->dev, |
680 | "Task %pK: dst buffer setup failed\n", | 680 | "Task %pK: dst buffer setup failed\n", |
681 | task); | 681 | task); |
682 | return ret; | 682 | return ret; |
683 | } | 683 | } |
684 | 684 | ||
685 | DRM_DEV_DEBUG_DRIVER(task->dev->dev, "Task %pK: buffers prepared.\n", | 685 | DRM_DEV_DEBUG_DRIVER(task->dev, "Task %pK: buffers prepared.\n", |
686 | task); | 686 | task); |
687 | 687 | ||
688 | return ret; | 688 | return ret; |
@@ -703,7 +703,7 @@ static int exynos_drm_ipp_event_create(struct exynos_drm_ipp_task *task, | |||
703 | e->event.base.length = sizeof(e->event); | 703 | e->event.base.length = sizeof(e->event); |
704 | e->event.user_data = user_data; | 704 | e->event.user_data = user_data; |
705 | 705 | ||
706 | ret = drm_event_reserve_init(task->dev, file_priv, &e->base, | 706 | ret = drm_event_reserve_init(task->ipp->drm_dev, file_priv, &e->base, |
707 | &e->event.base); | 707 | &e->event.base); |
708 | if (ret) | 708 | if (ret) |
709 | goto free; | 709 | goto free; |
@@ -724,7 +724,7 @@ static void exynos_drm_ipp_event_send(struct exynos_drm_ipp_task *task) | |||
724 | task->event->event.tv_usec = now.tv_nsec / NSEC_PER_USEC; | 724 | task->event->event.tv_usec = now.tv_nsec / NSEC_PER_USEC; |
725 | task->event->event.sequence = atomic_inc_return(&task->ipp->sequence); | 725 | task->event->event.sequence = atomic_inc_return(&task->ipp->sequence); |
726 | 726 | ||
727 | drm_send_event(task->dev, &task->event->base); | 727 | drm_send_event(task->ipp->drm_dev, &task->event->base); |
728 | } | 728 | } |
729 | 729 | ||
730 | static int exynos_drm_ipp_task_cleanup(struct exynos_drm_ipp_task *task) | 730 | static int exynos_drm_ipp_task_cleanup(struct exynos_drm_ipp_task *task) |
@@ -761,7 +761,7 @@ void exynos_drm_ipp_task_done(struct exynos_drm_ipp_task *task, int ret) | |||
761 | struct exynos_drm_ipp *ipp = task->ipp; | 761 | struct exynos_drm_ipp *ipp = task->ipp; |
762 | unsigned long flags; | 762 | unsigned long flags; |
763 | 763 | ||
764 | DRM_DEV_DEBUG_DRIVER(ipp->dev->dev, "ipp: %d, task %pK done: %d\n", | 764 | DRM_DEV_DEBUG_DRIVER(task->dev, "ipp: %d, task %pK done: %d\n", |
765 | ipp->id, task, ret); | 765 | ipp->id, task, ret); |
766 | 766 | ||
767 | spin_lock_irqsave(&ipp->lock, flags); | 767 | spin_lock_irqsave(&ipp->lock, flags); |
@@ -786,7 +786,7 @@ static void exynos_drm_ipp_next_task(struct exynos_drm_ipp *ipp) | |||
786 | unsigned long flags; | 786 | unsigned long flags; |
787 | int ret; | 787 | int ret; |
788 | 788 | ||
789 | DRM_DEV_DEBUG_DRIVER(ipp->dev->dev, "ipp: %d, try to run new task\n", | 789 | DRM_DEV_DEBUG_DRIVER(ipp->dev, "ipp: %d, try to run new task\n", |
790 | ipp->id); | 790 | ipp->id); |
791 | 791 | ||
792 | spin_lock_irqsave(&ipp->lock, flags); | 792 | spin_lock_irqsave(&ipp->lock, flags); |
@@ -803,7 +803,7 @@ static void exynos_drm_ipp_next_task(struct exynos_drm_ipp *ipp) | |||
803 | 803 | ||
804 | spin_unlock_irqrestore(&ipp->lock, flags); | 804 | spin_unlock_irqrestore(&ipp->lock, flags); |
805 | 805 | ||
806 | DRM_DEV_DEBUG_DRIVER(ipp->dev->dev, | 806 | DRM_DEV_DEBUG_DRIVER(ipp->dev, |
807 | "ipp: %d, selected task %pK to run\n", ipp->id, | 807 | "ipp: %d, selected task %pK to run\n", ipp->id, |
808 | task); | 808 | task); |
809 | 809 | ||
@@ -913,7 +913,7 @@ int exynos_drm_ipp_commit_ioctl(struct drm_device *dev, void *data, | |||
913 | * then freed after exynos_drm_ipp_task_done() | 913 | * then freed after exynos_drm_ipp_task_done() |
914 | */ | 914 | */ |
915 | if (arg->flags & DRM_EXYNOS_IPP_FLAG_NONBLOCK) { | 915 | if (arg->flags & DRM_EXYNOS_IPP_FLAG_NONBLOCK) { |
916 | DRM_DEV_DEBUG_DRIVER(dev->dev, | 916 | DRM_DEV_DEBUG_DRIVER(ipp->dev, |
917 | "ipp: %d, nonblocking processing task %pK\n", | 917 | "ipp: %d, nonblocking processing task %pK\n", |
918 | ipp->id, task); | 918 | ipp->id, task); |
919 | 919 | ||
@@ -921,7 +921,7 @@ int exynos_drm_ipp_commit_ioctl(struct drm_device *dev, void *data, | |||
921 | exynos_drm_ipp_schedule_task(task->ipp, task); | 921 | exynos_drm_ipp_schedule_task(task->ipp, task); |
922 | ret = 0; | 922 | ret = 0; |
923 | } else { | 923 | } else { |
924 | DRM_DEV_DEBUG_DRIVER(dev->dev, "ipp: %d, processing task %pK\n", | 924 | DRM_DEV_DEBUG_DRIVER(ipp->dev, "ipp: %d, processing task %pK\n", |
925 | ipp->id, task); | 925 | ipp->id, task); |
926 | exynos_drm_ipp_schedule_task(ipp, task); | 926 | exynos_drm_ipp_schedule_task(ipp, task); |
927 | ret = wait_event_interruptible(ipp->done_wq, | 927 | ret = wait_event_interruptible(ipp->done_wq, |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.h b/drivers/gpu/drm/exynos/exynos_drm_ipp.h index 0b27d4a9bf94..5524c457a947 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.h +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.h | |||
@@ -54,7 +54,8 @@ struct exynos_drm_ipp_funcs { | |||
54 | * struct exynos_drm_ipp - central picture processor module structure | 54 | * struct exynos_drm_ipp - central picture processor module structure |
55 | */ | 55 | */ |
56 | struct exynos_drm_ipp { | 56 | struct exynos_drm_ipp { |
57 | struct drm_device *dev; | 57 | struct drm_device *drm_dev; |
58 | struct device *dev; | ||
58 | struct list_head head; | 59 | struct list_head head; |
59 | unsigned int id; | 60 | unsigned int id; |
60 | 61 | ||
@@ -85,7 +86,7 @@ struct exynos_drm_ipp_buffer { | |||
85 | * has to be performed by the picture processor hardware module | 86 | * has to be performed by the picture processor hardware module |
86 | */ | 87 | */ |
87 | struct exynos_drm_ipp_task { | 88 | struct exynos_drm_ipp_task { |
88 | struct drm_device *dev; | 89 | struct device *dev; |
89 | struct exynos_drm_ipp *ipp; | 90 | struct exynos_drm_ipp *ipp; |
90 | struct list_head head; | 91 | struct list_head head; |
91 | 92 | ||
@@ -129,11 +130,11 @@ struct exynos_drm_ipp_formats { | |||
129 | #define IPP_SCALE_LIMIT(val...) \ | 130 | #define IPP_SCALE_LIMIT(val...) \ |
130 | .type = (DRM_EXYNOS_IPP_LIMIT_TYPE_SCALE), val | 131 | .type = (DRM_EXYNOS_IPP_LIMIT_TYPE_SCALE), val |
131 | 132 | ||
132 | int exynos_drm_ipp_register(struct drm_device *dev, struct exynos_drm_ipp *ipp, | 133 | int exynos_drm_ipp_register(struct device *dev, struct exynos_drm_ipp *ipp, |
133 | const struct exynos_drm_ipp_funcs *funcs, unsigned int caps, | 134 | const struct exynos_drm_ipp_funcs *funcs, unsigned int caps, |
134 | const struct exynos_drm_ipp_formats *formats, | 135 | const struct exynos_drm_ipp_formats *formats, |
135 | unsigned int num_formats, const char *name); | 136 | unsigned int num_formats, const char *name); |
136 | void exynos_drm_ipp_unregister(struct drm_device *dev, | 137 | void exynos_drm_ipp_unregister(struct device *dev, |
137 | struct exynos_drm_ipp *ipp); | 138 | struct exynos_drm_ipp *ipp); |
138 | 139 | ||
139 | void exynos_drm_ipp_task_done(struct exynos_drm_ipp_task *task, int ret); | 140 | void exynos_drm_ipp_task_done(struct exynos_drm_ipp_task *task, int ret); |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c index 05abfed6f7f8..b6586fa95ad1 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c | |||
@@ -243,9 +243,10 @@ static int rotator_bind(struct device *dev, struct device *master, void *data) | |||
243 | struct exynos_drm_ipp *ipp = &rot->ipp; | 243 | struct exynos_drm_ipp *ipp = &rot->ipp; |
244 | 244 | ||
245 | rot->drm_dev = drm_dev; | 245 | rot->drm_dev = drm_dev; |
246 | ipp->drm_dev = drm_dev; | ||
246 | exynos_drm_register_dma(drm_dev, dev); | 247 | exynos_drm_register_dma(drm_dev, dev); |
247 | 248 | ||
248 | exynos_drm_ipp_register(drm_dev, ipp, &ipp_funcs, | 249 | exynos_drm_ipp_register(dev, ipp, &ipp_funcs, |
249 | DRM_EXYNOS_IPP_CAP_CROP | DRM_EXYNOS_IPP_CAP_ROTATE, | 250 | DRM_EXYNOS_IPP_CAP_CROP | DRM_EXYNOS_IPP_CAP_ROTATE, |
250 | rot->formats, rot->num_formats, "rotator"); | 251 | rot->formats, rot->num_formats, "rotator"); |
251 | 252 | ||
@@ -258,10 +259,9 @@ static void rotator_unbind(struct device *dev, struct device *master, | |||
258 | void *data) | 259 | void *data) |
259 | { | 260 | { |
260 | struct rot_context *rot = dev_get_drvdata(dev); | 261 | struct rot_context *rot = dev_get_drvdata(dev); |
261 | struct drm_device *drm_dev = data; | ||
262 | struct exynos_drm_ipp *ipp = &rot->ipp; | 262 | struct exynos_drm_ipp *ipp = &rot->ipp; |
263 | 263 | ||
264 | exynos_drm_ipp_unregister(drm_dev, ipp); | 264 | exynos_drm_ipp_unregister(dev, ipp); |
265 | exynos_drm_unregister_dma(rot->drm_dev, rot->dev); | 265 | exynos_drm_unregister_dma(rot->drm_dev, rot->dev); |
266 | } | 266 | } |
267 | 267 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_scaler.c b/drivers/gpu/drm/exynos/exynos_drm_scaler.c index ed1dd1aec902..f1cbdd1e6e3c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_scaler.c +++ b/drivers/gpu/drm/exynos/exynos_drm_scaler.c | |||
@@ -451,9 +451,10 @@ static int scaler_bind(struct device *dev, struct device *master, void *data) | |||
451 | struct exynos_drm_ipp *ipp = &scaler->ipp; | 451 | struct exynos_drm_ipp *ipp = &scaler->ipp; |
452 | 452 | ||
453 | scaler->drm_dev = drm_dev; | 453 | scaler->drm_dev = drm_dev; |
454 | ipp->drm_dev = drm_dev; | ||
454 | exynos_drm_register_dma(drm_dev, dev); | 455 | exynos_drm_register_dma(drm_dev, dev); |
455 | 456 | ||
456 | exynos_drm_ipp_register(drm_dev, ipp, &ipp_funcs, | 457 | exynos_drm_ipp_register(dev, ipp, &ipp_funcs, |
457 | DRM_EXYNOS_IPP_CAP_CROP | DRM_EXYNOS_IPP_CAP_ROTATE | | 458 | DRM_EXYNOS_IPP_CAP_CROP | DRM_EXYNOS_IPP_CAP_ROTATE | |
458 | DRM_EXYNOS_IPP_CAP_SCALE | DRM_EXYNOS_IPP_CAP_CONVERT, | 459 | DRM_EXYNOS_IPP_CAP_SCALE | DRM_EXYNOS_IPP_CAP_CONVERT, |
459 | scaler->scaler_data->formats, | 460 | scaler->scaler_data->formats, |
@@ -468,10 +469,9 @@ static void scaler_unbind(struct device *dev, struct device *master, | |||
468 | void *data) | 469 | void *data) |
469 | { | 470 | { |
470 | struct scaler_context *scaler = dev_get_drvdata(dev); | 471 | struct scaler_context *scaler = dev_get_drvdata(dev); |
471 | struct drm_device *drm_dev = data; | ||
472 | struct exynos_drm_ipp *ipp = &scaler->ipp; | 472 | struct exynos_drm_ipp *ipp = &scaler->ipp; |
473 | 473 | ||
474 | exynos_drm_ipp_unregister(drm_dev, ipp); | 474 | exynos_drm_ipp_unregister(dev, ipp); |
475 | exynos_drm_unregister_dma(scaler->drm_dev, scaler->dev); | 475 | exynos_drm_unregister_dma(scaler->drm_dev, scaler->dev); |
476 | } | 476 | } |
477 | 477 | ||