diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-08-18 14:00:16 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-08-19 04:58:55 -0400 |
commit | 1832040d010ecf41671104259f51f6368fcfcb5b (patch) | |
tree | ca21499bb8a7c45705b12ed4c62845c801a7f199 | |
parent | ee4d7899f62724d4bda28aa05bf795ef93aacd47 (diff) |
drm: Allow drivers to modify plane_state in prepare_fb/cleanup_fb
The drivers have to modify the atomic plane state during the prepare_fb
callback so they track allocations, reservations and dependencies for
this atomic operation involving this fb. In particular, how else do we
set the plane->fence from the framebuffer!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20160818180017.20508-1-chris@chris-wilson.co.uk
-rw-r--r-- | drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_drv.h | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_plane.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/tegra/dc.c | 4 | ||||
-rw-r--r-- | include/drm/drm_modeset_helper_vtables.h | 4 |
11 files changed, 22 insertions, 22 deletions
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c index 146809a97a07..72e6b7dd457b 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | |||
@@ -755,7 +755,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, | |||
755 | } | 755 | } |
756 | 756 | ||
757 | static int atmel_hlcdc_plane_prepare_fb(struct drm_plane *p, | 757 | static int atmel_hlcdc_plane_prepare_fb(struct drm_plane *p, |
758 | const struct drm_plane_state *new_state) | 758 | struct drm_plane_state *new_state) |
759 | { | 759 | { |
760 | /* | 760 | /* |
761 | * FIXME: we should avoid this const -> non-const cast but it's | 761 | * FIXME: we should avoid this const -> non-const cast but it's |
@@ -780,7 +780,7 @@ static int atmel_hlcdc_plane_prepare_fb(struct drm_plane *p, | |||
780 | } | 780 | } |
781 | 781 | ||
782 | static void atmel_hlcdc_plane_cleanup_fb(struct drm_plane *p, | 782 | static void atmel_hlcdc_plane_cleanup_fb(struct drm_plane *p, |
783 | const struct drm_plane_state *old_state) | 783 | struct drm_plane_state *old_state) |
784 | { | 784 | { |
785 | /* | 785 | /* |
786 | * FIXME: we should avoid this const -> non-const cast but it's | 786 | * FIXME: we should avoid this const -> non-const cast but it's |
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c index e50467a0deb0..2a3e92976700 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | |||
@@ -171,13 +171,13 @@ static void fsl_dcu_drm_plane_atomic_update(struct drm_plane *plane, | |||
171 | 171 | ||
172 | static void | 172 | static void |
173 | fsl_dcu_drm_plane_cleanup_fb(struct drm_plane *plane, | 173 | fsl_dcu_drm_plane_cleanup_fb(struct drm_plane *plane, |
174 | const struct drm_plane_state *new_state) | 174 | struct drm_plane_state *new_state) |
175 | { | 175 | { |
176 | } | 176 | } |
177 | 177 | ||
178 | static int | 178 | static int |
179 | fsl_dcu_drm_plane_prepare_fb(struct drm_plane *plane, | 179 | fsl_dcu_drm_plane_prepare_fb(struct drm_plane *plane, |
180 | const struct drm_plane_state *new_state) | 180 | struct drm_plane_state *new_state) |
181 | { | 181 | { |
182 | return 0; | 182 | return 0; |
183 | } | 183 | } |
diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c index eaa3df75fc5c..943f708a9dd1 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | |||
@@ -818,14 +818,14 @@ static void ade_disable_channel(struct ade_plane *aplane) | |||
818 | } | 818 | } |
819 | 819 | ||
820 | static int ade_plane_prepare_fb(struct drm_plane *plane, | 820 | static int ade_plane_prepare_fb(struct drm_plane *plane, |
821 | const struct drm_plane_state *new_state) | 821 | struct drm_plane_state *new_state) |
822 | { | 822 | { |
823 | /* do nothing */ | 823 | /* do nothing */ |
824 | return 0; | 824 | return 0; |
825 | } | 825 | } |
826 | 826 | ||
827 | static void ade_plane_cleanup_fb(struct drm_plane *plane, | 827 | static void ade_plane_cleanup_fb(struct drm_plane *plane, |
828 | const struct drm_plane_state *old_state) | 828 | struct drm_plane_state *old_state) |
829 | { | 829 | { |
830 | /* do nothing */ | 830 | /* do nothing */ |
831 | } | 831 | } |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 3902e57d9df5..54bbb9c70a75 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -13976,7 +13976,7 @@ static const struct drm_crtc_funcs intel_crtc_funcs = { | |||
13976 | */ | 13976 | */ |
13977 | int | 13977 | int |
13978 | intel_prepare_plane_fb(struct drm_plane *plane, | 13978 | intel_prepare_plane_fb(struct drm_plane *plane, |
13979 | const struct drm_plane_state *new_state) | 13979 | struct drm_plane_state *new_state) |
13980 | { | 13980 | { |
13981 | struct drm_device *dev = plane->dev; | 13981 | struct drm_device *dev = plane->dev; |
13982 | struct drm_framebuffer *fb = new_state->fb; | 13982 | struct drm_framebuffer *fb = new_state->fb; |
@@ -14058,7 +14058,7 @@ intel_prepare_plane_fb(struct drm_plane *plane, | |||
14058 | */ | 14058 | */ |
14059 | void | 14059 | void |
14060 | intel_cleanup_plane_fb(struct drm_plane *plane, | 14060 | intel_cleanup_plane_fb(struct drm_plane *plane, |
14061 | const struct drm_plane_state *old_state) | 14061 | struct drm_plane_state *old_state) |
14062 | { | 14062 | { |
14063 | struct drm_device *dev = plane->dev; | 14063 | struct drm_device *dev = plane->dev; |
14064 | struct intel_plane_state *old_intel_state; | 14064 | struct intel_plane_state *old_intel_state; |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index c29a429cbc45..b37b8ef0c745 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
@@ -1225,9 +1225,9 @@ void intel_finish_page_flip_cs(struct drm_i915_private *dev_priv, int pipe); | |||
1225 | void intel_finish_page_flip_mmio(struct drm_i915_private *dev_priv, int pipe); | 1225 | void intel_finish_page_flip_mmio(struct drm_i915_private *dev_priv, int pipe); |
1226 | void intel_check_page_flip(struct drm_i915_private *dev_priv, int pipe); | 1226 | void intel_check_page_flip(struct drm_i915_private *dev_priv, int pipe); |
1227 | int intel_prepare_plane_fb(struct drm_plane *plane, | 1227 | int intel_prepare_plane_fb(struct drm_plane *plane, |
1228 | const struct drm_plane_state *new_state); | 1228 | struct drm_plane_state *new_state); |
1229 | void intel_cleanup_plane_fb(struct drm_plane *plane, | 1229 | void intel_cleanup_plane_fb(struct drm_plane *plane, |
1230 | const struct drm_plane_state *old_state); | 1230 | struct drm_plane_state *old_state); |
1231 | int intel_plane_atomic_get_property(struct drm_plane *plane, | 1231 | int intel_plane_atomic_get_property(struct drm_plane *plane, |
1232 | const struct drm_plane_state *state, | 1232 | const struct drm_plane_state *state, |
1233 | struct drm_property *property, | 1233 | struct drm_property *property, |
diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c index 9f96dfe67769..7c9626d92019 100644 --- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c +++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c | |||
@@ -99,7 +99,7 @@ static const struct drm_plane_funcs mdp4_plane_funcs = { | |||
99 | }; | 99 | }; |
100 | 100 | ||
101 | static int mdp4_plane_prepare_fb(struct drm_plane *plane, | 101 | static int mdp4_plane_prepare_fb(struct drm_plane *plane, |
102 | const struct drm_plane_state *new_state) | 102 | struct drm_plane_state *new_state) |
103 | { | 103 | { |
104 | struct mdp4_plane *mdp4_plane = to_mdp4_plane(plane); | 104 | struct mdp4_plane *mdp4_plane = to_mdp4_plane(plane); |
105 | struct mdp4_kms *mdp4_kms = get_kms(plane); | 105 | struct mdp4_kms *mdp4_kms = get_kms(plane); |
@@ -113,7 +113,7 @@ static int mdp4_plane_prepare_fb(struct drm_plane *plane, | |||
113 | } | 113 | } |
114 | 114 | ||
115 | static void mdp4_plane_cleanup_fb(struct drm_plane *plane, | 115 | static void mdp4_plane_cleanup_fb(struct drm_plane *plane, |
116 | const struct drm_plane_state *old_state) | 116 | struct drm_plane_state *old_state) |
117 | { | 117 | { |
118 | struct mdp4_plane *mdp4_plane = to_mdp4_plane(plane); | 118 | struct mdp4_plane *mdp4_plane = to_mdp4_plane(plane); |
119 | struct mdp4_kms *mdp4_kms = get_kms(plane); | 119 | struct mdp4_kms *mdp4_kms = get_kms(plane); |
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c index a02a24e75ba6..ba8f43278a44 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | |||
@@ -250,7 +250,7 @@ static const struct drm_plane_funcs mdp5_plane_funcs = { | |||
250 | }; | 250 | }; |
251 | 251 | ||
252 | static int mdp5_plane_prepare_fb(struct drm_plane *plane, | 252 | static int mdp5_plane_prepare_fb(struct drm_plane *plane, |
253 | const struct drm_plane_state *new_state) | 253 | struct drm_plane_state *new_state) |
254 | { | 254 | { |
255 | struct mdp5_plane *mdp5_plane = to_mdp5_plane(plane); | 255 | struct mdp5_plane *mdp5_plane = to_mdp5_plane(plane); |
256 | struct mdp5_kms *mdp5_kms = get_kms(plane); | 256 | struct mdp5_kms *mdp5_kms = get_kms(plane); |
@@ -264,7 +264,7 @@ static int mdp5_plane_prepare_fb(struct drm_plane *plane, | |||
264 | } | 264 | } |
265 | 265 | ||
266 | static void mdp5_plane_cleanup_fb(struct drm_plane *plane, | 266 | static void mdp5_plane_cleanup_fb(struct drm_plane *plane, |
267 | const struct drm_plane_state *old_state) | 267 | struct drm_plane_state *old_state) |
268 | { | 268 | { |
269 | struct mdp5_plane *mdp5_plane = to_mdp5_plane(plane); | 269 | struct mdp5_plane *mdp5_plane = to_mdp5_plane(plane); |
270 | struct mdp5_kms *mdp5_kms = get_kms(plane); | 270 | struct mdp5_kms *mdp5_kms = get_kms(plane); |
diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c index 4c7727e6be7c..66ac8c40db26 100644 --- a/drivers/gpu/drm/omapdrm/omap_plane.c +++ b/drivers/gpu/drm/omapdrm/omap_plane.c | |||
@@ -60,7 +60,7 @@ to_omap_plane_state(struct drm_plane_state *state) | |||
60 | } | 60 | } |
61 | 61 | ||
62 | static int omap_plane_prepare_fb(struct drm_plane *plane, | 62 | static int omap_plane_prepare_fb(struct drm_plane *plane, |
63 | const struct drm_plane_state *new_state) | 63 | struct drm_plane_state *new_state) |
64 | { | 64 | { |
65 | if (!new_state->fb) | 65 | if (!new_state->fb) |
66 | return 0; | 66 | return 0; |
@@ -69,7 +69,7 @@ static int omap_plane_prepare_fb(struct drm_plane *plane, | |||
69 | } | 69 | } |
70 | 70 | ||
71 | static void omap_plane_cleanup_fb(struct drm_plane *plane, | 71 | static void omap_plane_cleanup_fb(struct drm_plane *plane, |
72 | const struct drm_plane_state *old_state) | 72 | struct drm_plane_state *old_state) |
73 | { | 73 | { |
74 | if (old_state->fb) | 74 | if (old_state->fb) |
75 | omap_framebuffer_unpin(old_state->fb); | 75 | omap_framebuffer_unpin(old_state->fb); |
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index ec8ad005835c..f417b49991dd 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c | |||
@@ -567,7 +567,7 @@ static void vop_plane_destroy(struct drm_plane *plane) | |||
567 | } | 567 | } |
568 | 568 | ||
569 | static int vop_plane_prepare_fb(struct drm_plane *plane, | 569 | static int vop_plane_prepare_fb(struct drm_plane *plane, |
570 | const struct drm_plane_state *new_state) | 570 | struct drm_plane_state *new_state) |
571 | { | 571 | { |
572 | if (plane->state->fb) | 572 | if (plane->state->fb) |
573 | drm_framebuffer_reference(plane->state->fb); | 573 | drm_framebuffer_reference(plane->state->fb); |
@@ -576,7 +576,7 @@ static int vop_plane_prepare_fb(struct drm_plane *plane, | |||
576 | } | 576 | } |
577 | 577 | ||
578 | static void vop_plane_cleanup_fb(struct drm_plane *plane, | 578 | static void vop_plane_cleanup_fb(struct drm_plane *plane, |
579 | const struct drm_plane_state *old_state) | 579 | struct drm_plane_state *old_state) |
580 | { | 580 | { |
581 | if (old_state->fb) | 581 | if (old_state->fb) |
582 | drm_framebuffer_unreference(old_state->fb); | 582 | drm_framebuffer_unreference(old_state->fb); |
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 8495bd01b544..a02730f90861 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c | |||
@@ -481,13 +481,13 @@ static const struct drm_plane_funcs tegra_primary_plane_funcs = { | |||
481 | }; | 481 | }; |
482 | 482 | ||
483 | static int tegra_plane_prepare_fb(struct drm_plane *plane, | 483 | static int tegra_plane_prepare_fb(struct drm_plane *plane, |
484 | const struct drm_plane_state *new_state) | 484 | struct drm_plane_state *new_state) |
485 | { | 485 | { |
486 | return 0; | 486 | return 0; |
487 | } | 487 | } |
488 | 488 | ||
489 | static void tegra_plane_cleanup_fb(struct drm_plane *plane, | 489 | static void tegra_plane_cleanup_fb(struct drm_plane *plane, |
490 | const struct drm_plane_state *old_fb) | 490 | struct drm_plane_state *old_fb) |
491 | { | 491 | { |
492 | } | 492 | } |
493 | 493 | ||
diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h index 686feec6b4c8..6c8d3dad66ec 100644 --- a/include/drm/drm_modeset_helper_vtables.h +++ b/include/drm/drm_modeset_helper_vtables.h | |||
@@ -855,7 +855,7 @@ struct drm_plane_helper_funcs { | |||
855 | * everything else must complete successfully. | 855 | * everything else must complete successfully. |
856 | */ | 856 | */ |
857 | int (*prepare_fb)(struct drm_plane *plane, | 857 | int (*prepare_fb)(struct drm_plane *plane, |
858 | const struct drm_plane_state *new_state); | 858 | struct drm_plane_state *new_state); |
859 | /** | 859 | /** |
860 | * @cleanup_fb: | 860 | * @cleanup_fb: |
861 | * | 861 | * |
@@ -866,7 +866,7 @@ struct drm_plane_helper_funcs { | |||
866 | * transitional plane helpers, but it is optional. | 866 | * transitional plane helpers, but it is optional. |
867 | */ | 867 | */ |
868 | void (*cleanup_fb)(struct drm_plane *plane, | 868 | void (*cleanup_fb)(struct drm_plane *plane, |
869 | const struct drm_plane_state *old_state); | 869 | struct drm_plane_state *old_state); |
870 | 870 | ||
871 | /** | 871 | /** |
872 | * @atomic_check: | 872 | * @atomic_check: |