aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/drm_crtc.c22
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_plane.c2
-rw-r--r--drivers/gpu/drm/i915/intel_sprite.c2
-rw-r--r--include/drm/drm_crtc.h3
4 files changed, 21 insertions, 8 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 7710bcb4bd8d..5e818a808ace 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -557,7 +557,8 @@ EXPORT_SYMBOL(drm_encoder_cleanup);
557int drm_plane_init(struct drm_device *dev, struct drm_plane *plane, 557int drm_plane_init(struct drm_device *dev, struct drm_plane *plane,
558 unsigned long possible_crtcs, 558 unsigned long possible_crtcs,
559 const struct drm_plane_funcs *funcs, 559 const struct drm_plane_funcs *funcs,
560 const uint32_t *formats, uint32_t format_count) 560 const uint32_t *formats, uint32_t format_count,
561 bool priv)
561{ 562{
562 mutex_lock(&dev->mode_config.mutex); 563 mutex_lock(&dev->mode_config.mutex);
563 564
@@ -577,8 +578,16 @@ int drm_plane_init(struct drm_device *dev, struct drm_plane *plane,
577 plane->format_count = format_count; 578 plane->format_count = format_count;
578 plane->possible_crtcs = possible_crtcs; 579 plane->possible_crtcs = possible_crtcs;
579 580
580 list_add_tail(&plane->head, &dev->mode_config.plane_list); 581 /* private planes are not exposed to userspace, but depending on
581 dev->mode_config.num_plane++; 582 * display hardware, might be convenient to allow sharing programming
583 * for the scanout engine with the crtc implementation.
584 */
585 if (!priv) {
586 list_add_tail(&plane->head, &dev->mode_config.plane_list);
587 dev->mode_config.num_plane++;
588 } else {
589 INIT_LIST_HEAD(&plane->head);
590 }
582 591
583 mutex_unlock(&dev->mode_config.mutex); 592 mutex_unlock(&dev->mode_config.mutex);
584 593
@@ -593,8 +602,11 @@ void drm_plane_cleanup(struct drm_plane *plane)
593 mutex_lock(&dev->mode_config.mutex); 602 mutex_lock(&dev->mode_config.mutex);
594 kfree(plane->format_types); 603 kfree(plane->format_types);
595 drm_mode_object_put(dev, &plane->base); 604 drm_mode_object_put(dev, &plane->base);
596 list_del(&plane->head); 605 /* if not added to a list, it must be a private plane */
597 dev->mode_config.num_plane--; 606 if (!list_empty(&plane->head)) {
607 list_del(&plane->head);
608 dev->mode_config.num_plane--;
609 }
598 mutex_unlock(&dev->mode_config.mutex); 610 mutex_unlock(&dev->mode_config.mutex);
599} 611}
600EXPORT_SYMBOL(drm_plane_cleanup); 612EXPORT_SYMBOL(drm_plane_cleanup);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c
index c785e34ccff9..bdcf770aa22e 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_plane.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c
@@ -117,7 +117,7 @@ int exynos_plane_init(struct drm_device *dev, unsigned int nr)
117 117
118 /* TODO: format */ 118 /* TODO: format */
119 return drm_plane_init(dev, &exynos_plane->base, possible_crtcs, 119 return drm_plane_init(dev, &exynos_plane->base, possible_crtcs,
120 &exynos_plane_funcs, NULL, 0); 120 &exynos_plane_funcs, NULL, 0, false);
121} 121}
122 122
123int exynos_plane_set_zpos_ioctl(struct drm_device *dev, void *data, 123int exynos_plane_set_zpos_ioctl(struct drm_device *dev, void *data,
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index b26e7c46a752..d13989fda501 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -659,7 +659,7 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe)
659 possible_crtcs = (1 << pipe); 659 possible_crtcs = (1 << pipe);
660 ret = drm_plane_init(dev, &intel_plane->base, possible_crtcs, 660 ret = drm_plane_init(dev, &intel_plane->base, possible_crtcs,
661 &intel_plane_funcs, snb_plane_formats, 661 &intel_plane_funcs, snb_plane_formats,
662 ARRAY_SIZE(snb_plane_formats)); 662 ARRAY_SIZE(snb_plane_formats), false);
663 if (ret) 663 if (ret)
664 kfree(intel_plane); 664 kfree(intel_plane);
665 665
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 2deb6f99f950..63e4fce67288 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -829,7 +829,8 @@ extern int drm_plane_init(struct drm_device *dev,
829 struct drm_plane *plane, 829 struct drm_plane *plane,
830 unsigned long possible_crtcs, 830 unsigned long possible_crtcs,
831 const struct drm_plane_funcs *funcs, 831 const struct drm_plane_funcs *funcs,
832 const uint32_t *formats, uint32_t format_count); 832 const uint32_t *formats, uint32_t format_count,
833 bool priv);
833extern void drm_plane_cleanup(struct drm_plane *plane); 834extern void drm_plane_cleanup(struct drm_plane *plane);
834 835
835extern void drm_encoder_cleanup(struct drm_encoder *encoder); 836extern void drm_encoder_cleanup(struct drm_encoder *encoder);