diff options
author | Boris BREZILLON <boris.brezillon@free-electrons.com> | 2014-11-14 13:30:30 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2014-11-14 18:29:14 -0500 |
commit | d7f8db5300d1f50b5631796086dbd4efc5b5d707 (patch) | |
tree | fc408a6376c135b4f328051c03cfb16fbd3f9f51 | |
parent | 8bd4ae202813ac04f35dacf43263e1cf96743292 (diff) |
drm: flip-work: change drm_flip_work_init prototype
Now that we're using lists instead of kfifo to store drm flip-work tasks
we do not need the size parameter passed to drm_flip_work_init function
anymore.
Moreover this function cannot fail anymore, we can thus remove the return
code.
Modify drm_flip_work_init users to take account of these changes.
[airlied: fixed two unused variable warnings]
Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/drm_flip_work.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c | 20 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c | 17 | ||||
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_plane.c | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 6 | ||||
-rw-r--r-- | include/drm/drm_flip_work.h | 2 |
6 files changed, 12 insertions, 55 deletions
diff --git a/drivers/gpu/drm/drm_flip_work.c b/drivers/gpu/drm/drm_flip_work.c index 6f4ae5b655d3..43d9b950ef9f 100644 --- a/drivers/gpu/drm/drm_flip_work.c +++ b/drivers/gpu/drm/drm_flip_work.c | |||
@@ -136,16 +136,12 @@ static void flip_worker(struct work_struct *w) | |||
136 | /** | 136 | /** |
137 | * drm_flip_work_init - initialize flip-work | 137 | * drm_flip_work_init - initialize flip-work |
138 | * @work: the flip-work to initialize | 138 | * @work: the flip-work to initialize |
139 | * @size: the max queue depth | ||
140 | * @name: debug name | 139 | * @name: debug name |
141 | * @func: the callback work function | 140 | * @func: the callback work function |
142 | * | 141 | * |
143 | * Initializes/allocates resources for the flip-work | 142 | * Initializes/allocates resources for the flip-work |
144 | * | ||
145 | * RETURNS: | ||
146 | * Zero on success, error code on failure. | ||
147 | */ | 143 | */ |
148 | int drm_flip_work_init(struct drm_flip_work *work, int size, | 144 | void drm_flip_work_init(struct drm_flip_work *work, |
149 | const char *name, drm_flip_func_t func) | 145 | const char *name, drm_flip_func_t func) |
150 | { | 146 | { |
151 | work->name = name; | 147 | work->name = name; |
@@ -155,8 +151,6 @@ int drm_flip_work_init(struct drm_flip_work *work, int size, | |||
155 | work->func = func; | 151 | work->func = func; |
156 | 152 | ||
157 | INIT_WORK(&work->worker, flip_worker); | 153 | INIT_WORK(&work->worker, flip_worker); |
158 | |||
159 | return 0; | ||
160 | } | 154 | } |
161 | EXPORT_SYMBOL(drm_flip_work_init); | 155 | EXPORT_SYMBOL(drm_flip_work_init); |
162 | 156 | ||
diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c index 7d00f7fb5773..1ca87ae53d35 100644 --- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c +++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c | |||
@@ -757,13 +757,10 @@ struct drm_crtc *mdp4_crtc_init(struct drm_device *dev, | |||
757 | { | 757 | { |
758 | struct drm_crtc *crtc = NULL; | 758 | struct drm_crtc *crtc = NULL; |
759 | struct mdp4_crtc *mdp4_crtc; | 759 | struct mdp4_crtc *mdp4_crtc; |
760 | int ret; | ||
761 | 760 | ||
762 | mdp4_crtc = kzalloc(sizeof(*mdp4_crtc), GFP_KERNEL); | 761 | mdp4_crtc = kzalloc(sizeof(*mdp4_crtc), GFP_KERNEL); |
763 | if (!mdp4_crtc) { | 762 | if (!mdp4_crtc) |
764 | ret = -ENOMEM; | 763 | return ERR_PTR(-ENOMEM); |
765 | goto fail; | ||
766 | } | ||
767 | 764 | ||
768 | crtc = &mdp4_crtc->base; | 765 | crtc = &mdp4_crtc->base; |
769 | 766 | ||
@@ -784,12 +781,9 @@ struct drm_crtc *mdp4_crtc_init(struct drm_device *dev, | |||
784 | 781 | ||
785 | spin_lock_init(&mdp4_crtc->cursor.lock); | 782 | spin_lock_init(&mdp4_crtc->cursor.lock); |
786 | 783 | ||
787 | ret = drm_flip_work_init(&mdp4_crtc->unref_fb_work, 16, | 784 | drm_flip_work_init(&mdp4_crtc->unref_fb_work, |
788 | "unref fb", unref_fb_worker); | 785 | "unref fb", unref_fb_worker); |
789 | if (ret) | 786 | drm_flip_work_init(&mdp4_crtc->unref_cursor_work, |
790 | goto fail; | ||
791 | |||
792 | ret = drm_flip_work_init(&mdp4_crtc->unref_cursor_work, 64, | ||
793 | "unref cursor", unref_cursor_worker); | 787 | "unref cursor", unref_cursor_worker); |
794 | 788 | ||
795 | INIT_FENCE_CB(&mdp4_crtc->pageflip_cb, pageflip_cb); | 789 | INIT_FENCE_CB(&mdp4_crtc->pageflip_cb, pageflip_cb); |
@@ -800,10 +794,4 @@ struct drm_crtc *mdp4_crtc_init(struct drm_device *dev, | |||
800 | mdp4_plane_install_properties(mdp4_crtc->plane, &crtc->base); | 794 | mdp4_plane_install_properties(mdp4_crtc->plane, &crtc->base); |
801 | 795 | ||
802 | return crtc; | 796 | return crtc; |
803 | |||
804 | fail: | ||
805 | if (crtc) | ||
806 | mdp4_crtc_destroy(crtc); | ||
807 | |||
808 | return ERR_PTR(ret); | ||
809 | } | 797 | } |
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c index ebe2e60f3ab1..2979a2cc82a4 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c | |||
@@ -534,13 +534,10 @@ struct drm_crtc *mdp5_crtc_init(struct drm_device *dev, | |||
534 | { | 534 | { |
535 | struct drm_crtc *crtc = NULL; | 535 | struct drm_crtc *crtc = NULL; |
536 | struct mdp5_crtc *mdp5_crtc; | 536 | struct mdp5_crtc *mdp5_crtc; |
537 | int ret; | ||
538 | 537 | ||
539 | mdp5_crtc = kzalloc(sizeof(*mdp5_crtc), GFP_KERNEL); | 538 | mdp5_crtc = kzalloc(sizeof(*mdp5_crtc), GFP_KERNEL); |
540 | if (!mdp5_crtc) { | 539 | if (!mdp5_crtc) |
541 | ret = -ENOMEM; | 540 | return ERR_PTR(-ENOMEM); |
542 | goto fail; | ||
543 | } | ||
544 | 541 | ||
545 | crtc = &mdp5_crtc->base; | 542 | crtc = &mdp5_crtc->base; |
546 | 543 | ||
@@ -553,10 +550,8 @@ struct drm_crtc *mdp5_crtc_init(struct drm_device *dev, | |||
553 | snprintf(mdp5_crtc->name, sizeof(mdp5_crtc->name), "%s:%d", | 550 | snprintf(mdp5_crtc->name, sizeof(mdp5_crtc->name), "%s:%d", |
554 | pipe2name(mdp5_plane_pipe(plane)), id); | 551 | pipe2name(mdp5_plane_pipe(plane)), id); |
555 | 552 | ||
556 | ret = drm_flip_work_init(&mdp5_crtc->unref_fb_work, 16, | 553 | drm_flip_work_init(&mdp5_crtc->unref_fb_work, |
557 | "unref fb", unref_fb_worker); | 554 | "unref fb", unref_fb_worker); |
558 | if (ret) | ||
559 | goto fail; | ||
560 | 555 | ||
561 | INIT_FENCE_CB(&mdp5_crtc->pageflip_cb, pageflip_cb); | 556 | INIT_FENCE_CB(&mdp5_crtc->pageflip_cb, pageflip_cb); |
562 | 557 | ||
@@ -566,10 +561,4 @@ struct drm_crtc *mdp5_crtc_init(struct drm_device *dev, | |||
566 | mdp5_plane_install_properties(mdp5_crtc->plane, &crtc->base); | 561 | mdp5_plane_install_properties(mdp5_crtc->plane, &crtc->base); |
567 | 562 | ||
568 | return crtc; | 563 | return crtc; |
569 | |||
570 | fail: | ||
571 | if (crtc) | ||
572 | mdp5_crtc_destroy(crtc); | ||
573 | |||
574 | return ERR_PTR(ret); | ||
575 | } | 564 | } |
diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c index 891a4dc608af..0ad740132ac3 100644 --- a/drivers/gpu/drm/omapdrm/omap_plane.c +++ b/drivers/gpu/drm/omapdrm/omap_plane.c | |||
@@ -394,14 +394,10 @@ struct drm_plane *omap_plane_init(struct drm_device *dev, | |||
394 | 394 | ||
395 | omap_plane = kzalloc(sizeof(*omap_plane), GFP_KERNEL); | 395 | omap_plane = kzalloc(sizeof(*omap_plane), GFP_KERNEL); |
396 | if (!omap_plane) | 396 | if (!omap_plane) |
397 | goto fail; | 397 | return NULL; |
398 | 398 | ||
399 | ret = drm_flip_work_init(&omap_plane->unpin_work, 16, | 399 | drm_flip_work_init(&omap_plane->unpin_work, |
400 | "unpin", unpin_worker); | 400 | "unpin", unpin_worker); |
401 | if (ret) { | ||
402 | dev_err(dev->dev, "could not allocate unpin FIFO\n"); | ||
403 | goto fail; | ||
404 | } | ||
405 | 401 | ||
406 | omap_plane->nformats = omap_framebuffer_get_formats( | 402 | omap_plane->nformats = omap_framebuffer_get_formats( |
407 | omap_plane->formats, ARRAY_SIZE(omap_plane->formats), | 403 | omap_plane->formats, ARRAY_SIZE(omap_plane->formats), |
@@ -443,10 +439,4 @@ struct drm_plane *omap_plane_init(struct drm_device *dev, | |||
443 | omap_plane->info.zorder = id; | 439 | omap_plane->info.zorder = id; |
444 | 440 | ||
445 | return plane; | 441 | return plane; |
446 | |||
447 | fail: | ||
448 | if (plane) | ||
449 | omap_plane_destroy(plane); | ||
450 | |||
451 | return NULL; | ||
452 | } | 442 | } |
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c index 29ec98baffd1..c73588483be0 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c | |||
@@ -665,12 +665,8 @@ struct drm_crtc *tilcdc_crtc_create(struct drm_device *dev) | |||
665 | tilcdc_crtc->dpms = DRM_MODE_DPMS_OFF; | 665 | tilcdc_crtc->dpms = DRM_MODE_DPMS_OFF; |
666 | init_waitqueue_head(&tilcdc_crtc->frame_done_wq); | 666 | init_waitqueue_head(&tilcdc_crtc->frame_done_wq); |
667 | 667 | ||
668 | ret = drm_flip_work_init(&tilcdc_crtc->unref_work, 16, | 668 | drm_flip_work_init(&tilcdc_crtc->unref_work, |
669 | "unref", unref_worker); | 669 | "unref", unref_worker); |
670 | if (ret) { | ||
671 | dev_err(dev->dev, "could not allocate unref FIFO\n"); | ||
672 | goto fail; | ||
673 | } | ||
674 | 670 | ||
675 | ret = drm_crtc_init(dev, crtc, &tilcdc_crtc_funcs); | 671 | ret = drm_crtc_init(dev, crtc, &tilcdc_crtc_funcs); |
676 | if (ret < 0) | 672 | if (ret < 0) |
diff --git a/include/drm/drm_flip_work.h b/include/drm/drm_flip_work.h index 3fcb4c44c9e0..d387cf06ae05 100644 --- a/include/drm/drm_flip_work.h +++ b/include/drm/drm_flip_work.h | |||
@@ -85,7 +85,7 @@ void drm_flip_work_queue_task(struct drm_flip_work *work, | |||
85 | void drm_flip_work_queue(struct drm_flip_work *work, void *val); | 85 | void drm_flip_work_queue(struct drm_flip_work *work, void *val); |
86 | void drm_flip_work_commit(struct drm_flip_work *work, | 86 | void drm_flip_work_commit(struct drm_flip_work *work, |
87 | struct workqueue_struct *wq); | 87 | struct workqueue_struct *wq); |
88 | int drm_flip_work_init(struct drm_flip_work *work, int size, | 88 | void drm_flip_work_init(struct drm_flip_work *work, |
89 | const char *name, drm_flip_func_t func); | 89 | const char *name, drm_flip_func_t func); |
90 | void drm_flip_work_cleanup(struct drm_flip_work *work); | 90 | void drm_flip_work_cleanup(struct drm_flip_work *work); |
91 | 91 | ||