* [PATCH 01/13] drm/msm: Stop consulting plane->fb/crtc
@ 2018-04-05 15:13 Ville Syrjala
2018-04-05 15:13 ` [PATCH 02/13] drm/sti: Stop consulting plane->crtc Ville Syrjala
` (17 more replies)
0 siblings, 18 replies; 39+ messages in thread
From: Ville Syrjala @ 2018-04-05 15:13 UTC (permalink / raw)
To: dri-devel; +Cc: linux-arm-msm, intel-gfx, freedreno
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
We want to get rid of plane->fb/crtc on atomic drivers. Stop
looking at them.
v2: Catch the plane->crtc case too
Cc: Rob Clark <robdclark@gmail.com>
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> #v1
---
drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c | 2 +-
drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c
index 6e5e1aa54ce1..99ead8e37c72 100644
--- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c
+++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c
@@ -201,7 +201,7 @@ static void blend_setup(struct drm_crtc *crtc)
int idx = idxs[pipe_id];
if (idx > 0) {
const struct mdp_format *format =
- to_mdp_format(msm_framebuffer_format(plane->fb));
+ to_mdp_format(msm_framebuffer_format(plane->state->fb));
alpha[idx-1] = format->alpha_enable;
}
}
diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
index a9f31da7d45a..f2361f79fdce 100644
--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
@@ -526,7 +526,7 @@ static void mdp5_plane_atomic_async_update(struct drm_plane *plane,
if (plane_enabled(new_state)) {
struct mdp5_ctl *ctl;
struct mdp5_pipeline *pipeline =
- mdp5_crtc_get_pipeline(plane->crtc);
+ mdp5_crtc_get_pipeline(new_state->crtc);
int ret;
ret = mdp5_plane_mode_set(plane, new_state->crtc, new_state->fb,
--
2.16.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 02/13] drm/sti: Stop consulting plane->crtc
2018-04-05 15:13 [PATCH 01/13] drm/msm: Stop consulting plane->fb/crtc Ville Syrjala
@ 2018-04-05 15:13 ` Ville Syrjala
2018-04-05 16:34 ` Daniel Vetter
2018-04-05 15:13 ` [PATCH 03/13] drm/atmel-hlcdc: " Ville Syrjala
` (16 subsequent siblings)
17 siblings, 1 reply; 39+ messages in thread
From: Ville Syrjala @ 2018-04-05 15:13 UTC (permalink / raw)
To: dri-devel; +Cc: Daniel Vetter, intel-gfx, Vincent Abriou, Benjamin Gaignard
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
We want to get rid of plane->crtc on atomic drivers. Stop looking at it.
Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Cc: Vincent Abriou <vincent.abriou@st.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/sti/sti_gdp.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
index 9b2c47051b51..49813d34bdf0 100644
--- a/drivers/gpu/drm/sti/sti_gdp.c
+++ b/drivers/gpu/drm/sti/sti_gdp.c
@@ -211,7 +211,11 @@ static int gdp_dbg_show(struct seq_file *s, void *data)
struct drm_info_node *node = s->private;
struct sti_gdp *gdp = (struct sti_gdp *)node->info_ent->data;
struct drm_plane *drm_plane = &gdp->plane.drm_plane;
- struct drm_crtc *crtc = drm_plane->crtc;
+ struct drm_crtc *crtc;
+
+ drm_modeset_lock(&drm_plane->mutex, NULL);
+ crtc = drm_plane->state->crtc;
+ drm_modeset_unlock(&drm_plane->mutex);
seq_printf(s, "%s: (vaddr = 0x%p)",
sti_plane_to_str(&gdp->plane), gdp->regs);
--
2.16.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 03/13] drm/atmel-hlcdc: Stop consulting plane->crtc
2018-04-05 15:13 [PATCH 01/13] drm/msm: Stop consulting plane->fb/crtc Ville Syrjala
2018-04-05 15:13 ` [PATCH 02/13] drm/sti: Stop consulting plane->crtc Ville Syrjala
@ 2018-04-05 15:13 ` Ville Syrjala
2018-04-05 16:35 ` Daniel Vetter
2018-04-05 15:13 ` [PATCH 04/13] drm/amdgpu/dc: Stop updating plane->fb Ville Syrjala
` (15 subsequent siblings)
17 siblings, 1 reply; 39+ messages in thread
From: Ville Syrjala @ 2018-04-05 15:13 UTC (permalink / raw)
To: dri-devel; +Cc: Boris Brezillon, intel-gfx
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
We want to get rid of plane->crtc on atomic drivers. Stop looking at it.
Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
index e18800ed7cd1..9271c2fa3d79 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
@@ -415,9 +415,10 @@ static void atmel_hlcdc_plane_update_format(struct atmel_hlcdc_plane *plane,
ATMEL_HLCDC_LAYER_FORMAT_CFG, cfg);
}
-static void atmel_hlcdc_plane_update_clut(struct atmel_hlcdc_plane *plane)
+static void atmel_hlcdc_plane_update_clut(struct atmel_hlcdc_plane *plane,
+ struct atmel_hlcdc_plane_state *state)
{
- struct drm_crtc *crtc = plane->base.crtc;
+ struct drm_crtc *crtc = state->base.crtc;
struct drm_color_lut *lut;
int idx;
@@ -782,7 +783,7 @@ static void atmel_hlcdc_plane_atomic_update(struct drm_plane *p,
atmel_hlcdc_plane_update_pos_and_size(plane, state);
atmel_hlcdc_plane_update_general_settings(plane, state);
atmel_hlcdc_plane_update_format(plane, state);
- atmel_hlcdc_plane_update_clut(plane);
+ atmel_hlcdc_plane_update_clut(plane, state);
atmel_hlcdc_plane_update_buffers(plane, state);
atmel_hlcdc_plane_update_disc_area(plane, state);
--
2.16.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 04/13] drm/amdgpu/dc: Stop updating plane->fb
2018-04-05 15:13 [PATCH 01/13] drm/msm: Stop consulting plane->fb/crtc Ville Syrjala
2018-04-05 15:13 ` [PATCH 02/13] drm/sti: Stop consulting plane->crtc Ville Syrjala
2018-04-05 15:13 ` [PATCH 03/13] drm/atmel-hlcdc: " Ville Syrjala
@ 2018-04-05 15:13 ` Ville Syrjala
2018-04-05 16:41 ` Daniel Vetter
2018-04-05 15:13 ` [PATCH 05/13] drm/i915: Stop updating plane->fb/crtc Ville Syrjala
` (14 subsequent siblings)
17 siblings, 1 reply; 39+ messages in thread
From: Ville Syrjala @ 2018-04-05 15:13 UTC (permalink / raw)
To: dri-devel; +Cc: intel-gfx, amd-gfx, Alex Deucher, Christian König
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
We want to get rid of plane->fb on atomic drivers. Stop setting it.
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Cc: amd-gfx@lists.freedesktop.org
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index e42a28e3adc5..91d048bb5574 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -3943,8 +3943,6 @@ static void amdgpu_dm_do_flip(struct drm_crtc *crtc,
/* Flip */
spin_lock_irqsave(&crtc->dev->event_lock, flags);
- /* update crtc fb */
- crtc->primary->fb = fb;
WARN_ON(acrtc->pflip_status != AMDGPU_FLIP_NONE);
WARN_ON(!acrtc_state->stream);
--
2.16.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 05/13] drm/i915: Stop updating plane->fb/crtc
2018-04-05 15:13 [PATCH 01/13] drm/msm: Stop consulting plane->fb/crtc Ville Syrjala
` (2 preceding siblings ...)
2018-04-05 15:13 ` [PATCH 04/13] drm/amdgpu/dc: Stop updating plane->fb Ville Syrjala
@ 2018-04-05 15:13 ` Ville Syrjala
2018-04-05 16:44 ` Daniel Vetter
2018-04-05 17:02 ` [PATCH v2 " Ville Syrjala
2018-04-05 15:13 ` [PATCH 06/13] drm/exynos: Stop updating plane->crtc Ville Syrjala
` (13 subsequent siblings)
17 siblings, 2 replies; 39+ messages in thread
From: Ville Syrjala @ 2018-04-05 15:13 UTC (permalink / raw)
To: dri-devel; +Cc: intel-gfx
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
We want to get rid of plane->fb/crtc on atomic drivers. Stop setting
them.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 415fb8cf2cf4..1912c4f9eb61 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2877,9 +2877,8 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
if (i915_gem_object_is_tiled(obj))
dev_priv->preserve_bios_swizzle = true;
- drm_framebuffer_get(fb);
- primary->fb = primary->state->fb = fb;
- primary->crtc = primary->state->crtc = &intel_crtc->base;
+ plane_state->fb = fb;
+ plane_state->crtc = &intel_crtc->base;
intel_set_plane_visible(to_intel_crtc_state(crtc_state),
to_intel_plane_state(plane_state),
--
2.16.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 06/13] drm/exynos: Stop updating plane->crtc
2018-04-05 15:13 [PATCH 01/13] drm/msm: Stop consulting plane->fb/crtc Ville Syrjala
` (3 preceding siblings ...)
2018-04-05 15:13 ` [PATCH 05/13] drm/i915: Stop updating plane->fb/crtc Ville Syrjala
@ 2018-04-05 15:13 ` Ville Syrjala
2018-04-05 16:45 ` Daniel Vetter
[not found] ` <20180405151400.11326-1-ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
` (12 subsequent siblings)
17 siblings, 1 reply; 39+ messages in thread
From: Ville Syrjala @ 2018-04-05 15:13 UTC (permalink / raw)
To: dri-devel
Cc: Inki Dae, Kyungmin Park, intel-gfx, Seung-Woo Kim, Joonyoung Shim
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
We want to get rid of plane->crtc on atomic drivers. Stop setting it.
Cc: Inki Dae <inki.dae@samsung.com>
Cc: Joonyoung Shim <jy0922.shim@samsung.com>
Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/exynos/exynos_drm_plane.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c
index d2a90dae5c71..1b1af359c303 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_plane.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c
@@ -263,8 +263,6 @@ static void exynos_plane_atomic_update(struct drm_plane *plane,
if (!state->crtc)
return;
- plane->crtc = state->crtc;
-
if (exynos_crtc->ops->update_plane)
exynos_crtc->ops->update_plane(exynos_crtc, exynos_plane);
}
--
2.16.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 07/13] drm/msm: Stop updating plane->fb/crtc
[not found] ` <20180405151400.11326-1-ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
@ 2018-04-05 15:13 ` Ville Syrjala
2018-04-05 16:32 ` Daniel Vetter
0 siblings, 1 reply; 39+ messages in thread
From: Ville Syrjala @ 2018-04-05 15:13 UTC (permalink / raw)
To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Rob Clark
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
We want to get rid of plane->fb/crtc on atomic drivers. Stop setting
them.
v2: Catch a few more cases
Cc: Rob Clark <robdclark@gmail.com>
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> #v1
---
drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c | 1 -
drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c | 2 --
drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 1 -
drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 2 --
4 files changed, 6 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c
index 99ead8e37c72..13f3f155dc67 100644
--- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c
+++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c
@@ -664,7 +664,6 @@ struct drm_crtc *mdp4_crtc_init(struct drm_device *dev,
drm_crtc_init_with_planes(dev, crtc, plane, NULL, &mdp4_crtc_funcs,
NULL);
drm_crtc_helper_add(crtc, &mdp4_crtc_helper_funcs);
- plane->crtc = crtc;
return crtc;
}
diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c
index 7a1ad3af08e3..782b1e27f040 100644
--- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c
+++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c
@@ -182,8 +182,6 @@ static void mdp4_plane_set_scanout(struct drm_plane *plane,
msm_framebuffer_iova(fb, kms->aspace, 2));
mdp4_write(mdp4_kms, REG_MDP4_PIPE_SRCP3_BASE(pipe),
msm_framebuffer_iova(fb, kms->aspace, 3));
-
- plane->fb = fb;
}
static void mdp4_write_csc_config(struct mdp4_kms *mdp4_kms,
diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
index 9893e43ba6c5..4cd884164b78 100644
--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
@@ -1197,7 +1197,6 @@ struct drm_crtc *mdp5_crtc_init(struct drm_device *dev,
"unref cursor", unref_cursor_worker);
drm_crtc_helper_add(crtc, &mdp5_crtc_helper_funcs);
- plane->crtc = crtc;
return crtc;
}
diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
index f2361f79fdce..6826aa10f3ac 100644
--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
@@ -1043,8 +1043,6 @@ static int mdp5_plane_mode_set(struct drm_plane *plane,
src_img_w, src_img_h,
src_x + src_w, src_y, src_w, src_h);
- plane->fb = fb;
-
return ret;
}
--
2.16.1
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 08/13] drm/virtio: Stop updating plane->crtc
2018-04-05 15:13 [PATCH 01/13] drm/msm: Stop consulting plane->fb/crtc Ville Syrjala
` (5 preceding siblings ...)
[not found] ` <20180405151400.11326-1-ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
@ 2018-04-05 15:13 ` Ville Syrjala
2018-04-05 16:46 ` [Intel-gfx] " Daniel Vetter
2018-04-05 16:46 ` Daniel Vetter
2018-04-05 15:13 ` [PATCH 09/13] drm/vc4: Stop updating plane->fb/crtc Ville Syrjala
` (10 subsequent siblings)
17 siblings, 2 replies; 39+ messages in thread
From: Ville Syrjala @ 2018-04-05 15:13 UTC (permalink / raw)
To: dri-devel; +Cc: David Airlie, intel-gfx, virtualization
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
We want to get rid of plane->crtc on atomic drivers. Stop setting it.
v2: s/fb/crtc/ in the commit message (Gerd)
Cc: David Airlie <airlied@linux.ie>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: virtualization@lists.linux-foundation.org
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/virtio/virtgpu_display.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c
index 8cc8c34d67f5..42e842ceb53c 100644
--- a/drivers/gpu/drm/virtio/virtgpu_display.c
+++ b/drivers/gpu/drm/virtio/virtgpu_display.c
@@ -302,8 +302,6 @@ static int vgdev_output_init(struct virtio_gpu_device *vgdev, int index)
drm_crtc_init_with_planes(dev, crtc, primary, cursor,
&virtio_gpu_crtc_funcs, NULL);
drm_crtc_helper_add(crtc, &virtio_gpu_crtc_helper_funcs);
- primary->crtc = crtc;
- cursor->crtc = crtc;
drm_connector_init(dev, connector, &virtio_gpu_connector_funcs,
DRM_MODE_CONNECTOR_VIRTUAL);
--
2.16.1
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 09/13] drm/vc4: Stop updating plane->fb/crtc
2018-04-05 15:13 [PATCH 01/13] drm/msm: Stop consulting plane->fb/crtc Ville Syrjala
` (6 preceding siblings ...)
2018-04-05 15:13 ` [PATCH 08/13] drm/virtio: Stop updating plane->crtc Ville Syrjala
@ 2018-04-05 15:13 ` Ville Syrjala
2018-04-05 16:46 ` Daniel Vetter
2018-04-05 15:13 ` [PATCH 10/13] drm/atmel-hlcdc: Stop using plane->fb Ville Syrjala
` (9 subsequent siblings)
17 siblings, 1 reply; 39+ messages in thread
From: Ville Syrjala @ 2018-04-05 15:13 UTC (permalink / raw)
To: dri-devel; +Cc: intel-gfx
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
We want to get rid of plane->fb/crtc on atomic drivers. Stop setting
them.
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/vc4/vc4_crtc.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
index bf4667481935..a9f65e15889d 100644
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
@@ -837,7 +837,6 @@ static int vc4_async_page_flip(struct drm_crtc *crtc,
* is released.
*/
drm_atomic_set_fb_for_plane(plane->state, fb);
- plane->fb = fb;
vc4_queue_seqno_cb(dev, &flip_state->cb, bo->seqno,
vc4_async_page_flip_complete);
@@ -1032,7 +1031,6 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data)
drm_crtc_init_with_planes(drm, crtc, primary_plane, NULL,
&vc4_crtc_funcs, NULL);
drm_crtc_helper_add(crtc, &vc4_crtc_helper_funcs);
- primary_plane->crtc = crtc;
vc4_crtc->channel = vc4_crtc->data->hvs_channel;
drm_mode_crtc_set_gamma_size(crtc, ARRAY_SIZE(vc4_crtc->lut_r));
@@ -1062,7 +1060,6 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data)
cursor_plane = vc4_plane_init(drm, DRM_PLANE_TYPE_CURSOR);
if (!IS_ERR(cursor_plane)) {
cursor_plane->possible_crtcs = 1 << drm_crtc_index(crtc);
- cursor_plane->crtc = crtc;
crtc->cursor = cursor_plane;
}
--
2.16.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 10/13] drm/atmel-hlcdc: Stop using plane->fb
2018-04-05 15:13 [PATCH 01/13] drm/msm: Stop consulting plane->fb/crtc Ville Syrjala
` (7 preceding siblings ...)
2018-04-05 15:13 ` [PATCH 09/13] drm/vc4: Stop updating plane->fb/crtc Ville Syrjala
@ 2018-04-05 15:13 ` Ville Syrjala
2018-04-05 16:38 ` Daniel Vetter
2018-04-05 15:13 ` [PATCH 11/13] drm/omapdrm: Nuke omap_framebuffer_get_next_connector() Ville Syrjala
` (8 subsequent siblings)
17 siblings, 1 reply; 39+ messages in thread
From: Ville Syrjala @ 2018-04-05 15:13 UTC (permalink / raw)
To: dri-devel; +Cc: Daniel Vetter, intel-gfx, Boris Brezillon
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
We want to get rid of plane->fb on atomic drivers. Stop looking at it.
Daniel pointed out that the drm_framebuffer_put() in the plane cleanup
indicates that the driver doesn't shut things down cleanly. To do
that we should be able to just call drm_atomic_helper_shutdown(). Not
really sure the current cleanup sequence is actually sane, but whatever.
v2: Replace the drm_framebuffer_put() with
drm_atomic_helper_shutdown() (Daniel)
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 1 +
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 12 +-----------
2 files changed, 2 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
index c1ea5c36b006..843cac222e60 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
@@ -681,6 +681,7 @@ static void atmel_hlcdc_dc_unload(struct drm_device *dev)
drm_fb_cma_fbdev_fini(dev);
flush_workqueue(dc->wq);
drm_kms_helper_poll_fini(dev);
+ drm_atomic_helper_shutdown(dev);
drm_mode_config_cleanup(dev);
pm_runtime_get_sync(dev->dev);
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
index 9271c2fa3d79..8ecf02db8d01 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
@@ -820,16 +820,6 @@ static void atmel_hlcdc_plane_atomic_disable(struct drm_plane *p,
atmel_hlcdc_layer_read_reg(&plane->layer, ATMEL_HLCDC_LAYER_ISR);
}
-static void atmel_hlcdc_plane_destroy(struct drm_plane *p)
-{
- struct atmel_hlcdc_plane *plane = drm_plane_to_atmel_hlcdc_plane(p);
-
- if (plane->base.fb)
- drm_framebuffer_put(plane->base.fb);
-
- drm_plane_cleanup(p);
-}
-
static int atmel_hlcdc_plane_atomic_set_property(struct drm_plane *p,
struct drm_plane_state *s,
struct drm_property *property,
@@ -1039,7 +1029,7 @@ static void atmel_hlcdc_plane_atomic_destroy_state(struct drm_plane *p,
static const struct drm_plane_funcs layer_plane_funcs = {
.update_plane = drm_atomic_helper_update_plane,
.disable_plane = drm_atomic_helper_disable_plane,
- .destroy = atmel_hlcdc_plane_destroy,
+ .destroy = drm_plane_cleanup,
.reset = atmel_hlcdc_plane_reset,
.atomic_duplicate_state = atmel_hlcdc_plane_atomic_duplicate_state,
.atomic_destroy_state = atmel_hlcdc_plane_atomic_destroy_state,
--
2.16.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 11/13] drm/omapdrm: Nuke omap_framebuffer_get_next_connector()
2018-04-05 15:13 [PATCH 01/13] drm/msm: Stop consulting plane->fb/crtc Ville Syrjala
` (8 preceding siblings ...)
2018-04-05 15:13 ` [PATCH 10/13] drm/atmel-hlcdc: Stop using plane->fb Ville Syrjala
@ 2018-04-05 15:13 ` Ville Syrjala
2018-04-05 16:50 ` Daniel Vetter
2018-04-05 15:13 ` [PATCH 12/13] drm: Stop updating plane->crtc/fb/old_fb on atomic drivers Ville Syrjala
` (7 subsequent siblings)
17 siblings, 1 reply; 39+ messages in thread
From: Ville Syrjala @ 2018-04-05 15:13 UTC (permalink / raw)
To: dri-devel; +Cc: intel-gfx, Tomi Valkeinen
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
omap_framebuffer_get_next_connector() uses plane->fb which we want to
deprecate for atomic drivers. As omap_framebuffer_get_next_connector()
is unused just nuke the entire function.
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/omapdrm/omap_fb.c | 27 ---------------------------
drivers/gpu/drm/omapdrm/omap_fb.h | 2 --
2 files changed, 29 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c
index 5fd22ca73913..b54bcaad5cd1 100644
--- a/drivers/gpu/drm/omapdrm/omap_fb.c
+++ b/drivers/gpu/drm/omapdrm/omap_fb.c
@@ -309,33 +309,6 @@ void omap_framebuffer_unpin(struct drm_framebuffer *fb)
mutex_unlock(&omap_fb->lock);
}
-/* iterate thru all the connectors, returning ones that are attached
- * to the same fb..
- */
-struct drm_connector *omap_framebuffer_get_next_connector(
- struct drm_framebuffer *fb, struct drm_connector *from)
-{
- struct drm_device *dev = fb->dev;
- struct list_head *connector_list = &dev->mode_config.connector_list;
- struct drm_connector *connector = from;
-
- if (!from)
- return list_first_entry_or_null(connector_list, typeof(*from),
- head);
-
- list_for_each_entry_from(connector, connector_list, head) {
- if (connector != from) {
- struct drm_encoder *encoder = connector->encoder;
- struct drm_crtc *crtc = encoder ? encoder->crtc : NULL;
- if (crtc && crtc->primary->fb == fb)
- return connector;
-
- }
- }
-
- return NULL;
-}
-
#ifdef CONFIG_DEBUG_FS
void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m)
{
diff --git a/drivers/gpu/drm/omapdrm/omap_fb.h b/drivers/gpu/drm/omapdrm/omap_fb.h
index 94ad5f9e4404..c20cb4bc714d 100644
--- a/drivers/gpu/drm/omapdrm/omap_fb.h
+++ b/drivers/gpu/drm/omapdrm/omap_fb.h
@@ -38,8 +38,6 @@ int omap_framebuffer_pin(struct drm_framebuffer *fb);
void omap_framebuffer_unpin(struct drm_framebuffer *fb);
void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,
struct drm_plane_state *state, struct omap_overlay_info *info);
-struct drm_connector *omap_framebuffer_get_next_connector(
- struct drm_framebuffer *fb, struct drm_connector *from);
bool omap_framebuffer_supports_rotation(struct drm_framebuffer *fb);
void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m);
--
2.16.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 12/13] drm: Stop updating plane->crtc/fb/old_fb on atomic drivers
2018-04-05 15:13 [PATCH 01/13] drm/msm: Stop consulting plane->fb/crtc Ville Syrjala
` (9 preceding siblings ...)
2018-04-05 15:13 ` [PATCH 11/13] drm/omapdrm: Nuke omap_framebuffer_get_next_connector() Ville Syrjala
@ 2018-04-05 15:13 ` Ville Syrjala
2018-04-05 16:58 ` Daniel Vetter
2018-04-05 15:14 ` [PATCH 13/13] drm: Add local 'plane' variable for tmp->primary Ville Syrjala
` (6 subsequent siblings)
17 siblings, 1 reply; 39+ messages in thread
From: Ville Syrjala @ 2018-04-05 15:13 UTC (permalink / raw)
To: dri-devel; +Cc: intel-gfx
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Stop playing around with plane->crtc/fb/old_fb with atomic
drivers. Make life a lot simpler when we don't have to do the
magic old_fb vs. fb dance around plane updates. That way we
can't risk plane->fb getting out of sync with plane->state->fb
and we're less likely to leak any refcounts as well.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
---
drivers/gpu/drm/drm_atomic.c | 55 ++++---------------------------------
drivers/gpu/drm/drm_atomic_helper.c | 15 +---------
drivers/gpu/drm/drm_crtc.c | 8 ++++--
drivers/gpu/drm/drm_fb_helper.c | 7 -----
drivers/gpu/drm/drm_framebuffer.c | 5 ----
drivers/gpu/drm/drm_plane.c | 14 ++++++----
drivers/gpu/drm/drm_plane_helper.c | 4 ++-
include/drm/drm_atomic.h | 3 --
8 files changed, 24 insertions(+), 87 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 7d25c42f22db..b16cc37e2adf 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -692,6 +692,11 @@ drm_atomic_get_plane_state(struct drm_atomic_state *state,
WARN_ON(!state->acquire_ctx);
+ /* the legacy pointers should never be set */
+ WARN_ON(plane->fb);
+ WARN_ON(plane->old_fb);
+ WARN_ON(plane->crtc);
+
plane_state = drm_atomic_get_existing_plane_state(state, plane);
if (plane_state)
return plane_state;
@@ -2021,45 +2026,6 @@ int drm_atomic_set_property(struct drm_atomic_state *state,
return ret;
}
-/**
- * drm_atomic_clean_old_fb -- Unset old_fb pointers and set plane->fb pointers.
- *
- * @dev: drm device to check.
- * @plane_mask: plane mask for planes that were updated.
- * @ret: return value, can be -EDEADLK for a retry.
- *
- * Before doing an update &drm_plane.old_fb is set to &drm_plane.fb, but before
- * dropping the locks old_fb needs to be set to NULL and plane->fb updated. This
- * is a common operation for each atomic update, so this call is split off as a
- * helper.
- */
-void drm_atomic_clean_old_fb(struct drm_device *dev,
- unsigned plane_mask,
- int ret)
-{
- struct drm_plane *plane;
-
- /* if succeeded, fixup legacy plane crtc/fb ptrs before dropping
- * locks (ie. while it is still safe to deref plane->state). We
- * need to do this here because the driver entry points cannot
- * distinguish between legacy and atomic ioctls.
- */
- drm_for_each_plane_mask(plane, dev, plane_mask) {
- if (ret == 0) {
- struct drm_framebuffer *new_fb = plane->state->fb;
- if (new_fb)
- drm_framebuffer_get(new_fb);
- plane->fb = new_fb;
- plane->crtc = plane->state->crtc;
-
- if (plane->old_fb)
- drm_framebuffer_put(plane->old_fb);
- }
- plane->old_fb = NULL;
- }
-}
-EXPORT_SYMBOL(drm_atomic_clean_old_fb);
-
/**
* DOC: explicit fencing properties
*
@@ -2280,9 +2246,7 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
unsigned int copied_objs, copied_props;
struct drm_atomic_state *state;
struct drm_modeset_acquire_ctx ctx;
- struct drm_plane *plane;
struct drm_out_fence_state *fence_state;
- unsigned plane_mask;
int ret = 0;
unsigned int i, j, num_fences;
@@ -2322,7 +2286,6 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
state->allow_modeset = !!(arg->flags & DRM_MODE_ATOMIC_ALLOW_MODESET);
retry:
- plane_mask = 0;
copied_objs = 0;
copied_props = 0;
fence_state = NULL;
@@ -2393,12 +2356,6 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
copied_props++;
}
- if (obj->type == DRM_MODE_OBJECT_PLANE && count_props &&
- !(arg->flags & DRM_MODE_ATOMIC_TEST_ONLY)) {
- plane = obj_to_plane(obj);
- plane_mask |= (1 << drm_plane_index(plane));
- plane->old_fb = plane->fb;
- }
drm_mode_object_put(obj);
}
@@ -2419,8 +2376,6 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
}
out:
- drm_atomic_clean_old_fb(dev, plane_mask, ret);
-
complete_crtc_signaling(dev, state, fence_state, num_fences, !ret);
if (ret == -EDEADLK) {
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index ee03c1ed2521..32d7787f0f89 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -2903,7 +2903,6 @@ static int __drm_atomic_helper_disable_all(struct drm_device *dev,
struct drm_plane *plane;
struct drm_crtc_state *crtc_state;
struct drm_crtc *crtc;
- unsigned plane_mask = 0;
int ret, i;
state = drm_atomic_state_alloc(dev);
@@ -2946,17 +2945,10 @@ static int __drm_atomic_helper_disable_all(struct drm_device *dev,
goto free;
drm_atomic_set_fb_for_plane(plane_state, NULL);
-
- if (clean_old_fbs) {
- plane->old_fb = plane->fb;
- plane_mask |= BIT(drm_plane_index(plane));
- }
}
ret = drm_atomic_commit(state);
free:
- if (plane_mask)
- drm_atomic_clean_old_fb(dev, plane_mask, ret);
drm_atomic_state_put(state);
return ret;
}
@@ -3118,13 +3110,8 @@ int drm_atomic_helper_commit_duplicated_state(struct drm_atomic_state *state,
state->acquire_ctx = ctx;
- for_each_new_plane_in_state(state, plane, new_plane_state, i) {
- WARN_ON(plane->crtc != new_plane_state->crtc);
- WARN_ON(plane->fb != new_plane_state->fb);
- WARN_ON(plane->old_fb);
-
+ for_each_new_plane_in_state(state, plane, new_plane_state, i)
state->planes[i].old_state = plane->state;
- }
for_each_new_crtc_in_state(state, crtc, new_crtc_state, i)
state->crtcs[i].old_state = crtc->state;
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index a231dd5dce16..4e3c1a8d118a 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -474,8 +474,12 @@ static int __drm_mode_set_config_internal(struct drm_mode_set *set,
ret = crtc->funcs->set_config(set, ctx);
if (ret == 0) {
- crtc->primary->crtc = fb ? crtc : NULL;
- crtc->primary->fb = fb;
+ struct drm_plane *plane = crtc->primary;
+
+ if (!plane->state) {
+ plane->crtc = fb ? crtc : NULL;
+ plane->fb = fb;
+ }
}
drm_for_each_crtc(tmp, crtc->dev) {
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 0646b108030b..5639e804a0cd 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -368,7 +368,6 @@ static int restore_fbdev_mode_atomic(struct drm_fb_helper *fb_helper, bool activ
struct drm_plane *plane;
struct drm_atomic_state *state;
int i, ret;
- unsigned int plane_mask;
struct drm_modeset_acquire_ctx ctx;
drm_modeset_acquire_init(&ctx, 0);
@@ -381,7 +380,6 @@ static int restore_fbdev_mode_atomic(struct drm_fb_helper *fb_helper, bool activ
state->acquire_ctx = &ctx;
retry:
- plane_mask = 0;
drm_for_each_plane(plane, dev) {
plane_state = drm_atomic_get_plane_state(state, plane);
if (IS_ERR(plane_state)) {
@@ -391,9 +389,6 @@ static int restore_fbdev_mode_atomic(struct drm_fb_helper *fb_helper, bool activ
plane_state->rotation = DRM_MODE_ROTATE_0;
- plane->old_fb = plane->fb;
- plane_mask |= 1 << drm_plane_index(plane);
-
/* disable non-primary: */
if (plane->type == DRM_PLANE_TYPE_PRIMARY)
continue;
@@ -430,8 +425,6 @@ static int restore_fbdev_mode_atomic(struct drm_fb_helper *fb_helper, bool activ
ret = drm_atomic_commit(state);
out_state:
- drm_atomic_clean_old_fb(dev, plane_mask, ret);
-
if (ret == -EDEADLK)
goto backoff;
diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c
index 8c4d32adcc17..1bada12f9793 100644
--- a/drivers/gpu/drm/drm_framebuffer.c
+++ b/drivers/gpu/drm/drm_framebuffer.c
@@ -837,8 +837,6 @@ static int atomic_remove_fb(struct drm_framebuffer *fb)
goto unlock;
plane_mask |= BIT(drm_plane_index(plane));
-
- plane->old_fb = plane->fb;
}
/* This list is only filled when disable_crtcs is set. */
@@ -853,9 +851,6 @@ static int atomic_remove_fb(struct drm_framebuffer *fb)
ret = drm_atomic_commit(state);
unlock:
- if (plane_mask)
- drm_atomic_clean_old_fb(dev, plane_mask, ret);
-
if (ret == -EDEADLK) {
drm_atomic_state_clear(state);
drm_modeset_backoff(&ctx);
diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
index 035054455301..143041666096 100644
--- a/drivers/gpu/drm/drm_plane.c
+++ b/drivers/gpu/drm/drm_plane.c
@@ -650,9 +650,11 @@ static int __setplane_internal(struct drm_plane *plane,
crtc_x, crtc_y, crtc_w, crtc_h,
src_x, src_y, src_w, src_h, ctx);
if (!ret) {
- plane->crtc = crtc;
- plane->fb = fb;
- drm_framebuffer_get(plane->fb);
+ if (!plane->state) {
+ plane->crtc = crtc;
+ plane->fb = fb;
+ drm_framebuffer_get(plane->fb);
+ }
} else {
plane->old_fb = NULL;
}
@@ -1092,8 +1094,10 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
/* Keep the old fb, don't unref it. */
plane->old_fb = NULL;
} else {
- plane->fb = fb;
- drm_framebuffer_get(fb);
+ if (!plane->state) {
+ plane->fb = fb;
+ drm_framebuffer_get(fb);
+ }
}
out:
diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c
index f88f68161519..2010794943bc 100644
--- a/drivers/gpu/drm/drm_plane_helper.c
+++ b/drivers/gpu/drm/drm_plane_helper.c
@@ -502,6 +502,7 @@ EXPORT_SYMBOL(drm_plane_helper_update);
int drm_plane_helper_disable(struct drm_plane *plane)
{
struct drm_plane_state *plane_state;
+ struct drm_framebuffer *old_fb;
/* crtc helpers love to call disable functions for already disabled hw
* functions. So cope with that. */
@@ -521,8 +522,9 @@ int drm_plane_helper_disable(struct drm_plane *plane)
plane_state->plane = plane;
plane_state->crtc = NULL;
+ old_fb = plane_state->fb;
drm_atomic_set_fb_for_plane(plane_state, NULL);
- return drm_plane_helper_commit(plane, plane_state, plane->fb);
+ return drm_plane_helper_commit(plane, plane_state, old_fb);
}
EXPORT_SYMBOL(drm_plane_helper_disable);
diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index a57a8aa90ffb..ca461b6cf71f 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -601,9 +601,6 @@ int __must_check
drm_atomic_add_affected_planes(struct drm_atomic_state *state,
struct drm_crtc *crtc);
-void
-drm_atomic_clean_old_fb(struct drm_device *dev, unsigned plane_mask, int ret);
-
int __must_check drm_atomic_check_only(struct drm_atomic_state *state);
int __must_check drm_atomic_commit(struct drm_atomic_state *state);
int __must_check drm_atomic_nonblocking_commit(struct drm_atomic_state *state);
--
2.16.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 13/13] drm: Add local 'plane' variable for tmp->primary
2018-04-05 15:13 [PATCH 01/13] drm/msm: Stop consulting plane->fb/crtc Ville Syrjala
` (10 preceding siblings ...)
2018-04-05 15:13 ` [PATCH 12/13] drm: Stop updating plane->crtc/fb/old_fb on atomic drivers Ville Syrjala
@ 2018-04-05 15:14 ` Ville Syrjala
2018-04-05 16:59 ` Daniel Vetter
2018-04-05 15:45 ` ✗ Fi.CI.BAT: failure for series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc Patchwork
` (5 subsequent siblings)
17 siblings, 1 reply; 39+ messages in thread
From: Ville Syrjala @ 2018-04-05 15:14 UTC (permalink / raw)
To: dri-devel; +Cc: Daniel Vetter, intel-gfx
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Clean up the ugly tmp->primary-> stuff in
__drm_mode_set_config_internal() with a local plane variable.
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/drm_crtc.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 4e3c1a8d118a..34c08dc92849 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -467,8 +467,11 @@ static int __drm_mode_set_config_internal(struct drm_mode_set *set,
* connectors from it), hence we need to refcount the fbs across all
* crtcs. Atomic modeset will have saner semantics ...
*/
- drm_for_each_crtc(tmp, crtc->dev)
- tmp->primary->old_fb = tmp->primary->fb;
+ drm_for_each_crtc(tmp, crtc->dev) {
+ struct drm_plane *plane = tmp->primary;
+
+ plane->old_fb = plane->fb;
+ }
fb = set->fb;
@@ -483,11 +486,13 @@ static int __drm_mode_set_config_internal(struct drm_mode_set *set,
}
drm_for_each_crtc(tmp, crtc->dev) {
- if (tmp->primary->fb)
- drm_framebuffer_get(tmp->primary->fb);
- if (tmp->primary->old_fb)
- drm_framebuffer_put(tmp->primary->old_fb);
- tmp->primary->old_fb = NULL;
+ struct drm_plane *plane = tmp->primary;
+
+ if (plane->fb)
+ drm_framebuffer_get(plane->fb);
+ if (plane->old_fb)
+ drm_framebuffer_put(plane->old_fb);
+ plane->old_fb = NULL;
}
return ret;
--
2.16.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 39+ messages in thread
* ✗ Fi.CI.BAT: failure for series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc
2018-04-05 15:13 [PATCH 01/13] drm/msm: Stop consulting plane->fb/crtc Ville Syrjala
` (11 preceding siblings ...)
2018-04-05 15:14 ` [PATCH 13/13] drm: Add local 'plane' variable for tmp->primary Ville Syrjala
@ 2018-04-05 15:45 ` Patchwork
2018-04-05 16:33 ` [PATCH 01/13] " Daniel Vetter
` (4 subsequent siblings)
17 siblings, 0 replies; 39+ messages in thread
From: Patchwork @ 2018-04-05 15:45 UTC (permalink / raw)
To: Ville Syrjala; +Cc: intel-gfx
== Series Details ==
Series: series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc
URL : https://patchwork.freedesktop.org/series/41216/
State : failure
== Summary ==
Series 41216v1 series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc
https://patchwork.freedesktop.org/api/1.0/series/41216/revisions/1/mbox/
---- Possible new issues:
Test gem_exec_flush:
Subgroup basic-uc-pro-default:
pass -> INCOMPLETE (fi-cnl-y3)
Test kms_pipe_crc_basic:
Subgroup read-crc-pipe-b-frame-sequence:
pass -> INCOMPLETE (fi-elk-e7500)
---- Known issues:
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-c:
dmesg-warn -> PASS (fi-glk-j4005) fdo#105644
Test prime_vgem:
Subgroup basic-fence-flip:
fail -> PASS (fi-ilk-650) fdo#104008
fdo#105644 https://bugs.freedesktop.org/show_bug.cgi?id=105644
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008
fi-bdw-5557u total:285 pass:264 dwarn:0 dfail:0 fail:0 skip:21 time:429s
fi-bdw-gvtdvm total:285 pass:261 dwarn:0 dfail:0 fail:0 skip:24 time:443s
fi-blb-e6850 total:285 pass:220 dwarn:1 dfail:0 fail:0 skip:64 time:381s
fi-bsw-n3050 total:285 pass:239 dwarn:0 dfail:0 fail:0 skip:46 time:544s
fi-bwr-2160 total:285 pass:180 dwarn:0 dfail:0 fail:0 skip:105 time:297s
fi-bxt-dsi total:285 pass:255 dwarn:0 dfail:0 fail:0 skip:30 time:520s
fi-bxt-j4205 total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:512s
fi-byt-j1900 total:285 pass:250 dwarn:0 dfail:0 fail:0 skip:35 time:522s
fi-byt-n2820 total:285 pass:246 dwarn:0 dfail:0 fail:0 skip:39 time:511s
fi-cfl-8700k total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:410s
fi-cfl-s3 total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:557s
fi-cfl-u total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:513s
fi-cnl-y3 total:53 pass:45 dwarn:0 dfail:0 fail:0 skip:7
fi-elk-e7500 total:238 pass:188 dwarn:0 dfail:0 fail:0 skip:49
fi-gdg-551 total:285 pass:176 dwarn:0 dfail:0 fail:1 skip:108 time:316s
fi-glk-1 total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:537s
fi-glk-j4005 total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:484s
fi-hsw-4770 total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:405s
fi-ilk-650 total:285 pass:225 dwarn:0 dfail:0 fail:0 skip:60 time:422s
fi-ivb-3520m total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:469s
fi-ivb-3770 total:285 pass:252 dwarn:0 dfail:0 fail:0 skip:33 time:432s
fi-kbl-7500u total:285 pass:260 dwarn:1 dfail:0 fail:0 skip:24 time:472s
fi-kbl-7567u total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:461s
fi-kbl-r total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:508s
fi-pnv-d510 total:285 pass:220 dwarn:1 dfail:0 fail:0 skip:64 time:671s
fi-skl-6260u total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:439s
fi-skl-6600u total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:533s
fi-skl-6700k2 total:285 pass:261 dwarn:0 dfail:0 fail:0 skip:24 time:507s
fi-skl-6770hq total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:508s
fi-skl-guc total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:430s
fi-skl-gvtdvm total:285 pass:262 dwarn:0 dfail:0 fail:0 skip:23 time:443s
fi-snb-2520m total:285 pass:245 dwarn:0 dfail:0 fail:0 skip:40 time:576s
fi-snb-2600 total:285 pass:245 dwarn:0 dfail:0 fail:0 skip:40 time:397s
Blacklisted hosts:
fi-cnl-psr total:285 pass:255 dwarn:4 dfail:0 fail:0 skip:26 time:534s
0eddede73765b01ec287cad00e23bee23c216a16 drm-tip: 2018y-04m-05d-09h-51m-03s UTC integration manifest
519d40c8150b drm: Add local 'plane' variable for tmp->primary
1fbd5ce24422 drm: Stop updating plane->crtc/fb/old_fb on atomic drivers
05edf5b83da3 drm/omapdrm: Nuke omap_framebuffer_get_next_connector()
280d11d24dcb drm/atmel-hlcdc: Stop using plane->fb
8d2a4b07512b drm/vc4: Stop updating plane->fb/crtc
d34e796825b2 drm/virtio: Stop updating plane->crtc
e8dff818cd2d drm/msm: Stop updating plane->fb/crtc
45832a6da124 drm/exynos: Stop updating plane->crtc
e17f83892a58 drm/i915: Stop updating plane->fb/crtc
45ff3baeef5f drm/amdgpu/dc: Stop updating plane->fb
191373592ec3 drm/atmel-hlcdc: Stop consulting plane->crtc
efd749791df7 drm/sti: Stop consulting plane->crtc
a18f6e3738ca drm/msm: Stop consulting plane->fb/crtc
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8599/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 07/13] drm/msm: Stop updating plane->fb/crtc
2018-04-05 15:13 ` [PATCH 07/13] drm/msm: Stop updating plane->fb/crtc Ville Syrjala
@ 2018-04-05 16:32 ` Daniel Vetter
0 siblings, 0 replies; 39+ messages in thread
From: Daniel Vetter @ 2018-04-05 16:32 UTC (permalink / raw)
To: Ville Syrjala; +Cc: linux-arm-msm, intel-gfx, freedreno, dri-devel
On Thu, Apr 05, 2018 at 06:13:54PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> We want to get rid of plane->fb/crtc on atomic drivers. Stop setting
> them.
>
> v2: Catch a few more cases
>
> Cc: Rob Clark <robdclark@gmail.com>
> Cc: linux-arm-msm@vger.kernel.org
> Cc: freedreno@lists.freedesktop.org
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> #v1
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c | 1 -
> drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c | 2 --
> drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 1 -
> drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 2 --
> 4 files changed, 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c
> index 99ead8e37c72..13f3f155dc67 100644
> --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c
> +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c
> @@ -664,7 +664,6 @@ struct drm_crtc *mdp4_crtc_init(struct drm_device *dev,
> drm_crtc_init_with_planes(dev, crtc, plane, NULL, &mdp4_crtc_funcs,
> NULL);
> drm_crtc_helper_add(crtc, &mdp4_crtc_helper_funcs);
> - plane->crtc = crtc;
>
> return crtc;
> }
> diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c
> index 7a1ad3af08e3..782b1e27f040 100644
> --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c
> +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c
> @@ -182,8 +182,6 @@ static void mdp4_plane_set_scanout(struct drm_plane *plane,
> msm_framebuffer_iova(fb, kms->aspace, 2));
> mdp4_write(mdp4_kms, REG_MDP4_PIPE_SRCP3_BASE(pipe),
> msm_framebuffer_iova(fb, kms->aspace, 3));
> -
> - plane->fb = fb;
> }
>
> static void mdp4_write_csc_config(struct mdp4_kms *mdp4_kms,
> diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
> index 9893e43ba6c5..4cd884164b78 100644
> --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
> +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
> @@ -1197,7 +1197,6 @@ struct drm_crtc *mdp5_crtc_init(struct drm_device *dev,
> "unref cursor", unref_cursor_worker);
>
> drm_crtc_helper_add(crtc, &mdp5_crtc_helper_funcs);
> - plane->crtc = crtc;
>
> return crtc;
> }
> diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
> index f2361f79fdce..6826aa10f3ac 100644
> --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
> +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
> @@ -1043,8 +1043,6 @@ static int mdp5_plane_mode_set(struct drm_plane *plane,
> src_img_w, src_img_h,
> src_x + src_w, src_y, src_w, src_h);
>
> - plane->fb = fb;
> -
> return ret;
> }
>
> --
> 2.16.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 01/13] drm/msm: Stop consulting plane->fb/crtc
2018-04-05 15:13 [PATCH 01/13] drm/msm: Stop consulting plane->fb/crtc Ville Syrjala
` (12 preceding siblings ...)
2018-04-05 15:45 ` ✗ Fi.CI.BAT: failure for series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc Patchwork
@ 2018-04-05 16:33 ` Daniel Vetter
2018-04-05 16:51 ` ✓ Fi.CI.BAT: success for series starting with [01/13] " Patchwork
` (3 subsequent siblings)
17 siblings, 0 replies; 39+ messages in thread
From: Daniel Vetter @ 2018-04-05 16:33 UTC (permalink / raw)
To: Ville Syrjala; +Cc: linux-arm-msm, intel-gfx, freedreno, dri-devel
On Thu, Apr 05, 2018 at 06:13:48PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> We want to get rid of plane->fb/crtc on atomic drivers. Stop
> looking at them.
>
> v2: Catch the plane->crtc case too
>
> Cc: Rob Clark <robdclark@gmail.com>
> Cc: linux-arm-msm@vger.kernel.org
> Cc: freedreno@lists.freedesktop.org
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> #v1
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
fwiw, here's how I review these:
First load a quickfix list using the following grep line:
Ggrep '\(plane\|primary\|cursor\)\S*\(fb\|crtc\)' -- drivers/gpu/drm/
But that includes the plenty of hits that do use state structs. So then I
filter for stuff without a preceeding state using vim's regexes:
\(plane\|primary\|cursor\)\(\S*state\S*\)\@!\S*\(->\|\.\)\(fb\|crtc\)
I'm feeling really bad about all this :-)
Cheers, Daniel
> ---
> drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c | 2 +-
> drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c
> index 6e5e1aa54ce1..99ead8e37c72 100644
> --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c
> +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c
> @@ -201,7 +201,7 @@ static void blend_setup(struct drm_crtc *crtc)
> int idx = idxs[pipe_id];
> if (idx > 0) {
> const struct mdp_format *format =
> - to_mdp_format(msm_framebuffer_format(plane->fb));
> + to_mdp_format(msm_framebuffer_format(plane->state->fb));
> alpha[idx-1] = format->alpha_enable;
> }
> }
> diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
> index a9f31da7d45a..f2361f79fdce 100644
> --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
> +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
> @@ -526,7 +526,7 @@ static void mdp5_plane_atomic_async_update(struct drm_plane *plane,
> if (plane_enabled(new_state)) {
> struct mdp5_ctl *ctl;
> struct mdp5_pipeline *pipeline =
> - mdp5_crtc_get_pipeline(plane->crtc);
> + mdp5_crtc_get_pipeline(new_state->crtc);
> int ret;
>
> ret = mdp5_plane_mode_set(plane, new_state->crtc, new_state->fb,
> --
> 2.16.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 02/13] drm/sti: Stop consulting plane->crtc
2018-04-05 15:13 ` [PATCH 02/13] drm/sti: Stop consulting plane->crtc Ville Syrjala
@ 2018-04-05 16:34 ` Daniel Vetter
0 siblings, 0 replies; 39+ messages in thread
From: Daniel Vetter @ 2018-04-05 16:34 UTC (permalink / raw)
To: Ville Syrjala; +Cc: Daniel Vetter, intel-gfx, Vincent Abriou, dri-devel
On Thu, Apr 05, 2018 at 06:13:49PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> We want to get rid of plane->crtc on atomic drivers. Stop looking at it.
>
> Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
> Cc: Vincent Abriou <vincent.abriou@st.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/sti/sti_gdp.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
> index 9b2c47051b51..49813d34bdf0 100644
> --- a/drivers/gpu/drm/sti/sti_gdp.c
> +++ b/drivers/gpu/drm/sti/sti_gdp.c
> @@ -211,7 +211,11 @@ static int gdp_dbg_show(struct seq_file *s, void *data)
> struct drm_info_node *node = s->private;
> struct sti_gdp *gdp = (struct sti_gdp *)node->info_ent->data;
> struct drm_plane *drm_plane = &gdp->plane.drm_plane;
> - struct drm_crtc *crtc = drm_plane->crtc;
> + struct drm_crtc *crtc;
> +
> + drm_modeset_lock(&drm_plane->mutex, NULL);
> + crtc = drm_plane->state->crtc;
> + drm_modeset_unlock(&drm_plane->mutex);
>
> seq_printf(s, "%s: (vaddr = 0x%p)",
> sti_plane_to_str(&gdp->plane), gdp->regs);
> --
> 2.16.1
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 03/13] drm/atmel-hlcdc: Stop consulting plane->crtc
2018-04-05 15:13 ` [PATCH 03/13] drm/atmel-hlcdc: " Ville Syrjala
@ 2018-04-05 16:35 ` Daniel Vetter
0 siblings, 0 replies; 39+ messages in thread
From: Daniel Vetter @ 2018-04-05 16:35 UTC (permalink / raw)
To: Ville Syrjala; +Cc: Boris Brezillon, intel-gfx, dri-devel
On Thu, Apr 05, 2018 at 06:13:50PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> We want to get rid of plane->crtc on atomic drivers. Stop looking at it.
>
> Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> index e18800ed7cd1..9271c2fa3d79 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> @@ -415,9 +415,10 @@ static void atmel_hlcdc_plane_update_format(struct atmel_hlcdc_plane *plane,
> ATMEL_HLCDC_LAYER_FORMAT_CFG, cfg);
> }
>
> -static void atmel_hlcdc_plane_update_clut(struct atmel_hlcdc_plane *plane)
> +static void atmel_hlcdc_plane_update_clut(struct atmel_hlcdc_plane *plane,
> + struct atmel_hlcdc_plane_state *state)
> {
> - struct drm_crtc *crtc = plane->base.crtc;
> + struct drm_crtc *crtc = state->base.crtc;
> struct drm_color_lut *lut;
> int idx;
>
> @@ -782,7 +783,7 @@ static void atmel_hlcdc_plane_atomic_update(struct drm_plane *p,
> atmel_hlcdc_plane_update_pos_and_size(plane, state);
> atmel_hlcdc_plane_update_general_settings(plane, state);
> atmel_hlcdc_plane_update_format(plane, state);
> - atmel_hlcdc_plane_update_clut(plane);
> + atmel_hlcdc_plane_update_clut(plane, state);
> atmel_hlcdc_plane_update_buffers(plane, state);
> atmel_hlcdc_plane_update_disc_area(plane, state);
>
> --
> 2.16.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 10/13] drm/atmel-hlcdc: Stop using plane->fb
2018-04-05 15:13 ` [PATCH 10/13] drm/atmel-hlcdc: Stop using plane->fb Ville Syrjala
@ 2018-04-05 16:38 ` Daniel Vetter
0 siblings, 0 replies; 39+ messages in thread
From: Daniel Vetter @ 2018-04-05 16:38 UTC (permalink / raw)
To: Ville Syrjala; +Cc: Daniel Vetter, intel-gfx, dri-devel, Boris Brezillon
On Thu, Apr 05, 2018 at 06:13:57PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> We want to get rid of plane->fb on atomic drivers. Stop looking at it.
>
> Daniel pointed out that the drm_framebuffer_put() in the plane cleanup
> indicates that the driver doesn't shut things down cleanly. To do
> that we should be able to just call drm_atomic_helper_shutdown(). Not
> really sure the current cleanup sequence is actually sane, but whatever.
>
> v2: Replace the drm_framebuffer_put() with
> drm_atomic_helper_shutdown() (Daniel)
>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 1 +
> drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 12 +-----------
> 2 files changed, 2 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> index c1ea5c36b006..843cac222e60 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> @@ -681,6 +681,7 @@ static void atmel_hlcdc_dc_unload(struct drm_device *dev)
> drm_fb_cma_fbdev_fini(dev);
> flush_workqueue(dc->wq);
> drm_kms_helper_poll_fini(dev);
> + drm_atomic_helper_shutdown(dev);
Yeah, looks like the right place for this.
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> drm_mode_config_cleanup(dev);
>
> pm_runtime_get_sync(dev->dev);
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> index 9271c2fa3d79..8ecf02db8d01 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> @@ -820,16 +820,6 @@ static void atmel_hlcdc_plane_atomic_disable(struct drm_plane *p,
> atmel_hlcdc_layer_read_reg(&plane->layer, ATMEL_HLCDC_LAYER_ISR);
> }
>
> -static void atmel_hlcdc_plane_destroy(struct drm_plane *p)
> -{
> - struct atmel_hlcdc_plane *plane = drm_plane_to_atmel_hlcdc_plane(p);
> -
> - if (plane->base.fb)
> - drm_framebuffer_put(plane->base.fb);
> -
> - drm_plane_cleanup(p);
> -}
> -
> static int atmel_hlcdc_plane_atomic_set_property(struct drm_plane *p,
> struct drm_plane_state *s,
> struct drm_property *property,
> @@ -1039,7 +1029,7 @@ static void atmel_hlcdc_plane_atomic_destroy_state(struct drm_plane *p,
> static const struct drm_plane_funcs layer_plane_funcs = {
> .update_plane = drm_atomic_helper_update_plane,
> .disable_plane = drm_atomic_helper_disable_plane,
> - .destroy = atmel_hlcdc_plane_destroy,
> + .destroy = drm_plane_cleanup,
> .reset = atmel_hlcdc_plane_reset,
> .atomic_duplicate_state = atmel_hlcdc_plane_atomic_duplicate_state,
> .atomic_destroy_state = atmel_hlcdc_plane_atomic_destroy_state,
> --
> 2.16.1
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 04/13] drm/amdgpu/dc: Stop updating plane->fb
2018-04-05 15:13 ` [PATCH 04/13] drm/amdgpu/dc: Stop updating plane->fb Ville Syrjala
@ 2018-04-05 16:41 ` Daniel Vetter
2018-04-05 18:25 ` Harry Wentland
0 siblings, 1 reply; 39+ messages in thread
From: Daniel Vetter @ 2018-04-05 16:41 UTC (permalink / raw)
To: Ville Syrjala
Cc: Alex Deucher, intel-gfx, amd-gfx, dri-devel, Christian König
On Thu, Apr 05, 2018 at 06:13:51PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> We want to get rid of plane->fb on atomic drivers. Stop setting it.
>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: "Christian König" <christian.koenig@amd.com>
> Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com>
> Cc: Harry Wentland <harry.wentland@amd.com>
> Cc: amd-gfx@lists.freedesktop.org
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Under the assumption that all the hits outside of amdgpu/display/ are the
legacy/non-DC/non-atomic modeset code (which looks to be the case):
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index e42a28e3adc5..91d048bb5574 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -3943,8 +3943,6 @@ static void amdgpu_dm_do_flip(struct drm_crtc *crtc,
>
> /* Flip */
> spin_lock_irqsave(&crtc->dev->event_lock, flags);
> - /* update crtc fb */
> - crtc->primary->fb = fb;
>
> WARN_ON(acrtc->pflip_status != AMDGPU_FLIP_NONE);
> WARN_ON(!acrtc_state->stream);
> --
> 2.16.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 05/13] drm/i915: Stop updating plane->fb/crtc
2018-04-05 15:13 ` [PATCH 05/13] drm/i915: Stop updating plane->fb/crtc Ville Syrjala
@ 2018-04-05 16:44 ` Daniel Vetter
2018-04-05 17:02 ` [PATCH v2 " Ville Syrjala
1 sibling, 0 replies; 39+ messages in thread
From: Daniel Vetter @ 2018-04-05 16:44 UTC (permalink / raw)
To: Ville Syrjala; +Cc: intel-gfx, dri-devel
On Thu, Apr 05, 2018 at 06:13:52PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> We want to get rid of plane->fb/crtc on atomic drivers. Stop setting
> them.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
There's a bunch more hits I have:
- 2x a coment with "Both crtc and plane->crtc" in intel_atomic_plane.c.
Probably best to just nuke those.
- One comment in intel_crtc_active, just needs to be switched to
crtc->primary->state->fb to match the code.
It looks like you caught all the functional bits at least.
With the above fixed, this is.
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/i915/intel_display.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 415fb8cf2cf4..1912c4f9eb61 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2877,9 +2877,8 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> if (i915_gem_object_is_tiled(obj))
> dev_priv->preserve_bios_swizzle = true;
>
> - drm_framebuffer_get(fb);
> - primary->fb = primary->state->fb = fb;
> - primary->crtc = primary->state->crtc = &intel_crtc->base;
> + plane_state->fb = fb;
> + plane_state->crtc = &intel_crtc->base;
>
> intel_set_plane_visible(to_intel_crtc_state(crtc_state),
> to_intel_plane_state(plane_state),
> --
> 2.16.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 06/13] drm/exynos: Stop updating plane->crtc
2018-04-05 15:13 ` [PATCH 06/13] drm/exynos: Stop updating plane->crtc Ville Syrjala
@ 2018-04-05 16:45 ` Daniel Vetter
2018-04-06 2:03 ` Inki Dae
0 siblings, 1 reply; 39+ messages in thread
From: Daniel Vetter @ 2018-04-05 16:45 UTC (permalink / raw)
To: Ville Syrjala; +Cc: Kyungmin Park, Seung-Woo Kim, intel-gfx, dri-devel
On Thu, Apr 05, 2018 at 06:13:53PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> We want to get rid of plane->crtc on atomic drivers. Stop setting it.
>
> Cc: Inki Dae <inki.dae@samsung.com>
> Cc: Joonyoung Shim <jy0922.shim@samsung.com>
> Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/exynos/exynos_drm_plane.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c
> index d2a90dae5c71..1b1af359c303 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c
> @@ -263,8 +263,6 @@ static void exynos_plane_atomic_update(struct drm_plane *plane,
> if (!state->crtc)
> return;
>
> - plane->crtc = state->crtc;
> -
> if (exynos_crtc->ops->update_plane)
> exynos_crtc->ops->update_plane(exynos_crtc, exynos_plane);
> }
> --
> 2.16.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [Intel-gfx] [PATCH 08/13] drm/virtio: Stop updating plane->crtc
2018-04-05 15:13 ` [PATCH 08/13] drm/virtio: Stop updating plane->crtc Ville Syrjala
@ 2018-04-05 16:46 ` Daniel Vetter
2018-04-05 16:46 ` Daniel Vetter
1 sibling, 0 replies; 39+ messages in thread
From: Daniel Vetter @ 2018-04-05 16:46 UTC (permalink / raw)
To: Ville Syrjala; +Cc: David Airlie, intel-gfx, dri-devel, virtualization
On Thu, Apr 05, 2018 at 06:13:55PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> We want to get rid of plane->crtc on atomic drivers. Stop setting it.
>
> v2: s/fb/crtc/ in the commit message (Gerd)
>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: virtualization@lists.linux-foundation.org
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/virtio/virtgpu_display.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c
> index 8cc8c34d67f5..42e842ceb53c 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_display.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_display.c
> @@ -302,8 +302,6 @@ static int vgdev_output_init(struct virtio_gpu_device *vgdev, int index)
> drm_crtc_init_with_planes(dev, crtc, primary, cursor,
> &virtio_gpu_crtc_funcs, NULL);
> drm_crtc_helper_add(crtc, &virtio_gpu_crtc_helper_funcs);
> - primary->crtc = crtc;
> - cursor->crtc = crtc;
>
> drm_connector_init(dev, connector, &virtio_gpu_connector_funcs,
> DRM_MODE_CONNECTOR_VIRTUAL);
> --
> 2.16.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [Intel-gfx] [PATCH 08/13] drm/virtio: Stop updating plane->crtc
2018-04-05 15:13 ` [PATCH 08/13] drm/virtio: Stop updating plane->crtc Ville Syrjala
2018-04-05 16:46 ` [Intel-gfx] " Daniel Vetter
@ 2018-04-05 16:46 ` Daniel Vetter
1 sibling, 0 replies; 39+ messages in thread
From: Daniel Vetter @ 2018-04-05 16:46 UTC (permalink / raw)
To: Ville Syrjala
Cc: David Airlie, intel-gfx, Gerd Hoffmann, dri-devel, virtualization
On Thu, Apr 05, 2018 at 06:13:55PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> We want to get rid of plane->crtc on atomic drivers. Stop setting it.
>
> v2: s/fb/crtc/ in the commit message (Gerd)
>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: virtualization@lists.linux-foundation.org
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/virtio/virtgpu_display.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c
> index 8cc8c34d67f5..42e842ceb53c 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_display.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_display.c
> @@ -302,8 +302,6 @@ static int vgdev_output_init(struct virtio_gpu_device *vgdev, int index)
> drm_crtc_init_with_planes(dev, crtc, primary, cursor,
> &virtio_gpu_crtc_funcs, NULL);
> drm_crtc_helper_add(crtc, &virtio_gpu_crtc_helper_funcs);
> - primary->crtc = crtc;
> - cursor->crtc = crtc;
>
> drm_connector_init(dev, connector, &virtio_gpu_connector_funcs,
> DRM_MODE_CONNECTOR_VIRTUAL);
> --
> 2.16.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 09/13] drm/vc4: Stop updating plane->fb/crtc
2018-04-05 15:13 ` [PATCH 09/13] drm/vc4: Stop updating plane->fb/crtc Ville Syrjala
@ 2018-04-05 16:46 ` Daniel Vetter
0 siblings, 0 replies; 39+ messages in thread
From: Daniel Vetter @ 2018-04-05 16:46 UTC (permalink / raw)
To: Ville Syrjala; +Cc: intel-gfx, dri-devel
On Thu, Apr 05, 2018 at 06:13:56PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> We want to get rid of plane->fb/crtc on atomic drivers. Stop setting
> them.
>
> Cc: Eric Anholt <eric@anholt.net>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/vc4/vc4_crtc.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
> index bf4667481935..a9f65e15889d 100644
> --- a/drivers/gpu/drm/vc4/vc4_crtc.c
> +++ b/drivers/gpu/drm/vc4/vc4_crtc.c
> @@ -837,7 +837,6 @@ static int vc4_async_page_flip(struct drm_crtc *crtc,
> * is released.
> */
> drm_atomic_set_fb_for_plane(plane->state, fb);
> - plane->fb = fb;
>
> vc4_queue_seqno_cb(dev, &flip_state->cb, bo->seqno,
> vc4_async_page_flip_complete);
> @@ -1032,7 +1031,6 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data)
> drm_crtc_init_with_planes(drm, crtc, primary_plane, NULL,
> &vc4_crtc_funcs, NULL);
> drm_crtc_helper_add(crtc, &vc4_crtc_helper_funcs);
> - primary_plane->crtc = crtc;
> vc4_crtc->channel = vc4_crtc->data->hvs_channel;
> drm_mode_crtc_set_gamma_size(crtc, ARRAY_SIZE(vc4_crtc->lut_r));
>
> @@ -1062,7 +1060,6 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data)
> cursor_plane = vc4_plane_init(drm, DRM_PLANE_TYPE_CURSOR);
> if (!IS_ERR(cursor_plane)) {
> cursor_plane->possible_crtcs = 1 << drm_crtc_index(crtc);
> - cursor_plane->crtc = crtc;
> crtc->cursor = cursor_plane;
> }
>
> --
> 2.16.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 11/13] drm/omapdrm: Nuke omap_framebuffer_get_next_connector()
2018-04-05 15:13 ` [PATCH 11/13] drm/omapdrm: Nuke omap_framebuffer_get_next_connector() Ville Syrjala
@ 2018-04-05 16:50 ` Daniel Vetter
2018-04-06 6:10 ` [Intel-gfx] " Tomi Valkeinen
0 siblings, 1 reply; 39+ messages in thread
From: Daniel Vetter @ 2018-04-05 16:50 UTC (permalink / raw)
To: Ville Syrjala; +Cc: intel-gfx, Tomi Valkeinen, dri-devel
On Thu, Apr 05, 2018 at 06:13:58PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> omap_framebuffer_get_next_connector() uses plane->fb which we want to
> deprecate for atomic drivers. As omap_framebuffer_get_next_connector()
> is unused just nuke the entire function.
>
> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Yeah was slightly worried how to fix up this one, but we're lucky!
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/omapdrm/omap_fb.c | 27 ---------------------------
> drivers/gpu/drm/omapdrm/omap_fb.h | 2 --
> 2 files changed, 29 deletions(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c
> index 5fd22ca73913..b54bcaad5cd1 100644
> --- a/drivers/gpu/drm/omapdrm/omap_fb.c
> +++ b/drivers/gpu/drm/omapdrm/omap_fb.c
> @@ -309,33 +309,6 @@ void omap_framebuffer_unpin(struct drm_framebuffer *fb)
> mutex_unlock(&omap_fb->lock);
> }
>
> -/* iterate thru all the connectors, returning ones that are attached
> - * to the same fb..
> - */
> -struct drm_connector *omap_framebuffer_get_next_connector(
> - struct drm_framebuffer *fb, struct drm_connector *from)
> -{
> - struct drm_device *dev = fb->dev;
> - struct list_head *connector_list = &dev->mode_config.connector_list;
> - struct drm_connector *connector = from;
> -
> - if (!from)
> - return list_first_entry_or_null(connector_list, typeof(*from),
> - head);
> -
> - list_for_each_entry_from(connector, connector_list, head) {
> - if (connector != from) {
> - struct drm_encoder *encoder = connector->encoder;
> - struct drm_crtc *crtc = encoder ? encoder->crtc : NULL;
> - if (crtc && crtc->primary->fb == fb)
> - return connector;
> -
> - }
> - }
> -
> - return NULL;
> -}
> -
> #ifdef CONFIG_DEBUG_FS
> void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m)
> {
> diff --git a/drivers/gpu/drm/omapdrm/omap_fb.h b/drivers/gpu/drm/omapdrm/omap_fb.h
> index 94ad5f9e4404..c20cb4bc714d 100644
> --- a/drivers/gpu/drm/omapdrm/omap_fb.h
> +++ b/drivers/gpu/drm/omapdrm/omap_fb.h
> @@ -38,8 +38,6 @@ int omap_framebuffer_pin(struct drm_framebuffer *fb);
> void omap_framebuffer_unpin(struct drm_framebuffer *fb);
> void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,
> struct drm_plane_state *state, struct omap_overlay_info *info);
> -struct drm_connector *omap_framebuffer_get_next_connector(
> - struct drm_framebuffer *fb, struct drm_connector *from);
> bool omap_framebuffer_supports_rotation(struct drm_framebuffer *fb);
> void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m);
>
> --
> 2.16.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* ✓ Fi.CI.BAT: success for series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc
2018-04-05 15:13 [PATCH 01/13] drm/msm: Stop consulting plane->fb/crtc Ville Syrjala
` (13 preceding siblings ...)
2018-04-05 16:33 ` [PATCH 01/13] " Daniel Vetter
@ 2018-04-05 16:51 ` Patchwork
2018-04-05 17:37 ` ✓ Fi.CI.BAT: success for series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc (rev2) Patchwork
` (2 subsequent siblings)
17 siblings, 0 replies; 39+ messages in thread
From: Patchwork @ 2018-04-05 16:51 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: intel-gfx
== Series Details ==
Series: series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc
URL : https://patchwork.freedesktop.org/series/41216/
State : success
== Summary ==
Series 41216v1 series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc
https://patchwork.freedesktop.org/api/1.0/series/41216/revisions/1/mbox/
---- Known issues:
Test gem_mmap_gtt:
Subgroup basic-small-bo-tiledx:
pass -> FAIL (fi-gdg-551) fdo#102575
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-a:
dmesg-warn -> PASS (fi-cnl-y3) fdo#104951
Test prime_vgem:
Subgroup basic-fence-flip:
fail -> PASS (fi-ilk-650) fdo#104008
fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#104951 https://bugs.freedesktop.org/show_bug.cgi?id=104951
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008
fi-bdw-5557u total:285 pass:264 dwarn:0 dfail:0 fail:0 skip:21 time:430s
fi-bdw-gvtdvm total:285 pass:261 dwarn:0 dfail:0 fail:0 skip:24 time:440s
fi-blb-e6850 total:285 pass:220 dwarn:1 dfail:0 fail:0 skip:64 time:382s
fi-bsw-n3050 total:285 pass:239 dwarn:0 dfail:0 fail:0 skip:46 time:542s
fi-bwr-2160 total:285 pass:180 dwarn:0 dfail:0 fail:0 skip:105 time:299s
fi-bxt-dsi total:285 pass:255 dwarn:0 dfail:0 fail:0 skip:30 time:514s
fi-bxt-j4205 total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:513s
fi-byt-j1900 total:285 pass:250 dwarn:0 dfail:0 fail:0 skip:35 time:526s
fi-byt-n2820 total:285 pass:246 dwarn:0 dfail:0 fail:0 skip:39 time:507s
fi-cfl-8700k total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:410s
fi-cfl-s3 total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:557s
fi-cfl-u total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:510s
fi-cnl-y3 total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:584s
fi-elk-e7500 total:285 pass:226 dwarn:0 dfail:0 fail:0 skip:59 time:423s
fi-gdg-551 total:285 pass:176 dwarn:0 dfail:0 fail:1 skip:108 time:315s
fi-glk-1 total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:538s
fi-glk-j4005 total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:484s
fi-hsw-4770 total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:405s
fi-ilk-650 total:285 pass:225 dwarn:0 dfail:0 fail:0 skip:60 time:423s
fi-ivb-3520m total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:458s
fi-ivb-3770 total:285 pass:252 dwarn:0 dfail:0 fail:0 skip:33 time:431s
fi-kbl-7500u total:285 pass:260 dwarn:1 dfail:0 fail:0 skip:24 time:475s
fi-kbl-7567u total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:468s
fi-kbl-r total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:511s
fi-pnv-d510 total:285 pass:220 dwarn:1 dfail:0 fail:0 skip:64 time:673s
fi-skl-6260u total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:439s
fi-skl-6600u total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:533s
fi-skl-6700k2 total:285 pass:261 dwarn:0 dfail:0 fail:0 skip:24 time:503s
fi-skl-6770hq total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:497s
fi-skl-guc total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:428s
fi-skl-gvtdvm total:285 pass:262 dwarn:0 dfail:0 fail:0 skip:23 time:445s
fi-snb-2520m total:285 pass:245 dwarn:0 dfail:0 fail:0 skip:40 time:573s
fi-snb-2600 total:285 pass:245 dwarn:0 dfail:0 fail:0 skip:40 time:405s
Blacklisted hosts:
fi-cnl-psr total:285 pass:256 dwarn:3 dfail:0 fail:0 skip:26 time:520s
fcaf73c13c14d6bfd64c4f37089bf5437fb32221 drm-tip: 2018y-04m-05d-15h-53m-18s UTC integration manifest
a0048e3620b9 drm: Add local 'plane' variable for tmp->primary
a4d66bf6aac3 drm: Stop updating plane->crtc/fb/old_fb on atomic drivers
80a8f31cfeb8 drm/omapdrm: Nuke omap_framebuffer_get_next_connector()
c8f702b91acd drm/atmel-hlcdc: Stop using plane->fb
255b200850a2 drm/vc4: Stop updating plane->fb/crtc
93d3d4449d2b drm/virtio: Stop updating plane->crtc
bf75eadf9ec6 drm/msm: Stop updating plane->fb/crtc
ccda7715e1ee drm/exynos: Stop updating plane->crtc
11cd7f1bf2da drm/i915: Stop updating plane->fb/crtc
783ba20e979e drm/amdgpu/dc: Stop updating plane->fb
ee54d28f0f26 drm/atmel-hlcdc: Stop consulting plane->crtc
f0a6ac59881b drm/sti: Stop consulting plane->crtc
1d7511097b76 drm/msm: Stop consulting plane->fb/crtc
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8600/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 12/13] drm: Stop updating plane->crtc/fb/old_fb on atomic drivers
2018-04-05 15:13 ` [PATCH 12/13] drm: Stop updating plane->crtc/fb/old_fb on atomic drivers Ville Syrjala
@ 2018-04-05 16:58 ` Daniel Vetter
0 siblings, 0 replies; 39+ messages in thread
From: Daniel Vetter @ 2018-04-05 16:58 UTC (permalink / raw)
To: Ville Syrjala; +Cc: intel-gfx, dri-devel
On Thu, Apr 05, 2018 at 06:13:59PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Stop playing around with plane->crtc/fb/old_fb with atomic
> drivers. Make life a lot simpler when we don't have to do the
> magic old_fb vs. fb dance around plane updates. That way we
> can't risk plane->fb getting out of sync with plane->state->fb
> and we're less likely to leak any refcounts as well.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Acked-by: Harry Wentland <harry.wentland@amd.com>
More bad news, I found more places:
- arcpgu in arc_pgu_crtc_atomic_disable(), no idea what exactly that one
tries to achieve.
- vmwgfx, especially vmwgfx_set_config_internal(). vmwgfx folks still owe
me a conversion of their driver to the fbdev helpers :-/
But slowly getting there I think.
Cheers, Daniel
> ---
> drivers/gpu/drm/drm_atomic.c | 55 ++++---------------------------------
> drivers/gpu/drm/drm_atomic_helper.c | 15 +---------
> drivers/gpu/drm/drm_crtc.c | 8 ++++--
> drivers/gpu/drm/drm_fb_helper.c | 7 -----
> drivers/gpu/drm/drm_framebuffer.c | 5 ----
> drivers/gpu/drm/drm_plane.c | 14 ++++++----
> drivers/gpu/drm/drm_plane_helper.c | 4 ++-
> include/drm/drm_atomic.h | 3 --
> 8 files changed, 24 insertions(+), 87 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index 7d25c42f22db..b16cc37e2adf 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -692,6 +692,11 @@ drm_atomic_get_plane_state(struct drm_atomic_state *state,
>
> WARN_ON(!state->acquire_ctx);
>
> + /* the legacy pointers should never be set */
> + WARN_ON(plane->fb);
> + WARN_ON(plane->old_fb);
> + WARN_ON(plane->crtc);
> +
> plane_state = drm_atomic_get_existing_plane_state(state, plane);
> if (plane_state)
> return plane_state;
> @@ -2021,45 +2026,6 @@ int drm_atomic_set_property(struct drm_atomic_state *state,
> return ret;
> }
>
> -/**
> - * drm_atomic_clean_old_fb -- Unset old_fb pointers and set plane->fb pointers.
> - *
> - * @dev: drm device to check.
> - * @plane_mask: plane mask for planes that were updated.
> - * @ret: return value, can be -EDEADLK for a retry.
> - *
> - * Before doing an update &drm_plane.old_fb is set to &drm_plane.fb, but before
> - * dropping the locks old_fb needs to be set to NULL and plane->fb updated. This
> - * is a common operation for each atomic update, so this call is split off as a
> - * helper.
> - */
> -void drm_atomic_clean_old_fb(struct drm_device *dev,
> - unsigned plane_mask,
> - int ret)
> -{
> - struct drm_plane *plane;
> -
> - /* if succeeded, fixup legacy plane crtc/fb ptrs before dropping
> - * locks (ie. while it is still safe to deref plane->state). We
> - * need to do this here because the driver entry points cannot
> - * distinguish between legacy and atomic ioctls.
> - */
> - drm_for_each_plane_mask(plane, dev, plane_mask) {
> - if (ret == 0) {
> - struct drm_framebuffer *new_fb = plane->state->fb;
> - if (new_fb)
> - drm_framebuffer_get(new_fb);
> - plane->fb = new_fb;
> - plane->crtc = plane->state->crtc;
> -
> - if (plane->old_fb)
> - drm_framebuffer_put(plane->old_fb);
> - }
> - plane->old_fb = NULL;
> - }
> -}
> -EXPORT_SYMBOL(drm_atomic_clean_old_fb);
> -
> /**
> * DOC: explicit fencing properties
> *
> @@ -2280,9 +2246,7 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
> unsigned int copied_objs, copied_props;
> struct drm_atomic_state *state;
> struct drm_modeset_acquire_ctx ctx;
> - struct drm_plane *plane;
> struct drm_out_fence_state *fence_state;
> - unsigned plane_mask;
> int ret = 0;
> unsigned int i, j, num_fences;
>
> @@ -2322,7 +2286,6 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
> state->allow_modeset = !!(arg->flags & DRM_MODE_ATOMIC_ALLOW_MODESET);
>
> retry:
> - plane_mask = 0;
> copied_objs = 0;
> copied_props = 0;
> fence_state = NULL;
> @@ -2393,12 +2356,6 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
> copied_props++;
> }
>
> - if (obj->type == DRM_MODE_OBJECT_PLANE && count_props &&
> - !(arg->flags & DRM_MODE_ATOMIC_TEST_ONLY)) {
> - plane = obj_to_plane(obj);
> - plane_mask |= (1 << drm_plane_index(plane));
> - plane->old_fb = plane->fb;
> - }
> drm_mode_object_put(obj);
> }
>
> @@ -2419,8 +2376,6 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
> }
>
> out:
> - drm_atomic_clean_old_fb(dev, plane_mask, ret);
> -
> complete_crtc_signaling(dev, state, fence_state, num_fences, !ret);
>
> if (ret == -EDEADLK) {
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index ee03c1ed2521..32d7787f0f89 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -2903,7 +2903,6 @@ static int __drm_atomic_helper_disable_all(struct drm_device *dev,
> struct drm_plane *plane;
> struct drm_crtc_state *crtc_state;
> struct drm_crtc *crtc;
> - unsigned plane_mask = 0;
> int ret, i;
>
> state = drm_atomic_state_alloc(dev);
> @@ -2946,17 +2945,10 @@ static int __drm_atomic_helper_disable_all(struct drm_device *dev,
> goto free;
>
> drm_atomic_set_fb_for_plane(plane_state, NULL);
> -
> - if (clean_old_fbs) {
> - plane->old_fb = plane->fb;
> - plane_mask |= BIT(drm_plane_index(plane));
> - }
> }
>
> ret = drm_atomic_commit(state);
> free:
> - if (plane_mask)
> - drm_atomic_clean_old_fb(dev, plane_mask, ret);
> drm_atomic_state_put(state);
> return ret;
> }
> @@ -3118,13 +3110,8 @@ int drm_atomic_helper_commit_duplicated_state(struct drm_atomic_state *state,
>
> state->acquire_ctx = ctx;
>
> - for_each_new_plane_in_state(state, plane, new_plane_state, i) {
> - WARN_ON(plane->crtc != new_plane_state->crtc);
> - WARN_ON(plane->fb != new_plane_state->fb);
> - WARN_ON(plane->old_fb);
> -
> + for_each_new_plane_in_state(state, plane, new_plane_state, i)
> state->planes[i].old_state = plane->state;
> - }
>
> for_each_new_crtc_in_state(state, crtc, new_crtc_state, i)
> state->crtcs[i].old_state = crtc->state;
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index a231dd5dce16..4e3c1a8d118a 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -474,8 +474,12 @@ static int __drm_mode_set_config_internal(struct drm_mode_set *set,
>
> ret = crtc->funcs->set_config(set, ctx);
> if (ret == 0) {
> - crtc->primary->crtc = fb ? crtc : NULL;
> - crtc->primary->fb = fb;
> + struct drm_plane *plane = crtc->primary;
> +
> + if (!plane->state) {
> + plane->crtc = fb ? crtc : NULL;
> + plane->fb = fb;
> + }
> }
>
> drm_for_each_crtc(tmp, crtc->dev) {
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index 0646b108030b..5639e804a0cd 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -368,7 +368,6 @@ static int restore_fbdev_mode_atomic(struct drm_fb_helper *fb_helper, bool activ
> struct drm_plane *plane;
> struct drm_atomic_state *state;
> int i, ret;
> - unsigned int plane_mask;
> struct drm_modeset_acquire_ctx ctx;
>
> drm_modeset_acquire_init(&ctx, 0);
> @@ -381,7 +380,6 @@ static int restore_fbdev_mode_atomic(struct drm_fb_helper *fb_helper, bool activ
>
> state->acquire_ctx = &ctx;
> retry:
> - plane_mask = 0;
> drm_for_each_plane(plane, dev) {
> plane_state = drm_atomic_get_plane_state(state, plane);
> if (IS_ERR(plane_state)) {
> @@ -391,9 +389,6 @@ static int restore_fbdev_mode_atomic(struct drm_fb_helper *fb_helper, bool activ
>
> plane_state->rotation = DRM_MODE_ROTATE_0;
>
> - plane->old_fb = plane->fb;
> - plane_mask |= 1 << drm_plane_index(plane);
> -
> /* disable non-primary: */
> if (plane->type == DRM_PLANE_TYPE_PRIMARY)
> continue;
> @@ -430,8 +425,6 @@ static int restore_fbdev_mode_atomic(struct drm_fb_helper *fb_helper, bool activ
> ret = drm_atomic_commit(state);
>
> out_state:
> - drm_atomic_clean_old_fb(dev, plane_mask, ret);
> -
> if (ret == -EDEADLK)
> goto backoff;
>
> diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c
> index 8c4d32adcc17..1bada12f9793 100644
> --- a/drivers/gpu/drm/drm_framebuffer.c
> +++ b/drivers/gpu/drm/drm_framebuffer.c
> @@ -837,8 +837,6 @@ static int atomic_remove_fb(struct drm_framebuffer *fb)
> goto unlock;
>
> plane_mask |= BIT(drm_plane_index(plane));
> -
> - plane->old_fb = plane->fb;
> }
>
> /* This list is only filled when disable_crtcs is set. */
> @@ -853,9 +851,6 @@ static int atomic_remove_fb(struct drm_framebuffer *fb)
> ret = drm_atomic_commit(state);
>
> unlock:
> - if (plane_mask)
> - drm_atomic_clean_old_fb(dev, plane_mask, ret);
> -
> if (ret == -EDEADLK) {
> drm_atomic_state_clear(state);
> drm_modeset_backoff(&ctx);
> diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
> index 035054455301..143041666096 100644
> --- a/drivers/gpu/drm/drm_plane.c
> +++ b/drivers/gpu/drm/drm_plane.c
> @@ -650,9 +650,11 @@ static int __setplane_internal(struct drm_plane *plane,
> crtc_x, crtc_y, crtc_w, crtc_h,
> src_x, src_y, src_w, src_h, ctx);
> if (!ret) {
> - plane->crtc = crtc;
> - plane->fb = fb;
> - drm_framebuffer_get(plane->fb);
> + if (!plane->state) {
> + plane->crtc = crtc;
> + plane->fb = fb;
> + drm_framebuffer_get(plane->fb);
> + }
> } else {
> plane->old_fb = NULL;
> }
> @@ -1092,8 +1094,10 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
> /* Keep the old fb, don't unref it. */
> plane->old_fb = NULL;
> } else {
> - plane->fb = fb;
> - drm_framebuffer_get(fb);
> + if (!plane->state) {
> + plane->fb = fb;
> + drm_framebuffer_get(fb);
> + }
> }
>
> out:
> diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c
> index f88f68161519..2010794943bc 100644
> --- a/drivers/gpu/drm/drm_plane_helper.c
> +++ b/drivers/gpu/drm/drm_plane_helper.c
> @@ -502,6 +502,7 @@ EXPORT_SYMBOL(drm_plane_helper_update);
> int drm_plane_helper_disable(struct drm_plane *plane)
> {
> struct drm_plane_state *plane_state;
> + struct drm_framebuffer *old_fb;
>
> /* crtc helpers love to call disable functions for already disabled hw
> * functions. So cope with that. */
> @@ -521,8 +522,9 @@ int drm_plane_helper_disable(struct drm_plane *plane)
> plane_state->plane = plane;
>
> plane_state->crtc = NULL;
> + old_fb = plane_state->fb;
> drm_atomic_set_fb_for_plane(plane_state, NULL);
>
> - return drm_plane_helper_commit(plane, plane_state, plane->fb);
> + return drm_plane_helper_commit(plane, plane_state, old_fb);
> }
> EXPORT_SYMBOL(drm_plane_helper_disable);
> diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
> index a57a8aa90ffb..ca461b6cf71f 100644
> --- a/include/drm/drm_atomic.h
> +++ b/include/drm/drm_atomic.h
> @@ -601,9 +601,6 @@ int __must_check
> drm_atomic_add_affected_planes(struct drm_atomic_state *state,
> struct drm_crtc *crtc);
>
> -void
> -drm_atomic_clean_old_fb(struct drm_device *dev, unsigned plane_mask, int ret);
> -
> int __must_check drm_atomic_check_only(struct drm_atomic_state *state);
> int __must_check drm_atomic_commit(struct drm_atomic_state *state);
> int __must_check drm_atomic_nonblocking_commit(struct drm_atomic_state *state);
> --
> 2.16.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 13/13] drm: Add local 'plane' variable for tmp->primary
2018-04-05 15:14 ` [PATCH 13/13] drm: Add local 'plane' variable for tmp->primary Ville Syrjala
@ 2018-04-05 16:59 ` Daniel Vetter
0 siblings, 0 replies; 39+ messages in thread
From: Daniel Vetter @ 2018-04-05 16:59 UTC (permalink / raw)
To: Ville Syrjala; +Cc: Daniel Vetter, intel-gfx, dri-devel
On Thu, Apr 05, 2018 at 06:14:00PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Clean up the ugly tmp->primary-> stuff in
> __drm_mode_set_config_internal() with a local plane variable.
>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
I think this can go in before the previous patch.
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/drm_crtc.c | 19 ++++++++++++-------
> 1 file changed, 12 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 4e3c1a8d118a..34c08dc92849 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -467,8 +467,11 @@ static int __drm_mode_set_config_internal(struct drm_mode_set *set,
> * connectors from it), hence we need to refcount the fbs across all
> * crtcs. Atomic modeset will have saner semantics ...
> */
> - drm_for_each_crtc(tmp, crtc->dev)
> - tmp->primary->old_fb = tmp->primary->fb;
> + drm_for_each_crtc(tmp, crtc->dev) {
> + struct drm_plane *plane = tmp->primary;
> +
> + plane->old_fb = plane->fb;
> + }
>
> fb = set->fb;
>
> @@ -483,11 +486,13 @@ static int __drm_mode_set_config_internal(struct drm_mode_set *set,
> }
>
> drm_for_each_crtc(tmp, crtc->dev) {
> - if (tmp->primary->fb)
> - drm_framebuffer_get(tmp->primary->fb);
> - if (tmp->primary->old_fb)
> - drm_framebuffer_put(tmp->primary->old_fb);
> - tmp->primary->old_fb = NULL;
> + struct drm_plane *plane = tmp->primary;
> +
> + if (plane->fb)
> + drm_framebuffer_get(plane->fb);
> + if (plane->old_fb)
> + drm_framebuffer_put(plane->old_fb);
> + plane->old_fb = NULL;
> }
>
> return ret;
> --
> 2.16.1
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH v2 05/13] drm/i915: Stop updating plane->fb/crtc
2018-04-05 15:13 ` [PATCH 05/13] drm/i915: Stop updating plane->fb/crtc Ville Syrjala
2018-04-05 16:44 ` Daniel Vetter
@ 2018-04-05 17:02 ` Ville Syrjala
2018-04-05 20:00 ` Daniel Vetter
1 sibling, 1 reply; 39+ messages in thread
From: Ville Syrjala @ 2018-04-05 17:02 UTC (permalink / raw)
To: dri-devel; +Cc: Daniel Vetter, intel-gfx
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
We want to get rid of plane->fb/crtc on atomic drivers. Stop setting
them.
v2: Fix up the comment in intel_crtc_active() and
nuke the rest of the stale comments (Daniel)
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> #v1
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
drivers/gpu/drm/i915/intel_atomic_plane.c | 12 ------------
drivers/gpu/drm/i915/intel_display.c | 7 +++----
2 files changed, 3 insertions(+), 16 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
index 7481ce85746b..eb0579fb5e54 100644
--- a/drivers/gpu/drm/i915/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
@@ -120,12 +120,6 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_
&crtc_state->base.adjusted_mode;
int ret;
- /*
- * Both crtc and plane->crtc could be NULL if we're updating a
- * property while the plane is disabled. We don't actually have
- * anything driver-specific we need to test in that case, so
- * just return success.
- */
if (!intel_state->base.crtc && !old_plane_state->base.crtc)
return 0;
@@ -204,12 +198,6 @@ static int intel_plane_atomic_check(struct drm_plane *plane,
const struct drm_crtc_state *old_crtc_state;
struct drm_crtc_state *new_crtc_state;
- /*
- * Both crtc and plane->crtc could be NULL if we're updating a
- * property while the plane is disabled. We don't actually have
- * anything driver-specific we need to test in that case, so
- * just return success.
- */
if (!crtc)
return 0;
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 415fb8cf2cf4..469792fa098d 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -979,7 +979,7 @@ bool intel_crtc_active(struct intel_crtc *crtc)
* We can ditch the adjusted_mode.crtc_clock check as soon
* as Haswell has gained clock readout/fastboot support.
*
- * We can ditch the crtc->primary->fb check as soon as we can
+ * We can ditch the crtc->primary->state->fb check as soon as we can
* properly reconstruct framebuffers.
*
* FIXME: The intel_crtc->active here should be switched to
@@ -2877,9 +2877,8 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
if (i915_gem_object_is_tiled(obj))
dev_priv->preserve_bios_swizzle = true;
- drm_framebuffer_get(fb);
- primary->fb = primary->state->fb = fb;
- primary->crtc = primary->state->crtc = &intel_crtc->base;
+ plane_state->fb = fb;
+ plane_state->crtc = &intel_crtc->base;
intel_set_plane_visible(to_intel_crtc_state(crtc_state),
to_intel_plane_state(plane_state),
--
2.16.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 39+ messages in thread
* ✓ Fi.CI.BAT: success for series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc (rev2)
2018-04-05 15:13 [PATCH 01/13] drm/msm: Stop consulting plane->fb/crtc Ville Syrjala
` (14 preceding siblings ...)
2018-04-05 16:51 ` ✓ Fi.CI.BAT: success for series starting with [01/13] " Patchwork
@ 2018-04-05 17:37 ` Patchwork
2018-04-05 19:48 ` ✓ Fi.CI.IGT: success for series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc Patchwork
2018-04-05 20:26 ` ✓ Fi.CI.IGT: success for series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc (rev2) Patchwork
17 siblings, 0 replies; 39+ messages in thread
From: Patchwork @ 2018-04-05 17:37 UTC (permalink / raw)
To: Ville Syrjala; +Cc: intel-gfx
== Series Details ==
Series: series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc (rev2)
URL : https://patchwork.freedesktop.org/series/41216/
State : success
== Summary ==
Series 41216v2 series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc
https://patchwork.freedesktop.org/api/1.0/series/41216/revisions/2/mbox/
---- Known issues:
Test gem_mmap_gtt:
Subgroup basic-small-bo-tiledx:
pass -> FAIL (fi-gdg-551) fdo#102575
Test kms_flip:
Subgroup basic-flip-vs-wf_vblank:
pass -> FAIL (fi-cfl-s3) fdo#100368
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-a:
dmesg-warn -> PASS (fi-cnl-y3) fdo#104951
Test prime_vgem:
Subgroup basic-fence-flip:
fail -> PASS (fi-ilk-650) fdo#104008
fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#104951 https://bugs.freedesktop.org/show_bug.cgi?id=104951
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008
fi-bdw-5557u total:285 pass:264 dwarn:0 dfail:0 fail:0 skip:21 time:431s
fi-bdw-gvtdvm total:285 pass:261 dwarn:0 dfail:0 fail:0 skip:24 time:440s
fi-blb-e6850 total:285 pass:220 dwarn:1 dfail:0 fail:0 skip:64 time:381s
fi-bsw-n3050 total:285 pass:239 dwarn:0 dfail:0 fail:0 skip:46 time:538s
fi-bwr-2160 total:285 pass:180 dwarn:0 dfail:0 fail:0 skip:105 time:297s
fi-bxt-j4205 total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:517s
fi-byt-j1900 total:285 pass:250 dwarn:0 dfail:0 fail:0 skip:35 time:519s
fi-byt-n2820 total:285 pass:246 dwarn:0 dfail:0 fail:0 skip:39 time:508s
fi-cfl-8700k total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:408s
fi-cfl-s3 total:285 pass:258 dwarn:0 dfail:0 fail:1 skip:26 time:552s
fi-cfl-u total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:513s
fi-cnl-y3 total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:587s
fi-elk-e7500 total:285 pass:226 dwarn:0 dfail:0 fail:0 skip:59 time:428s
fi-gdg-551 total:285 pass:176 dwarn:0 dfail:0 fail:1 skip:108 time:317s
fi-glk-1 total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:538s
fi-glk-j4005 total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:487s
fi-hsw-4770 total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:403s
fi-ilk-650 total:285 pass:225 dwarn:0 dfail:0 fail:0 skip:60 time:425s
fi-ivb-3520m total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:465s
fi-ivb-3770 total:285 pass:252 dwarn:0 dfail:0 fail:0 skip:33 time:434s
fi-kbl-7500u total:285 pass:260 dwarn:1 dfail:0 fail:0 skip:24 time:470s
fi-kbl-7567u total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:463s
fi-kbl-r total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:507s
fi-pnv-d510 total:285 pass:220 dwarn:1 dfail:0 fail:0 skip:64 time:663s
fi-skl-6260u total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:442s
fi-skl-6600u total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:529s
fi-skl-6700k2 total:285 pass:261 dwarn:0 dfail:0 fail:0 skip:24 time:498s
fi-skl-6770hq total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:494s
fi-skl-guc total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:431s
fi-skl-gvtdvm total:285 pass:262 dwarn:0 dfail:0 fail:0 skip:23 time:445s
fi-snb-2520m total:285 pass:245 dwarn:0 dfail:0 fail:0 skip:40 time:584s
fi-snb-2600 total:285 pass:245 dwarn:0 dfail:0 fail:0 skip:40 time:398s
Blacklisted hosts:
fi-cnl-psr total:285 pass:256 dwarn:3 dfail:0 fail:0 skip:26 time:518s
fcaf73c13c14d6bfd64c4f37089bf5437fb32221 drm-tip: 2018y-04m-05d-15h-53m-18s UTC integration manifest
e1b51ccc69f5 drm: Add local 'plane' variable for tmp->primary
33e599d07f38 drm: Stop updating plane->crtc/fb/old_fb on atomic drivers
57b2eeb3644c drm/omapdrm: Nuke omap_framebuffer_get_next_connector()
5a24279a8f74 drm/atmel-hlcdc: Stop using plane->fb
43630e6c913f drm/vc4: Stop updating plane->fb/crtc
714d9d1b9cb6 drm/virtio: Stop updating plane->crtc
f428f0ac9482 drm/msm: Stop updating plane->fb/crtc
c331a37b19af drm/exynos: Stop updating plane->crtc
67df61edf771 drm/i915: Stop updating plane->fb/crtc
11ba0fc12f00 drm/amdgpu/dc: Stop updating plane->fb
0679b27b65bc drm/atmel-hlcdc: Stop consulting plane->crtc
5c7efe59d8a0 drm/sti: Stop consulting plane->crtc
8862903b5411 drm/msm: Stop consulting plane->fb/crtc
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8602/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 04/13] drm/amdgpu/dc: Stop updating plane->fb
2018-04-05 16:41 ` Daniel Vetter
@ 2018-04-05 18:25 ` Harry Wentland
0 siblings, 0 replies; 39+ messages in thread
From: Harry Wentland @ 2018-04-05 18:25 UTC (permalink / raw)
To: Daniel Vetter, Ville Syrjala
Cc: Alex Deucher, intel-gfx, dri-devel, amd-gfx, Christian König
On 2018-04-05 12:41 PM, Daniel Vetter wrote:
> On Thu, Apr 05, 2018 at 06:13:51PM +0300, Ville Syrjala wrote:
>> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>
>> We want to get rid of plane->fb on atomic drivers. Stop setting it.
>>
>> Cc: Alex Deucher <alexander.deucher@amd.com>
>> Cc: "Christian König" <christian.koenig@amd.com>
>> Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com>
>> Cc: Harry Wentland <harry.wentland@amd.com>
>> Cc: amd-gfx@lists.freedesktop.org
>> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
>
> Under the assumption that all the hits outside of amdgpu/display/ are the
> legacy/non-DC/non-atomic modeset code (which looks to be the case):
>
Yes, that's the case.
Harry
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
>> ---
>> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 --
>> 1 file changed, 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> index e42a28e3adc5..91d048bb5574 100644
>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> @@ -3943,8 +3943,6 @@ static void amdgpu_dm_do_flip(struct drm_crtc *crtc,
>>
>> /* Flip */
>> spin_lock_irqsave(&crtc->dev->event_lock, flags);
>> - /* update crtc fb */
>> - crtc->primary->fb = fb;
>>
>> WARN_ON(acrtc->pflip_status != AMDGPU_FLIP_NONE);
>> WARN_ON(!acrtc_state->stream);
>> --
>> 2.16.1
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* ✓ Fi.CI.IGT: success for series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc
2018-04-05 15:13 [PATCH 01/13] drm/msm: Stop consulting plane->fb/crtc Ville Syrjala
` (15 preceding siblings ...)
2018-04-05 17:37 ` ✓ Fi.CI.BAT: success for series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc (rev2) Patchwork
@ 2018-04-05 19:48 ` Patchwork
2018-04-05 20:26 ` ✓ Fi.CI.IGT: success for series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc (rev2) Patchwork
17 siblings, 0 replies; 39+ messages in thread
From: Patchwork @ 2018-04-05 19:48 UTC (permalink / raw)
To: Ville Syrjala; +Cc: intel-gfx
== Series Details ==
Series: series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc
URL : https://patchwork.freedesktop.org/series/41216/
State : success
== Summary ==
---- Possible new issues:
Test kms_frontbuffer_tracking:
Subgroup fbcpsr-1p-primscrn-shrfb-msflip-blt:
fail -> SKIP (shard-snb)
---- Known issues:
Test kms_flip:
Subgroup 2x-flip-vs-expired-vblank:
fail -> PASS (shard-hsw) fdo#102887
Subgroup plain-flip-ts-check:
fail -> PASS (shard-hsw) fdo#100368 +1
Test kms_setmode:
Subgroup basic:
pass -> FAIL (shard-apl) fdo#99912
Test kms_sysfs_edid_timing:
warn -> PASS (shard-apl) fdo#100047
Test perf:
Subgroup blocking:
fail -> PASS (shard-hsw) fdo#102252
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
shard-apl total:2680 pass:1836 dwarn:1 dfail:0 fail:7 skip:836 time:12644s
shard-hsw total:2680 pass:1785 dwarn:1 dfail:0 fail:2 skip:891 time:11509s
shard-snb total:2680 pass:1376 dwarn:1 dfail:0 fail:4 skip:1299 time:6932s
Blacklisted hosts:
shard-kbl total:2622 pass:1918 dwarn:1 dfail:0 fail:7 skip:695 time:8935s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8600/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v2 05/13] drm/i915: Stop updating plane->fb/crtc
2018-04-05 17:02 ` [PATCH v2 " Ville Syrjala
@ 2018-04-05 20:00 ` Daniel Vetter
0 siblings, 0 replies; 39+ messages in thread
From: Daniel Vetter @ 2018-04-05 20:00 UTC (permalink / raw)
To: Ville Syrjala; +Cc: intel-gfx, dri-devel
On Thu, Apr 5, 2018 at 7:02 PM, Ville Syrjala
<ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> We want to get rid of plane->fb/crtc on atomic drivers. Stop setting
> them.
>
> v2: Fix up the comment in intel_crtc_active() and
> nuke the rest of the stale comments (Daniel)
>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> #v1
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
lgtm, ack on adding my r-b.
-Daniel
> ---
> drivers/gpu/drm/i915/intel_atomic_plane.c | 12 ------------
> drivers/gpu/drm/i915/intel_display.c | 7 +++----
> 2 files changed, 3 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
> index 7481ce85746b..eb0579fb5e54 100644
> --- a/drivers/gpu/drm/i915/intel_atomic_plane.c
> +++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
> @@ -120,12 +120,6 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_
> &crtc_state->base.adjusted_mode;
> int ret;
>
> - /*
> - * Both crtc and plane->crtc could be NULL if we're updating a
> - * property while the plane is disabled. We don't actually have
> - * anything driver-specific we need to test in that case, so
> - * just return success.
> - */
> if (!intel_state->base.crtc && !old_plane_state->base.crtc)
> return 0;
>
> @@ -204,12 +198,6 @@ static int intel_plane_atomic_check(struct drm_plane *plane,
> const struct drm_crtc_state *old_crtc_state;
> struct drm_crtc_state *new_crtc_state;
>
> - /*
> - * Both crtc and plane->crtc could be NULL if we're updating a
> - * property while the plane is disabled. We don't actually have
> - * anything driver-specific we need to test in that case, so
> - * just return success.
> - */
> if (!crtc)
> return 0;
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 415fb8cf2cf4..469792fa098d 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -979,7 +979,7 @@ bool intel_crtc_active(struct intel_crtc *crtc)
> * We can ditch the adjusted_mode.crtc_clock check as soon
> * as Haswell has gained clock readout/fastboot support.
> *
> - * We can ditch the crtc->primary->fb check as soon as we can
> + * We can ditch the crtc->primary->state->fb check as soon as we can
> * properly reconstruct framebuffers.
> *
> * FIXME: The intel_crtc->active here should be switched to
> @@ -2877,9 +2877,8 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> if (i915_gem_object_is_tiled(obj))
> dev_priv->preserve_bios_swizzle = true;
>
> - drm_framebuffer_get(fb);
> - primary->fb = primary->state->fb = fb;
> - primary->crtc = primary->state->crtc = &intel_crtc->base;
> + plane_state->fb = fb;
> + plane_state->crtc = &intel_crtc->base;
>
> intel_set_plane_visible(to_intel_crtc_state(crtc_state),
> to_intel_plane_state(plane_state),
> --
> 2.16.1
>
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* ✓ Fi.CI.IGT: success for series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc (rev2)
2018-04-05 15:13 [PATCH 01/13] drm/msm: Stop consulting plane->fb/crtc Ville Syrjala
` (16 preceding siblings ...)
2018-04-05 19:48 ` ✓ Fi.CI.IGT: success for series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc Patchwork
@ 2018-04-05 20:26 ` Patchwork
17 siblings, 0 replies; 39+ messages in thread
From: Patchwork @ 2018-04-05 20:26 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: intel-gfx
== Series Details ==
Series: series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc (rev2)
URL : https://patchwork.freedesktop.org/series/41216/
State : success
== Summary ==
---- Possible new issues:
Test kms_frontbuffer_tracking:
Subgroup fbcpsr-1p-primscrn-shrfb-msflip-blt:
fail -> SKIP (shard-snb)
---- Known issues:
Test kms_flip:
Subgroup 2x-flip-vs-expired-vblank:
fail -> PASS (shard-hsw) fdo#102887
Subgroup plain-flip-ts-check:
fail -> PASS (shard-hsw) fdo#100368
Test kms_setmode:
Subgroup basic:
pass -> FAIL (shard-apl) fdo#99912
Test kms_vblank:
Subgroup pipe-a-accuracy-idle:
pass -> FAIL (shard-hsw) fdo#102583
Test perf:
Subgroup blocking:
fail -> PASS (shard-hsw) fdo#102252
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
fdo#102583 https://bugs.freedesktop.org/show_bug.cgi?id=102583
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
shard-apl total:2680 pass:1835 dwarn:1 dfail:0 fail:7 skip:836 time:12708s
shard-hsw total:2680 pass:1785 dwarn:1 dfail:0 fail:2 skip:891 time:11402s
shard-snb total:2680 pass:1376 dwarn:1 dfail:0 fail:4 skip:1299 time:6911s
Blacklisted hosts:
shard-kbl total:2680 pass:1961 dwarn:1 dfail:1 fail:8 skip:709 time:9231s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8602/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 06/13] drm/exynos: Stop updating plane->crtc
2018-04-05 16:45 ` Daniel Vetter
@ 2018-04-06 2:03 ` Inki Dae
0 siblings, 0 replies; 39+ messages in thread
From: Inki Dae @ 2018-04-06 2:03 UTC (permalink / raw)
To: dri-devel
2018년 04월 06일 01:45에 Daniel Vetter 이(가) 쓴 글:
> On Thu, Apr 05, 2018 at 06:13:53PM +0300, Ville Syrjala wrote:
>> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>
>> We want to get rid of plane->crtc on atomic drivers. Stop setting it.
>>
>> Cc: Inki Dae <inki.dae@samsung.com>
>> Cc: Joonyoung Shim <jy0922.shim@samsung.com>
>> Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
>> Cc: Kyungmin Park <kyungmin.park@samsung.com>
>> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Daniel, could you pick up this patch series including a exynos patch? I think misc git is better than deconcentrating this patch series to each maintainer's tree.
Acked-by: Inki Dae <inki.dae@samsung.com>
Thanks,
Inki Dae
>
>> ---
>> drivers/gpu/drm/exynos/exynos_drm_plane.c | 2 --
>> 1 file changed, 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c
>> index d2a90dae5c71..1b1af359c303 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c
>> @@ -263,8 +263,6 @@ static void exynos_plane_atomic_update(struct drm_plane *plane,
>> if (!state->crtc)
>> return;
>>
>> - plane->crtc = state->crtc;
>> -
>> if (exynos_crtc->ops->update_plane)
>> exynos_crtc->ops->update_plane(exynos_crtc, exynos_plane);
>> }
>> --
>> 2.16.1
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [Intel-gfx] [PATCH 11/13] drm/omapdrm: Nuke omap_framebuffer_get_next_connector()
2018-04-05 16:50 ` Daniel Vetter
@ 2018-04-06 6:10 ` Tomi Valkeinen
2018-04-09 8:41 ` Daniel Vetter
0 siblings, 1 reply; 39+ messages in thread
From: Tomi Valkeinen @ 2018-04-06 6:10 UTC (permalink / raw)
To: Daniel Vetter, Ville Syrjala, Sebastian Reichel; +Cc: intel-gfx, dri-devel
On 05/04/18 19:50, Daniel Vetter wrote:
> On Thu, Apr 05, 2018 at 06:13:58PM +0300, Ville Syrjala wrote:
>> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>
>> omap_framebuffer_get_next_connector() uses plane->fb which we want to
>> deprecate for atomic drivers. As omap_framebuffer_get_next_connector()
>> is unused just nuke the entire function.
>>
>> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
>> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Yeah was slightly worried how to fix up this one, but we're lucky!
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
I tried to remove it just a week ago, but Sebastian said that it's used
by a unmerged series about DSI command mode displays, so I dropped the
patch.
In the unmerged series, it's used by omap_framebuffer_dirty() ([PATCHv3
3/8] drm/omap: add support for manually updated displays). So we have a
framebuffer, and we want to know which crtcs need to be flushed.
Tomi
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [Intel-gfx] [PATCH 11/13] drm/omapdrm: Nuke omap_framebuffer_get_next_connector()
2018-04-06 6:10 ` [Intel-gfx] " Tomi Valkeinen
@ 2018-04-09 8:41 ` Daniel Vetter
2018-04-16 13:29 ` Tomi Valkeinen
0 siblings, 1 reply; 39+ messages in thread
From: Daniel Vetter @ 2018-04-09 8:41 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: Sebastian Reichel, dri-devel, intel-gfx
On Fri, Apr 06, 2018 at 09:10:43AM +0300, Tomi Valkeinen wrote:
> On 05/04/18 19:50, Daniel Vetter wrote:
> > On Thu, Apr 05, 2018 at 06:13:58PM +0300, Ville Syrjala wrote:
> >> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >>
> >> omap_framebuffer_get_next_connector() uses plane->fb which we want to
> >> deprecate for atomic drivers. As omap_framebuffer_get_next_connector()
> >> is unused just nuke the entire function.
> >>
> >> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> >> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Yeah was slightly worried how to fix up this one, but we're lucky!
> >
> > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> I tried to remove it just a week ago, but Sebastian said that it's used
> by a unmerged series about DSI command mode displays, so I dropped the
> patch.
>
> In the unmerged series, it's used by omap_framebuffer_dirty() ([PATCHv3
> 3/8] drm/omap: add support for manually updated displays). So we have a
> framebuffer, and we want to know which crtcs need to be flushed.
You can't do that in atomic drivers.
You need to take appropriate locks and do the full ->state->fb deref.
Also, there's a gazillion of copies for generic framebuffer_dirty
implementations floating around, pleas try to coordinate with those.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [Intel-gfx] [PATCH 11/13] drm/omapdrm: Nuke omap_framebuffer_get_next_connector()
2018-04-09 8:41 ` Daniel Vetter
@ 2018-04-16 13:29 ` Tomi Valkeinen
0 siblings, 0 replies; 39+ messages in thread
From: Tomi Valkeinen @ 2018-04-16 13:29 UTC (permalink / raw)
To: Daniel Vetter; +Cc: Sebastian Reichel, intel-gfx, dri-devel
On 09/04/18 11:41, Daniel Vetter wrote:
> On Fri, Apr 06, 2018 at 09:10:43AM +0300, Tomi Valkeinen wrote:
>> On 05/04/18 19:50, Daniel Vetter wrote:
>>> On Thu, Apr 05, 2018 at 06:13:58PM +0300, Ville Syrjala wrote:
>>>> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>>>
>>>> omap_framebuffer_get_next_connector() uses plane->fb which we want to
>>>> deprecate for atomic drivers. As omap_framebuffer_get_next_connector()
>>>> is unused just nuke the entire function.
>>>>
>>>> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
>>>> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>>
>>> Yeah was slightly worried how to fix up this one, but we're lucky!
>>>
>>> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>>
>> I tried to remove it just a week ago, but Sebastian said that it's used
>> by a unmerged series about DSI command mode displays, so I dropped the
>> patch.
>>
>> In the unmerged series, it's used by omap_framebuffer_dirty() ([PATCHv3
>> 3/8] drm/omap: add support for manually updated displays). So we have a
>> framebuffer, and we want to know which crtcs need to be flushed.
>
> You can't do that in atomic drivers.
>
> You need to take appropriate locks and do the full ->state->fb deref.
> Also, there's a gazillion of copies for generic framebuffer_dirty
> implementations floating around, pleas try to coordinate with those.
Ok. In that case we need to refresh the manual update series to do
things differently. For this patch:
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Tomi
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 39+ messages in thread
end of thread, other threads:[~2018-04-16 13:30 UTC | newest]
Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-05 15:13 [PATCH 01/13] drm/msm: Stop consulting plane->fb/crtc Ville Syrjala
2018-04-05 15:13 ` [PATCH 02/13] drm/sti: Stop consulting plane->crtc Ville Syrjala
2018-04-05 16:34 ` Daniel Vetter
2018-04-05 15:13 ` [PATCH 03/13] drm/atmel-hlcdc: " Ville Syrjala
2018-04-05 16:35 ` Daniel Vetter
2018-04-05 15:13 ` [PATCH 04/13] drm/amdgpu/dc: Stop updating plane->fb Ville Syrjala
2018-04-05 16:41 ` Daniel Vetter
2018-04-05 18:25 ` Harry Wentland
2018-04-05 15:13 ` [PATCH 05/13] drm/i915: Stop updating plane->fb/crtc Ville Syrjala
2018-04-05 16:44 ` Daniel Vetter
2018-04-05 17:02 ` [PATCH v2 " Ville Syrjala
2018-04-05 20:00 ` Daniel Vetter
2018-04-05 15:13 ` [PATCH 06/13] drm/exynos: Stop updating plane->crtc Ville Syrjala
2018-04-05 16:45 ` Daniel Vetter
2018-04-06 2:03 ` Inki Dae
[not found] ` <20180405151400.11326-1-ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2018-04-05 15:13 ` [PATCH 07/13] drm/msm: Stop updating plane->fb/crtc Ville Syrjala
2018-04-05 16:32 ` Daniel Vetter
2018-04-05 15:13 ` [PATCH 08/13] drm/virtio: Stop updating plane->crtc Ville Syrjala
2018-04-05 16:46 ` [Intel-gfx] " Daniel Vetter
2018-04-05 16:46 ` Daniel Vetter
2018-04-05 15:13 ` [PATCH 09/13] drm/vc4: Stop updating plane->fb/crtc Ville Syrjala
2018-04-05 16:46 ` Daniel Vetter
2018-04-05 15:13 ` [PATCH 10/13] drm/atmel-hlcdc: Stop using plane->fb Ville Syrjala
2018-04-05 16:38 ` Daniel Vetter
2018-04-05 15:13 ` [PATCH 11/13] drm/omapdrm: Nuke omap_framebuffer_get_next_connector() Ville Syrjala
2018-04-05 16:50 ` Daniel Vetter
2018-04-06 6:10 ` [Intel-gfx] " Tomi Valkeinen
2018-04-09 8:41 ` Daniel Vetter
2018-04-16 13:29 ` Tomi Valkeinen
2018-04-05 15:13 ` [PATCH 12/13] drm: Stop updating plane->crtc/fb/old_fb on atomic drivers Ville Syrjala
2018-04-05 16:58 ` Daniel Vetter
2018-04-05 15:14 ` [PATCH 13/13] drm: Add local 'plane' variable for tmp->primary Ville Syrjala
2018-04-05 16:59 ` Daniel Vetter
2018-04-05 15:45 ` ✗ Fi.CI.BAT: failure for series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc Patchwork
2018-04-05 16:33 ` [PATCH 01/13] " Daniel Vetter
2018-04-05 16:51 ` ✓ Fi.CI.BAT: success for series starting with [01/13] " Patchwork
2018-04-05 17:37 ` ✓ Fi.CI.BAT: success for series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc (rev2) Patchwork
2018-04-05 19:48 ` ✓ Fi.CI.IGT: success for series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc Patchwork
2018-04-05 20:26 ` ✓ Fi.CI.IGT: success for series starting with [01/13] drm/msm: Stop consulting plane->fb/crtc (rev2) Patchwork
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.