All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 1/5] drm: Add function to convert rect in 16.16 fixed format to regular format
@ 2020-12-14 17:49 ` José Roberto de Souza
  0 siblings, 0 replies; 28+ messages in thread
From: José Roberto de Souza @ 2020-12-14 17:49 UTC (permalink / raw)
  To: intel-gfx; +Cc: José Roberto de Souza, dri-devel, Gwan-gyeong Mun

Much more clear to read one function call than four lines doing this
conversion.

Cc: dri-devel@lists.freedesktop.org
Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 drivers/gpu/drm/drm_rect.c | 15 +++++++++++++++
 include/drm/drm_rect.h     |  2 ++
 2 files changed, 17 insertions(+)

diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c
index 0460e874896e..24345704b353 100644
--- a/drivers/gpu/drm/drm_rect.c
+++ b/drivers/gpu/drm/drm_rect.c
@@ -373,3 +373,18 @@ void drm_rect_rotate_inv(struct drm_rect *r,
 	}
 }
 EXPORT_SYMBOL(drm_rect_rotate_inv);
+
+/**
+ * drm_rect_convert_16_16_to_regular - Convert a rect in 16.16 fixed point form
+ * to regular form.
+ * @in: rect in 16.16 fixed point form
+ * @out: rect to be stored the converted value
+ */
+void drm_rect_convert_16_16_to_regular(struct drm_rect *in, struct drm_rect *out)
+{
+	out->x1 = in->x1 >> 16;
+	out->y1 = in->y1 >> 16;
+	out->x2 = in->x2 >> 16;
+	out->y2 = in->y2 >> 16;
+}
+EXPORT_SYMBOL(drm_rect_convert_16_16_to_regular);
diff --git a/include/drm/drm_rect.h b/include/drm/drm_rect.h
index e7f4d24cdd00..2ef8180416cd 100644
--- a/include/drm/drm_rect.h
+++ b/include/drm/drm_rect.h
@@ -223,5 +223,7 @@ void drm_rect_rotate(struct drm_rect *r,
 void drm_rect_rotate_inv(struct drm_rect *r,
 			 int width, int height,
 			 unsigned int rotation);
+void drm_rect_convert_16_16_to_regular(struct drm_rect *in,
+				       struct drm_rect *out);
 
 #endif
-- 
2.29.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Intel-gfx] [PATCH v6 1/5] drm: Add function to convert rect in 16.16 fixed format to regular format
@ 2020-12-14 17:49 ` José Roberto de Souza
  0 siblings, 0 replies; 28+ messages in thread
From: José Roberto de Souza @ 2020-12-14 17:49 UTC (permalink / raw)
  To: intel-gfx; +Cc: dri-devel

Much more clear to read one function call than four lines doing this
conversion.

Cc: dri-devel@lists.freedesktop.org
Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 drivers/gpu/drm/drm_rect.c | 15 +++++++++++++++
 include/drm/drm_rect.h     |  2 ++
 2 files changed, 17 insertions(+)

diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c
index 0460e874896e..24345704b353 100644
--- a/drivers/gpu/drm/drm_rect.c
+++ b/drivers/gpu/drm/drm_rect.c
@@ -373,3 +373,18 @@ void drm_rect_rotate_inv(struct drm_rect *r,
 	}
 }
 EXPORT_SYMBOL(drm_rect_rotate_inv);
+
+/**
+ * drm_rect_convert_16_16_to_regular - Convert a rect in 16.16 fixed point form
+ * to regular form.
+ * @in: rect in 16.16 fixed point form
+ * @out: rect to be stored the converted value
+ */
+void drm_rect_convert_16_16_to_regular(struct drm_rect *in, struct drm_rect *out)
+{
+	out->x1 = in->x1 >> 16;
+	out->y1 = in->y1 >> 16;
+	out->x2 = in->x2 >> 16;
+	out->y2 = in->y2 >> 16;
+}
+EXPORT_SYMBOL(drm_rect_convert_16_16_to_regular);
diff --git a/include/drm/drm_rect.h b/include/drm/drm_rect.h
index e7f4d24cdd00..2ef8180416cd 100644
--- a/include/drm/drm_rect.h
+++ b/include/drm/drm_rect.h
@@ -223,5 +223,7 @@ void drm_rect_rotate(struct drm_rect *r,
 void drm_rect_rotate_inv(struct drm_rect *r,
 			 int width, int height,
 			 unsigned int rotation);
+void drm_rect_convert_16_16_to_regular(struct drm_rect *in,
+				       struct drm_rect *out);
 
 #endif
-- 
2.29.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Intel-gfx] [PATCH v6 2/5] drm/i915/display/psr: Use plane damage clips to calculate damaged area
  2020-12-14 17:49 ` [Intel-gfx] " José Roberto de Souza
  (?)
@ 2020-12-14 17:49 ` José Roberto de Souza
  2020-12-15 13:02   ` Mun, Gwan-gyeong
  -1 siblings, 1 reply; 28+ messages in thread
From: José Roberto de Souza @ 2020-12-14 17:49 UTC (permalink / raw)
  To: intel-gfx

Now using plane damage clips property to calcualte the damaged area.
Selective fetch only supports one region to be fetched so software
needs to calculate a bounding box around all damage clips.

Now that we are not complete fetching each plane, there is another
loop needed as all the plane areas that intersect with the pipe
damaged area needs to be fetched from memory so the complete blending
of all planes can happen.

v2:
- do not shifthing new_plane_state->uapi.dst only src is in 16.16 format

v4:
- setting plane selective fetch area using the whole pipe damage area
- mark the whole plane area damaged if plane visibility or alpha
changed

v5:
- taking in consideration src.y1 in the damage coordinates
- adding to the pipe damaged area planes that were visible but are
invisible in the new state

v6:
- consider old state plane coordinates when visibility changes or it
moved to calculate damaged area
- remove from damaged area the portion not in src clip

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 drivers/gpu/drm/i915/display/intel_psr.c | 98 +++++++++++++++++++++---
 1 file changed, 86 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index d9a395c486d3..7daed098fa74 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -1269,8 +1269,8 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
 				struct intel_crtc *crtc)
 {
 	struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc);
+	struct drm_rect pipe_clip = { .x1 = 0, .y1 = -1, .x2 = INT_MAX, .y2 = -1 };
 	struct intel_plane_state *new_plane_state, *old_plane_state;
-	struct drm_rect pipe_clip = { .y1 = -1 };
 	struct intel_plane *plane;
 	bool full_update = false;
 	int i, ret;
@@ -1282,9 +1282,17 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
 	if (ret)
 		return ret;
 
+	/*
+	 * Calculate minimal selective fetch area of each plane and calculate
+	 * the pipe damaged area.
+	 * In the next loop the plane selective fetch area will actually be set
+	 * using whole pipe damaged area.
+	 */
 	for_each_oldnew_intel_plane_in_state(state, plane, old_plane_state,
 					     new_plane_state, i) {
-		struct drm_rect *sel_fetch_area, temp;
+		struct drm_rect src, damaged_area = { .x1 = 0, .y1 = -1, .x2 = INT_MAX, .y2 = -1 };
+		struct drm_mode_rect *damaged_clips;
+		u32 num_clips, j;
 
 		if (new_plane_state->uapi.crtc != crtc_state->uapi.crtc)
 			continue;
@@ -1300,23 +1308,89 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
 			break;
 		}
 
-		if (!new_plane_state->uapi.visible)
-			continue;
+		drm_rect_convert_16_16_to_regular(&new_plane_state->uapi.src, &src);
+		damaged_clips = drm_plane_get_damage_clips(&new_plane_state->uapi);
+		num_clips = drm_plane_get_damage_clips_count(&new_plane_state->uapi);
 
 		/*
-		 * For now doing a selective fetch in the whole plane area,
-		 * optimizations will come in the future.
+		 * If visibility or plane moved, mark the whole plane area as
+		 * damaged as it needs to be complete redraw in the new and old
+		 * position.
 		 */
+		if (new_plane_state->uapi.visible != old_plane_state->uapi.visible ||
+		    !drm_rect_equals(&new_plane_state->uapi.dst,
+				     &old_plane_state->uapi.dst)) {
+			damaged_area.y1 = old_plane_state->uapi.src.y1 >> 16;
+			damaged_area.y1 = old_plane_state->uapi.src.y2 >> 16;
+			damaged_area.y1 += old_plane_state->uapi.dst.y1;
+			damaged_area.y2 += old_plane_state->uapi.dst.y1;
+			clip_area_update(&pipe_clip, &damaged_area);
+
+			num_clips = 0;
+			damaged_area.y1 = src.y1;
+			damaged_area.y2 = src.y2;
+		} else if (new_plane_state->uapi.alpha != old_plane_state->uapi.alpha) {
+			num_clips = 0;
+			damaged_area.y1 = src.y1;
+			damaged_area.y2 = src.y2;
+		} else if (!num_clips &&
+			   new_plane_state->uapi.fb != old_plane_state->uapi.fb) {
+			/*
+			 * If the plane don't have damage areas but the
+			 * framebuffer changed, mark the whole plane area as
+			 * damaged.
+			 */
+			damaged_area.y1 = src.y1;
+			damaged_area.y2 = src.y2;
+		}
+
+		for (j = 0; j < num_clips; j++) {
+			struct drm_rect clip;
+
+			clip.y1 = damaged_clips[j].y1;
+			clip.y2 = damaged_clips[j].y2;
+			clip_area_update(&damaged_area, &clip);
+		}
+
+		if (!drm_rect_intersect(&damaged_area, &src))
+			continue;
+
+		damaged_area.y1 += new_plane_state->uapi.dst.y1;
+		damaged_area.y2 += new_plane_state->uapi.dst.y1;
+		clip_area_update(&pipe_clip, &damaged_area);
+	}
+
+	if (full_update)
+		goto skip_sel_fetch_set_loop;
+
+	/*
+	 * Now that we have the pipe damaged area check if it intersect with
+	 * every plane, if it does set the plane selective fetch area.
+	 */
+	for_each_oldnew_intel_plane_in_state(state, plane, old_plane_state,
+					     new_plane_state, i) {
+		struct drm_rect *sel_fetch_area, inter, src;
+
+		if (new_plane_state->uapi.crtc != crtc_state->uapi.crtc ||
+		    !new_plane_state->uapi.visible)
+			continue;
+
+		inter = pipe_clip;
+		if (!drm_rect_intersect(&inter, &new_plane_state->uapi.dst))
+			continue;
+
+		drm_rect_convert_16_16_to_regular(&new_plane_state->uapi.src, &src);
+
 		sel_fetch_area = &new_plane_state->psr2_sel_fetch_area;
-		sel_fetch_area->y1 = new_plane_state->uapi.src.y1 >> 16;
-		sel_fetch_area->y2 = new_plane_state->uapi.src.y2 >> 16;
+		sel_fetch_area->y1 = inter.y1 - new_plane_state->uapi.dst.y1;
+		sel_fetch_area->y2 = inter.y2 - new_plane_state->uapi.dst.y1;
+		sel_fetch_area->x1 = src.x1;
+		sel_fetch_area->x2 = src.x2;
 
-		temp = *sel_fetch_area;
-		temp.y1 += new_plane_state->uapi.dst.y1;
-		temp.y2 += new_plane_state->uapi.dst.y2;
-		clip_area_update(&pipe_clip, &temp);
+		drm_rect_intersect(sel_fetch_area, &src);
 	}
 
+skip_sel_fetch_set_loop:
 	psr2_man_trk_ctl_calc(crtc_state, &pipe_clip, full_update);
 	return 0;
 }
-- 
2.29.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Intel-gfx] [PATCH v6 3/5] drm/i915/display: Split and export main surface calculation from skl_check_main_surface()
  2020-12-14 17:49 ` [Intel-gfx] " José Roberto de Souza
  (?)
  (?)
@ 2020-12-14 17:49 ` José Roberto de Souza
  -1 siblings, 0 replies; 28+ messages in thread
From: José Roberto de Souza @ 2020-12-14 17:49 UTC (permalink / raw)
  To: intel-gfx

The calculation the offsets of the main surface will be needed by PSR2
selective fetch code so here splitting and exporting it.
No functional changes were done here.

v3: Rebased

Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Tested-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 78 ++++++++++++--------
 drivers/gpu/drm/i915/display/intel_display.h |  2 +
 2 files changed, 51 insertions(+), 29 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 761be8deaa9b..411b9f3c9dc7 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -3821,33 +3821,19 @@ static int intel_plane_max_height(struct intel_plane *plane,
 		return INT_MAX;
 }
 
-static int skl_check_main_surface(struct intel_plane_state *plane_state)
+int skl_calc_main_surface_offset(const struct intel_plane_state *plane_state,
+				 int *x, int *y, u32 *offset)
 {
 	struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
 	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
 	const struct drm_framebuffer *fb = plane_state->hw.fb;
-	unsigned int rotation = plane_state->hw.rotation;
-	int x = plane_state->uapi.src.x1 >> 16;
-	int y = plane_state->uapi.src.y1 >> 16;
-	int w = drm_rect_width(&plane_state->uapi.src) >> 16;
-	int h = drm_rect_height(&plane_state->uapi.src) >> 16;
-	int min_width = intel_plane_min_width(plane, fb, 0, rotation);
-	int max_width = intel_plane_max_width(plane, fb, 0, rotation);
-	int max_height = intel_plane_max_height(plane, fb, 0, rotation);
-	int aux_plane = intel_main_to_aux_plane(fb, 0);
-	u32 aux_offset = plane_state->color_plane[aux_plane].offset;
-	u32 alignment, offset;
+	const int aux_plane = intel_main_to_aux_plane(fb, 0);
+	const u32 aux_offset = plane_state->color_plane[aux_plane].offset;
+	const u32 alignment = intel_surf_alignment(fb, 0);
+	const int w = drm_rect_width(&plane_state->uapi.src) >> 16;
 
-	if (w > max_width || w < min_width || h > max_height) {
-		drm_dbg_kms(&dev_priv->drm,
-			    "requested Y/RGB source size %dx%d outside limits (min: %dx1 max: %dx%d)\n",
-			    w, h, min_width, max_width, max_height);
-		return -EINVAL;
-	}
-
-	intel_add_fb_offsets(&x, &y, plane_state, 0);
-	offset = intel_plane_compute_aligned_offset(&x, &y, plane_state, 0);
-	alignment = intel_surf_alignment(fb, 0);
+	intel_add_fb_offsets(x, y, plane_state, 0);
+	*offset = intel_plane_compute_aligned_offset(x, y, plane_state, 0);
 	if (drm_WARN_ON(&dev_priv->drm, alignment && !is_power_of_2(alignment)))
 		return -EINVAL;
 
@@ -3856,9 +3842,10 @@ static int skl_check_main_surface(struct intel_plane_state *plane_state)
 	 * main surface offset, and it must be non-negative. Make
 	 * sure that is what we will get.
 	 */
-	if (aux_plane && offset > aux_offset)
-		offset = intel_plane_adjust_aligned_offset(&x, &y, plane_state, 0,
-							   offset, aux_offset & ~(alignment - 1));
+	if (aux_plane && *offset > aux_offset)
+		*offset = intel_plane_adjust_aligned_offset(x, y, plane_state, 0,
+							    *offset,
+							    aux_offset & ~(alignment - 1));
 
 	/*
 	 * When using an X-tiled surface, the plane blows up
@@ -3869,18 +3856,51 @@ static int skl_check_main_surface(struct intel_plane_state *plane_state)
 	if (fb->modifier == I915_FORMAT_MOD_X_TILED) {
 		int cpp = fb->format->cpp[0];
 
-		while ((x + w) * cpp > plane_state->color_plane[0].stride) {
-			if (offset == 0) {
+		while ((*x + w) * cpp > plane_state->color_plane[0].stride) {
+			if (*offset == 0) {
 				drm_dbg_kms(&dev_priv->drm,
 					    "Unable to find suitable display surface offset due to X-tiling\n");
 				return -EINVAL;
 			}
 
-			offset = intel_plane_adjust_aligned_offset(&x, &y, plane_state, 0,
-								   offset, offset - alignment);
+			*offset = intel_plane_adjust_aligned_offset(x, y, plane_state, 0,
+								    *offset,
+								    *offset - alignment);
 		}
 	}
 
+	return 0;
+}
+
+static int skl_check_main_surface(struct intel_plane_state *plane_state)
+{
+	struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
+	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
+	const unsigned int rotation = plane_state->hw.rotation;
+	int x = plane_state->uapi.src.x1 >> 16;
+	int y = plane_state->uapi.src.y1 >> 16;
+	const int w = drm_rect_width(&plane_state->uapi.src) >> 16;
+	const int h = drm_rect_height(&plane_state->uapi.src) >> 16;
+	const int min_width = intel_plane_min_width(plane, fb, 0, rotation);
+	const int max_width = intel_plane_max_width(plane, fb, 0, rotation);
+	const int max_height = intel_plane_max_height(plane, fb, 0, rotation);
+	const int aux_plane = intel_main_to_aux_plane(fb, 0);
+	const u32 alignment = intel_surf_alignment(fb, 0);
+	u32 offset;
+	int ret;
+
+	if (w > max_width || w < min_width || h > max_height) {
+		drm_dbg_kms(&dev_priv->drm,
+			    "requested Y/RGB source size %dx%d outside limits (min: %dx1 max: %dx%d)\n",
+			    w, h, min_width, max_width, max_height);
+		return -EINVAL;
+	}
+
+	ret = skl_calc_main_surface_offset(plane_state, &x, &y, &offset);
+	if (ret)
+		return ret;
+
 	/*
 	 * CCS AUX surface doesn't have its own x/y offsets, we must make sure
 	 * they match with the main surface x/y offsets.
diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h
index a5771bfecba6..eb263bf9314d 100644
--- a/drivers/gpu/drm/i915/display/intel_display.h
+++ b/drivers/gpu/drm/i915/display/intel_display.h
@@ -630,6 +630,8 @@ u32 skl_plane_ctl_crtc(const struct intel_crtc_state *crtc_state);
 u32 skl_plane_stride(const struct intel_plane_state *plane_state,
 		     int plane);
 int skl_check_plane_surface(struct intel_plane_state *plane_state);
+int skl_calc_main_surface_offset(const struct intel_plane_state *plane_state,
+				 int *x, int *y, u32 *offset);
 int i9xx_check_plane_surface(struct intel_plane_state *plane_state);
 int skl_format_to_fourcc(int format, bool rgb_order, bool alpha);
 unsigned int i9xx_plane_max_stride(struct intel_plane *plane,
-- 
2.29.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Intel-gfx] [PATCH v6 4/5] drm/i915/display/psr: Program plane's calculated offset to plane SF register
  2020-12-14 17:49 ` [Intel-gfx] " José Roberto de Souza
                   ` (2 preceding siblings ...)
  (?)
@ 2020-12-14 17:49 ` José Roberto de Souza
  -1 siblings, 0 replies; 28+ messages in thread
From: José Roberto de Souza @ 2020-12-14 17:49 UTC (permalink / raw)
  To: intel-gfx

It programs Plane's calculated x, y, offset to Plane SF register.
It does the calculation of x and y offsets using
skl_calc_main_surface_offset().

v3: Update commit message

Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Tested-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
---
 drivers/gpu/drm/i915/display/intel_psr.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index 7daed098fa74..51a9bc2040ee 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -1186,7 +1186,8 @@ void intel_psr2_program_plane_sel_fetch(struct intel_plane *plane,
 	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
 	enum pipe pipe = plane->pipe;
 	const struct drm_rect *clip;
-	u32 val;
+	u32 val, offset;
+	int ret, x, y;
 
 	if (!crtc_state->enable_psr2_sel_fetch)
 		return;
@@ -1203,9 +1204,14 @@ void intel_psr2_program_plane_sel_fetch(struct intel_plane *plane,
 	val |= plane_state->uapi.dst.x1;
 	intel_de_write_fw(dev_priv, PLANE_SEL_FETCH_POS(pipe, plane->id), val);
 
-	/* TODO: consider tiling and auxiliary surfaces */
-	val = (clip->y1 + plane_state->color_plane[color_plane].y) << 16;
-	val |= plane_state->color_plane[color_plane].x;
+	/* TODO: consider auxiliary surfaces */
+	x = plane_state->uapi.src.x1 >> 16;
+	y = (plane_state->uapi.src.y1 >> 16) + clip->y1;
+	ret = skl_calc_main_surface_offset(plane_state, &x, &y, &offset);
+	if (ret)
+		drm_warn_once(&dev_priv->drm, "skl_calc_main_surface_offset() returned %i\n",
+			      ret);
+	val = y << 16 | x;
 	intel_de_write_fw(dev_priv, PLANE_SEL_FETCH_OFFSET(pipe, plane->id),
 			  val);
 
-- 
2.29.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Intel-gfx] [PATCH v6 5/5] HAX/DO_NOT_MERGE_IT: drm/i915/display: Enable PSR2 selective fetch for testing
  2020-12-14 17:49 ` [Intel-gfx] " José Roberto de Souza
                   ` (3 preceding siblings ...)
  (?)
@ 2020-12-14 17:49 ` José Roberto de Souza
  -1 siblings, 0 replies; 28+ messages in thread
From: José Roberto de Souza @ 2020-12-14 17:49 UTC (permalink / raw)
  To: intel-gfx

Enabling it to check if it causes regressions in CI but the feature is
still not ready to be enabled by default.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 drivers/gpu/drm/i915/i915_params.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index 330c03e2b4f7..b8b19270c339 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -54,7 +54,7 @@ struct drm_printer;
 	param(int, enable_fbc, -1, 0600) \
 	param(int, enable_psr, -1, 0600) \
 	param(bool, psr_safest_params, false, 0600) \
-	param(bool, enable_psr2_sel_fetch, false, 0600) \
+	param(bool, enable_psr2_sel_fetch, true, 0600) \
 	param(int, disable_power_well, -1, 0400) \
 	param(int, enable_ips, 1, 0600) \
 	param(int, invert_brightness, 0, 0600) \
-- 
2.29.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [v6,1/5] drm: Add function to convert rect in 16.16 fixed format to regular format
  2020-12-14 17:49 ` [Intel-gfx] " José Roberto de Souza
                   ` (4 preceding siblings ...)
  (?)
@ 2020-12-14 18:39 ` Patchwork
  -1 siblings, 0 replies; 28+ messages in thread
From: Patchwork @ 2020-12-14 18:39 UTC (permalink / raw)
  To: José Roberto de Souza; +Cc: intel-gfx

== Series Details ==

Series: series starting with [v6,1/5] drm: Add function to convert rect in 16.16 fixed format to regular format
URL   : https://patchwork.freedesktop.org/series/84910/
State : warning

== Summary ==

$ dim sparse --fast origin/drm-tip
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1398:25: error: incompatible types in comparison expression (different address spaces):
+drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1398:25:    struct dma_fence *
+drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1398:25:    struct dma_fence [noderef] __rcu *
+drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1399:17: error: incompatible types in comparison expression (different address spaces):
+drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1399:17:    struct dma_fence *
+drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1399:17:    struct dma_fence [noderef] __rcu *
+drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1458:17: error: incompatible types in comparison expression (different address spaces):
+drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1458:17:    struct dma_fence *
+drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1458:17:    struct dma_fence [noderef] __rcu *
+drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:268:16: error: incompatible types in comparison expression (different type sizes):
+drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:268:16:    unsigned long *
+drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:268:16:    unsigned long long *
+drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:276:25: error: incompatible types in comparison expression (different address spaces):
+drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:276:25:    struct dma_fence *
+drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:276:25:    struct dma_fence [noderef] __rcu *
+drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:277:17: error: incompatible types in comparison expression (different address spaces):
+drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:277:17:    struct dma_fence *
+drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:277:17:    struct dma_fence [noderef] __rcu *
+drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:331:17: error: incompatible types in comparison expression (different address spaces):
+drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:331:17:    struct dma_fence *
+drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:331:17:    struct dma_fence [noderef] __rcu *
+drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h:92:56: error: marked inline, but without a definition
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:257:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amd


_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Intel-gfx] ✗ Fi.CI.DOCS: warning for series starting with [v6,1/5] drm: Add function to convert rect in 16.16 fixed format to regular format
  2020-12-14 17:49 ` [Intel-gfx] " José Roberto de Souza
                   ` (5 preceding siblings ...)
  (?)
@ 2020-12-14 18:42 ` Patchwork
  -1 siblings, 0 replies; 28+ messages in thread
From: Patchwork @ 2020-12-14 18:42 UTC (permalink / raw)
  To: José Roberto de Souza; +Cc: intel-gfx

== Series Details ==

Series: series starting with [v6,1/5] drm: Add function to convert rect in 16.16 fixed format to regular format
URL   : https://patchwork.freedesktop.org/series/84910/
State : warning

== Summary ==

$ make htmldocs 2>&1 > /dev/null | grep i915
Error: Cannot open file ./drivers/gpu/drm/i915/gt/intel_lrc.c
WARNING: kernel-doc './scripts/kernel-doc -rst -enable-lineno -sphinx-version 1.7.9 -function Logical Rings, Logical Ring Contexts and Execlists ./drivers/gpu/drm/i915/gt/intel_lrc.c' failed with return code 1


_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Intel-gfx] ✗ Fi.CI.BAT: failure for series starting with [v6,1/5] drm: Add function to convert rect in 16.16 fixed format to regular format
  2020-12-14 17:49 ` [Intel-gfx] " José Roberto de Souza
                   ` (6 preceding siblings ...)
  (?)
@ 2020-12-14 19:07 ` Patchwork
  -1 siblings, 0 replies; 28+ messages in thread
From: Patchwork @ 2020-12-14 19:07 UTC (permalink / raw)
  To: José Roberto de Souza; +Cc: intel-gfx


[-- Attachment #1.1: Type: text/plain, Size: 5521 bytes --]

== Series Details ==

Series: series starting with [v6,1/5] drm: Add function to convert rect in 16.16 fixed format to regular format
URL   : https://patchwork.freedesktop.org/series/84910/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_9481 -> Patchwork_19139
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with Patchwork_19139 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_19139, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19139/index.html

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in Patchwork_19139:

### IGT changes ###

#### Possible regressions ####

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
    - fi-tgl-y:           [PASS][1] -> [FAIL][2] +3 similar issues
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9481/fi-tgl-y/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19139/fi-tgl-y/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html

  
Known issues
------------

  Here are the changes found in Patchwork_19139 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@debugfs_test@read_all_entries:
    - fi-tgl-y:           [PASS][3] -> [DMESG-WARN][4] ([i915#402])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9481/fi-tgl-y/igt@debugfs_test@read_all_entries.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19139/fi-tgl-y/igt@debugfs_test@read_all_entries.html

  * igt@i915_module_load@reload:
    - fi-tgl-u2:          [PASS][5] -> [DMESG-WARN][6] ([i915#402] / [k.org#205379])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9481/fi-tgl-u2/igt@i915_module_load@reload.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19139/fi-tgl-u2/igt@i915_module_load@reload.html

  * igt@i915_pm_rpm@module-reload:
    - fi-tgl-u2:          [PASS][7] -> [DMESG-WARN][8] ([i915#402]) +1 similar issue
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9481/fi-tgl-u2/igt@i915_pm_rpm@module-reload.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19139/fi-tgl-u2/igt@i915_pm_rpm@module-reload.html

  * igt@kms_addfb_basic@addfb25-y-tiled-small-legacy:
    - fi-snb-2600:        NOTRUN -> [SKIP][9] ([fdo#109271]) +30 similar issues
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19139/fi-snb-2600/igt@kms_addfb_basic@addfb25-y-tiled-small-legacy.html

  * igt@kms_chamelium@hdmi-crc-fast:
    - fi-snb-2600:        NOTRUN -> [SKIP][10] ([fdo#109271] / [fdo#111827]) +8 similar issues
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19139/fi-snb-2600/igt@kms_chamelium@hdmi-crc-fast.html

  * igt@kms_psr@primary_page_flip:
    - fi-tgl-u2:          [PASS][11] -> [SKIP][12] ([i915#668]) +3 similar issues
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9481/fi-tgl-u2/igt@kms_psr@primary_page_flip.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19139/fi-tgl-u2/igt@kms_psr@primary_page_flip.html

  * igt@runner@aborted:
    - fi-bdw-5557u:       NOTRUN -> [FAIL][13] ([i915#2029] / [i915#2722])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19139/fi-bdw-5557u/igt@runner@aborted.html

  
#### Possible fixes ####

  * igt@gem_exec_suspend@basic-s3:
    - fi-snb-2600:        [DMESG-WARN][14] -> [PASS][15]
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9481/fi-snb-2600/igt@gem_exec_suspend@basic-s3.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19139/fi-snb-2600/igt@gem_exec_suspend@basic-s3.html

  
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [i915#2029]: https://gitlab.freedesktop.org/drm/intel/issues/2029
  [i915#2722]: https://gitlab.freedesktop.org/drm/intel/issues/2722
  [i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402
  [i915#668]: https://gitlab.freedesktop.org/drm/intel/issues/668
  [k.org#205379]: https://bugzilla.kernel.org/show_bug.cgi?id=205379


Participating hosts (44 -> 39)
------------------------------

  Missing    (5): fi-ilk-m540 fi-hsw-4200u fi-bsw-cyan fi-ctg-p8600 fi-bdw-samus 


Build changes
-------------

  * Linux: CI_DRM_9481 -> Patchwork_19139

  CI-20190529: 20190529
  CI_DRM_9481: 968d6b8835487575d68732a7c0a1588795900de4 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5893: ec4073d30b428aaf199c0f4de6c0a5ebdc1c1c65 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_19139: 9adededf27e11a3dc0c76e0864afcab150f65c0b @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

9adededf27e1 HAX/DO_NOT_MERGE_IT: drm/i915/display: Enable PSR2 selective fetch for testing
6b6386a01742 drm/i915/display/psr: Program plane's calculated offset to plane SF register
0f58eeb423b2 drm/i915/display: Split and export main surface calculation from skl_check_main_surface()
749bf211b579 drm/i915/display/psr: Use plane damage clips to calculate damaged area
173e7e37d722 drm: Add function to convert rect in 16.16 fixed format to regular format

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19139/index.html

[-- Attachment #1.2: Type: text/html, Size: 6564 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v6 1/5] drm: Add function to convert rect in 16.16 fixed format to regular format
  2020-12-14 17:49 ` [Intel-gfx] " José Roberto de Souza
@ 2020-12-15 12:52   ` Mun, Gwan-gyeong
  -1 siblings, 0 replies; 28+ messages in thread
From: Mun, Gwan-gyeong @ 2020-12-15 12:52 UTC (permalink / raw)
  To: intel-gfx, Souza, Jose; +Cc: dri-devel

On Mon, 2020-12-14 at 09:49 -0800, José Roberto de Souza wrote:
> Much more clear to read one function call than four lines doing this
> conversion.
> 
> Cc: dri-devel@lists.freedesktop.org
> Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> ---
>  drivers/gpu/drm/drm_rect.c | 15 +++++++++++++++
>  include/drm/drm_rect.h     |  2 ++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c
> index 0460e874896e..24345704b353 100644
> --- a/drivers/gpu/drm/drm_rect.c
> +++ b/drivers/gpu/drm/drm_rect.c
> @@ -373,3 +373,18 @@ void drm_rect_rotate_inv(struct drm_rect *r,
>  	}
>  }
>  EXPORT_SYMBOL(drm_rect_rotate_inv);
> +
> +/**
> + * drm_rect_convert_16_16_to_regular - Convert a rect in 16.16 fixed
> point form
> + * to regular form.
> + * @in: rect in 16.16 fixed point form
> + * @out: rect to be stored the converted value
> + */
> +void drm_rect_convert_16_16_to_regular(struct drm_rect *in, struct
> drm_rect *out)
> +{
> +	out->x1 = in->x1 >> 16;
> +	out->y1 = in->y1 >> 16;
> +	out->x2 = in->x2 >> 16;
> +	out->y2 = in->y2 >> 16;
> +}
> +EXPORT_SYMBOL(drm_rect_convert_16_16_to_regular);
> diff --git a/include/drm/drm_rect.h b/include/drm/drm_rect.h
> index e7f4d24cdd00..2ef8180416cd 100644
> --- a/include/drm/drm_rect.h
> +++ b/include/drm/drm_rect.h
> @@ -223,5 +223,7 @@ void drm_rect_rotate(struct drm_rect *r,
>  void drm_rect_rotate_inv(struct drm_rect *r,
>  			 int width, int height,
>  			 unsigned int rotation);
> +void drm_rect_convert_16_16_to_regular(struct drm_rect *in,
> +				       struct drm_rect *out);
> 
Hi,
if it's purpose is just converting 16.16 fp to integer, how about you
have function prototype like this?
extern inline struct drm_rect
drm_rect_convert_16_16_fp_to_integer(struct drm_rect in)

And if there are no use case on drm core or other drivers except i915
display yet,
before adding this function to drm core, how about you add this
function code to i915 first?

Br,
G.G.
>  #endif
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [Intel-gfx] [PATCH v6 1/5] drm: Add function to convert rect in 16.16 fixed format to regular format
@ 2020-12-15 12:52   ` Mun, Gwan-gyeong
  0 siblings, 0 replies; 28+ messages in thread
From: Mun, Gwan-gyeong @ 2020-12-15 12:52 UTC (permalink / raw)
  To: intel-gfx, Souza, Jose; +Cc: dri-devel

On Mon, 2020-12-14 at 09:49 -0800, José Roberto de Souza wrote:
> Much more clear to read one function call than four lines doing this
> conversion.
> 
> Cc: dri-devel@lists.freedesktop.org
> Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> ---
>  drivers/gpu/drm/drm_rect.c | 15 +++++++++++++++
>  include/drm/drm_rect.h     |  2 ++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c
> index 0460e874896e..24345704b353 100644
> --- a/drivers/gpu/drm/drm_rect.c
> +++ b/drivers/gpu/drm/drm_rect.c
> @@ -373,3 +373,18 @@ void drm_rect_rotate_inv(struct drm_rect *r,
>  	}
>  }
>  EXPORT_SYMBOL(drm_rect_rotate_inv);
> +
> +/**
> + * drm_rect_convert_16_16_to_regular - Convert a rect in 16.16 fixed
> point form
> + * to regular form.
> + * @in: rect in 16.16 fixed point form
> + * @out: rect to be stored the converted value
> + */
> +void drm_rect_convert_16_16_to_regular(struct drm_rect *in, struct
> drm_rect *out)
> +{
> +	out->x1 = in->x1 >> 16;
> +	out->y1 = in->y1 >> 16;
> +	out->x2 = in->x2 >> 16;
> +	out->y2 = in->y2 >> 16;
> +}
> +EXPORT_SYMBOL(drm_rect_convert_16_16_to_regular);
> diff --git a/include/drm/drm_rect.h b/include/drm/drm_rect.h
> index e7f4d24cdd00..2ef8180416cd 100644
> --- a/include/drm/drm_rect.h
> +++ b/include/drm/drm_rect.h
> @@ -223,5 +223,7 @@ void drm_rect_rotate(struct drm_rect *r,
>  void drm_rect_rotate_inv(struct drm_rect *r,
>  			 int width, int height,
>  			 unsigned int rotation);
> +void drm_rect_convert_16_16_to_regular(struct drm_rect *in,
> +				       struct drm_rect *out);
> 
Hi,
if it's purpose is just converting 16.16 fp to integer, how about you
have function prototype like this?
extern inline struct drm_rect
drm_rect_convert_16_16_fp_to_integer(struct drm_rect in)

And if there are no use case on drm core or other drivers except i915
display yet,
before adding this function to drm core, how about you add this
function code to i915 first?

Br,
G.G.
>  #endif
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [Intel-gfx] [PATCH v6 2/5] drm/i915/display/psr: Use plane damage clips to calculate damaged area
  2020-12-14 17:49 ` [Intel-gfx] [PATCH v6 2/5] drm/i915/display/psr: Use plane damage clips to calculate damaged area José Roberto de Souza
@ 2020-12-15 13:02   ` Mun, Gwan-gyeong
  2020-12-15 13:14     ` Souza, Jose
  0 siblings, 1 reply; 28+ messages in thread
From: Mun, Gwan-gyeong @ 2020-12-15 13:02 UTC (permalink / raw)
  To: intel-gfx, Souza, Jose

On Mon, 2020-12-14 at 09:49 -0800, José Roberto de Souza wrote:
> Now using plane damage clips property to calcualte the damaged area.
> Selective fetch only supports one region to be fetched so software
> needs to calculate a bounding box around all damage clips.
> 
> Now that we are not complete fetching each plane, there is another
> loop needed as all the plane areas that intersect with the pipe
> damaged area needs to be fetched from memory so the complete blending
> of all planes can happen.
> 
Hi,
> v2:
> - do not shifthing new_plane_state->uapi.dst only src is in 16.16 
Typo on commit message. shifthing -> shifting
> format
> 
> v4:
> - setting plane selective fetch area using the whole pipe damage area
> - mark the whole plane area damaged if plane visibility or alpha
> changed
> 
> v5:
> - taking in consideration src.y1 in the damage coordinates
> - adding to the pipe damaged area planes that were visible but are
> invisible in the new state
> 
> v6:
> - consider old state plane coordinates when visibility changes or it
> moved to calculate damaged area
> - remove from damaged area the portion not in src clip
> 
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_psr.c | 98 +++++++++++++++++++++-
> --
>  1 file changed, 86 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_psr.c
> b/drivers/gpu/drm/i915/display/intel_psr.c
> index d9a395c486d3..7daed098fa74 100644
> --- a/drivers/gpu/drm/i915/display/intel_psr.c
> +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> @@ -1269,8 +1269,8 @@ int intel_psr2_sel_fetch_update(struct
> intel_atomic_state *state,
>  				struct intel_crtc *crtc)
>  {
>  	struct intel_crtc_state *crtc_state =
> intel_atomic_get_new_crtc_state(state, crtc);
> +	struct drm_rect pipe_clip = { .x1 = 0, .y1 = -1, .x2 = INT_MAX,
> .y2 = -1 };
>  	struct intel_plane_state *new_plane_state, *old_plane_state;
> -	struct drm_rect pipe_clip = { .y1 = -1 };
>  	struct intel_plane *plane;
>  	bool full_update = false;
>  	int i, ret;
> @@ -1282,9 +1282,17 @@ int intel_psr2_sel_fetch_update(struct
> intel_atomic_state *state,
>  	if (ret)
>  		return ret;
>  
> +	/*
> +	 * Calculate minimal selective fetch area of each plane and
> calculate
> +	 * the pipe damaged area.
> +	 * In the next loop the plane selective fetch area will
> actually be set
> +	 * using whole pipe damaged area.
> +	 */
>  	for_each_oldnew_intel_plane_in_state(state, plane,
> old_plane_state,
>  					     new_plane_state, i) {
> -		struct drm_rect *sel_fetch_area, temp;
> +		struct drm_rect src, damaged_area = { .x1 = 0, .y1 =
> -1, .x2 = INT_MAX, .y2 = -1 };
> +		struct drm_mode_rect *damaged_clips;
> +		u32 num_clips, j;
>  
>  		if (new_plane_state->uapi.crtc != crtc_state-
> >uapi.crtc)
>  			continue;
> @@ -1300,23 +1308,89 @@ int intel_psr2_sel_fetch_update(struct
> intel_atomic_state *state,
>  			break;
>  		}
>  
> -		if (!new_plane_state->uapi.visible)
> -			continue;
> +		drm_rect_convert_16_16_to_regular(&new_plane_state-
> >uapi.src, &src);
> +		damaged_clips =
> drm_plane_get_damage_clips(&new_plane_state->uapi);
> +		num_clips =
> drm_plane_get_damage_clips_count(&new_plane_state->uapi);
>  
>  		/*
> -		 * For now doing a selective fetch in the whole plane
> area,
> -		 * optimizations will come in the future.
> +		 * If visibility or plane moved, mark the whole plane
> area as
> +		 * damaged as it needs to be complete redraw in the new
> and old
> +		 * position.
>  		 */
> +		if (new_plane_state->uapi.visible != old_plane_state-
> >uapi.visible ||
> +		    !drm_rect_equals(&new_plane_state->uapi.dst,
> +				     &old_plane_state->uapi.dst)) {
> +			damaged_area.y1 = old_plane_state->uapi.src.y1
> >> 16;
> +			damaged_area.y1 = old_plane_state->uapi.src.y2
> >> 16;
> +			damaged_area.y1 += old_plane_state-
> >uapi.dst.y1;
> +			damaged_area.y2 += old_plane_state-
> >uapi.dst.y1;
> +			clip_area_update(&pipe_clip, &damaged_area);
> +
> +			num_clips = 0;
> +			damaged_area.y1 = src.y1;
> +			damaged_area.y2 = src.y2;
1. Visibility change case
 The pipe damaged area (The Selective Update region) needs to
accumulate being visible plane's dst between old and new plane's dst.

if you are implementing this scenario, the code shoule be like this,

if (new_plane_state->uapi.visible != old_plane_state->uapi.visible) {
   if (new_plane_state->uapi.visible) {
      damaged_area.y1 = new_plane_state->uapi.dst.y1;
      damaged_area.y2 = new_plane_state->uapi.dst.y2;
   } else {
      damaged_area.y1 = old_plane_state->uapi.dst.y1;
      damaged_area.y2 = old_plane_state->uapi.dst.y2;
   }
   clip_area_update(&pipe_clip, &damaged_area);
   continue;
}

2. Move case
 The pipe damaged area (The Selective Update region) needs to
accumulate both old and new plane's dst

if you are implementing this scenario, the code shoule be like this,

else if (!drm_rect_equals(&new_plane_state->uapi.dst, &old_plane_state-
>uapi.dst)) {
   damaged_area.y1 = new_plane_state->uapi.dst.y1;
   damaged_area.y2 = new_plane_state->uapi.dst.y2;
   clip_area_update(&pipe_clip, &damaged_area);

   damaged_area.y1 = old_plane_state->uapi.dst.y1;
   damaged_area.y2 = old_plane_state->uapi.dst.y2;
   clip_area_update(&pipe_clip, &damaged_area);
   
   continue;
}
> +		} else if (new_plane_state->uapi.alpha !=
> old_plane_state->uapi.alpha) {
> +			num_clips = 0;
> +			damaged_area.y1 = src.y1;
> +			damaged_area.y2 = src.y2;
3. alpha has changed ( because alpha handling section is not optimized,
it can be treated with the move section)

else if (new_plane_state->uapi.alpha != old_plane_state->uapi.alpha) {
   damaged_area.y1 = new_plane_state->uapi.dst.y1;
   damaged_area.y2 = new_plane_state->uapi.dst.y2;
   clip_area_update(&pipe_clip, &damaged_area);

   damaged_area.y1 = old_plane_state->uapi.dst.y1;
   damaged_area.y2 = old_plane_state->uapi.dst.y2;
   clip_area_update(&pipe_clip, &damaged_area);
   
   continue;
} 
> +		} else if (!num_clips &&
> +			   new_plane_state->uapi.fb != old_plane_state-
> >uapi.fb) {
> +			/*
> +			 * If the plane don't have damage areas but the
> +			 * framebuffer changed, mark the whole plane
> area as
> +			 * damaged.
> +			 */
> +			damaged_area.y1 = src.y1;
> +			damaged_area.y2 = src.y2;
> +		}
> +
else if (!num_clips && new_plane_state->uapi.fb != old_plane_state-
>uapi.fb) {
   /*
    * If the plane don't have damage areas but the
    * framebuffer changed, mark the whole plane area as
    * damaged.
    */
   damaged_area.y1 = new_plane_state->uapi.dst.y1;
   damaged_area.y2 = new_plane_state->uapi.dst.y2;
   clip_area_update(&pipe_clip, &damaged_area);
   continue;
}
> +		for (j = 0; j < num_clips; j++) {
> +			struct drm_rect clip;
> +
> +			clip.y1 = damaged_clips[j].y1;
> +			clip.y2 = damaged_clips[j].y2;
> +			clip_area_update(&damaged_area, &clip);
> +		}
> +
> +		if (!drm_rect_intersect(&damaged_area, &src))
> +			continue;
> +
> +		damaged_area.y1 += new_plane_state->uapi.dst.y1;
> +		damaged_area.y2 += new_plane_state->uapi.dst.y1;
> +		clip_area_update(&pipe_clip, &damaged_area);
> +	}
> +
else if (num_clips) {
   struct drm_rect plane_damaged_area;
   plane_damaged_area.x1 = src.x1;
   plane_damaged_area.x2 = src.x2;
   plane_damaged_area.y1 = 0;
   plane_damaged_area.y2 = 0;
	        
   for (j = 0; j < num_clips; j++) {
      struct drm_rect clip;

      clip.x1 = damaged_clips[j].x1;
      clip.x2 = damaged_clips[j].x2;
      clip.y1 = damaged_clips[j].y1;
      clip.y2 = damaged_clips[j].y2;

      if (drm_rect_intersect(&clip, &src)) {
         clip_area_update(&plane_damaged_area, &clip);
      }
   }

  if (drm_rect_visible(plane_damaged_area)) {
     plane_damaged_area.y1 = plane_damaged_area.y1 - src.y1 +
new_plane_state->uapi.dst.y1;
     plane_damaged_area.y2 = plane_damaged_area.y2 - src.y1 +
new_plane_state->uapi.dst.y1;

     clip_area_update(&pipe_clip, &plane_damaged_area);
     continue;
  }
}
the calculation and translating cooridinates is alreay implemented here
( https://patchwork.freedesktop.org/patch/404264/?series=84340&rev=1
  it has commetns which explains scenarios.) 
> +	if (full_update)
> +		goto skip_sel_fetch_set_loop;
> +
> +	/*
> +	 * Now that we have the pipe damaged area check if it intersect
> with
> +	 * every plane, if it does set the plane selective fetch area.
> +	 */
> +	for_each_oldnew_intel_plane_in_state(state, plane,
> old_plane_state,
> +					     new_plane_state, i) {
> +		struct drm_rect *sel_fetch_area, inter, src;
> +
> +		if (new_plane_state->uapi.crtc != crtc_state->uapi.crtc 
> ||
> +		    !new_plane_state->uapi.visible)
> +			continue;
> +
> +		inter = pipe_clip;
> +		if (!drm_rect_intersect(&inter, &new_plane_state-
> >uapi.dst))
> +			continue;
> +
> +		drm_rect_convert_16_16_to_regular(&new_plane_state-
> >uapi.src, &src);
> +
>  		sel_fetch_area = &new_plane_state->psr2_sel_fetch_area;
> -		sel_fetch_area->y1 = new_plane_state->uapi.src.y1 >>
> 16;
> -		sel_fetch_area->y2 = new_plane_state->uapi.src.y2 >>
> 16;
> +		sel_fetch_area->y1 = inter.y1 - new_plane_state-
> >uapi.dst.y1;
> +		sel_fetch_area->y2 = inter.y2 - new_plane_state-
> >uapi.dst.y1;
sel_fetch_area->y1 = inter.y1 - new_plane_state->uapi.dst.y1 + src.y1;
sel_fetch_area->y2 = inter.y2 - new_plane_state->uapi.dst.y1 + src.y1;
> +		sel_fetch_area->x1 = src.x1;
> +		sel_fetch_area->x2 = src.x2;
>  
> -		temp = *sel_fetch_area;
> -		temp.y1 += new_plane_state->uapi.dst.y1;
> -		temp.y2 += new_plane_state->uapi.dst.y2;
> -		clip_area_update(&pipe_clip, &temp);
> +		drm_rect_intersect(sel_fetch_area, &src);
why this line is needed?
>  	}
>  
> +skip_sel_fetch_set_loop:
>  	psr2_man_trk_ctl_calc(crtc_state, &pipe_clip, full_update);
>  	return 0;
>  }
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [Intel-gfx] [PATCH v6 2/5] drm/i915/display/psr: Use plane damage clips to calculate damaged area
  2020-12-15 13:02   ` Mun, Gwan-gyeong
@ 2020-12-15 13:14     ` Souza, Jose
  2020-12-16 10:29       ` Mun, Gwan-gyeong
  0 siblings, 1 reply; 28+ messages in thread
From: Souza, Jose @ 2020-12-15 13:14 UTC (permalink / raw)
  To: Mun, Gwan-gyeong, intel-gfx

On Tue, 2020-12-15 at 13:02 +0000, Mun, Gwan-gyeong wrote:
> On Mon, 2020-12-14 at 09:49 -0800, José Roberto de Souza wrote:
> > Now using plane damage clips property to calcualte the damaged area.
> > Selective fetch only supports one region to be fetched so software
> > needs to calculate a bounding box around all damage clips.
> > 
> > Now that we are not complete fetching each plane, there is another
> > loop needed as all the plane areas that intersect with the pipe
> > damaged area needs to be fetched from memory so the complete blending
> > of all planes can happen.
> > 
> Hi,
> > v2:
> > - do not shifthing new_plane_state->uapi.dst only src is in 16.16 
> Typo on commit message. shifthing -> shifting
> > format
> > 
> > v4:
> > - setting plane selective fetch area using the whole pipe damage area
> > - mark the whole plane area damaged if plane visibility or alpha
> > changed
> > 
> > v5:
> > - taking in consideration src.y1 in the damage coordinates
> > - adding to the pipe damaged area planes that were visible but are
> > invisible in the new state
> > 
> > v6:
> > - consider old state plane coordinates when visibility changes or it
> > moved to calculate damaged area
> > - remove from damaged area the portion not in src clip
> > 
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_psr.c | 98 +++++++++++++++++++++-
> > --
> >  1 file changed, 86 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_psr.c
> > b/drivers/gpu/drm/i915/display/intel_psr.c
> > index d9a395c486d3..7daed098fa74 100644
> > --- a/drivers/gpu/drm/i915/display/intel_psr.c
> > +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> > @@ -1269,8 +1269,8 @@ int intel_psr2_sel_fetch_update(struct
> > intel_atomic_state *state,
> >  				struct intel_crtc *crtc)
> >  {
> >  	struct intel_crtc_state *crtc_state =
> > intel_atomic_get_new_crtc_state(state, crtc);
> > +	struct drm_rect pipe_clip = { .x1 = 0, .y1 = -1, .x2 = INT_MAX,
> > .y2 = -1 };
> >  	struct intel_plane_state *new_plane_state, *old_plane_state;
> > -	struct drm_rect pipe_clip = { .y1 = -1 };
> >  	struct intel_plane *plane;
> >  	bool full_update = false;
> >  	int i, ret;
> > @@ -1282,9 +1282,17 @@ int intel_psr2_sel_fetch_update(struct
> > intel_atomic_state *state,
> >  	if (ret)
> >  		return ret;
> >  
> > 
> > 
> > 
> > +	/*
> > +	 * Calculate minimal selective fetch area of each plane and
> > calculate
> > +	 * the pipe damaged area.
> > +	 * In the next loop the plane selective fetch area will
> > actually be set
> > +	 * using whole pipe damaged area.
> > +	 */
> >  	for_each_oldnew_intel_plane_in_state(state, plane,
> > old_plane_state,
> >  					     new_plane_state, i) {
> > -		struct drm_rect *sel_fetch_area, temp;
> > +		struct drm_rect src, damaged_area = { .x1 = 0, .y1 =
> > -1, .x2 = INT_MAX, .y2 = -1 };
> > +		struct drm_mode_rect *damaged_clips;
> > +		u32 num_clips, j;
> >  
> > 
> > 
> > 
> >  		if (new_plane_state->uapi.crtc != crtc_state-
> > > uapi.crtc)
> >  			continue;
> > @@ -1300,23 +1308,89 @@ int intel_psr2_sel_fetch_update(struct
> > intel_atomic_state *state,
> >  			break;
> >  		}
> >  
> > 
> > 
> > 
> > -		if (!new_plane_state->uapi.visible)
> > -			continue;
> > +		drm_rect_convert_16_16_to_regular(&new_plane_state-
> > > uapi.src, &src);
> > +		damaged_clips =
> > drm_plane_get_damage_clips(&new_plane_state->uapi);
> > +		num_clips =
> > drm_plane_get_damage_clips_count(&new_plane_state->uapi);
> >  
> > 
> > 
> > 
> >  		/*
> > -		 * For now doing a selective fetch in the whole plane
> > area,
> > -		 * optimizations will come in the future.
> > +		 * If visibility or plane moved, mark the whole plane
> > area as
> > +		 * damaged as it needs to be complete redraw in the new
> > and old
> > +		 * position.
> >  		 */
> > +		if (new_plane_state->uapi.visible != old_plane_state-
> > > uapi.visible ||
> > +		    !drm_rect_equals(&new_plane_state->uapi.dst,
> > +				     &old_plane_state->uapi.dst)) {
> > +			damaged_area.y1 = old_plane_state->uapi.src.y1
> > > > 16;
> > +			damaged_area.y1 = old_plane_state->uapi.src.y2
> > > > 16;
> > +			damaged_area.y1 += old_plane_state-
> > > uapi.dst.y1;
> > +			damaged_area.y2 += old_plane_state-
> > > uapi.dst.y1;
> > +			clip_area_update(&pipe_clip, &damaged_area);
> > +
> > +			num_clips = 0;
> > +			damaged_area.y1 = src.y1;
> > +			damaged_area.y2 = src.y2;
> 1. Visibility change case
>  The pipe damaged area (The Selective Update region) needs to
> accumulate being visible plane's dst between old and new plane's dst.
> 
> if you are implementing this scenario, the code shoule be like this,
> 
> if (new_plane_state->uapi.visible != old_plane_state->uapi.visible) {
>    if (new_plane_state->uapi.visible) {
>       damaged_area.y1 = new_plane_state->uapi.dst.y1;
>       damaged_area.y2 = new_plane_state->uapi.dst.y2;
>    } else {
>       damaged_area.y1 = old_plane_state->uapi.dst.y1;
>       damaged_area.y2 = old_plane_state->uapi.dst.y2;
>    }
>    clip_area_update(&pipe_clip, &damaged_area);
>    continue;
> }

The current code does exactly above but discards the clipped in uapi.src.

> 
> 2. Move case
>  The pipe damaged area (The Selective Update region) needs to
> accumulate both old and new plane's dst

same

> 
> if you are implementing this scenario, the code shoule be like this,
> 
> else if (!drm_rect_equals(&new_plane_state->uapi.dst, &old_plane_state-
> > uapi.dst)) {
>    damaged_area.y1 = new_plane_state->uapi.dst.y1;
>    damaged_area.y2 = new_plane_state->uapi.dst.y2;
>    clip_area_update(&pipe_clip, &damaged_area);
> 
>    damaged_area.y1 = old_plane_state->uapi.dst.y1;
>    damaged_area.y2 = old_plane_state->uapi.dst.y2;
>    clip_area_update(&pipe_clip, &damaged_area);
>    
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>    continue;
> }
> > +		} else if (new_plane_state->uapi.alpha !=
> > old_plane_state->uapi.alpha) {
> > +			num_clips = 0;
> > +			damaged_area.y1 = src.y1;
> > +			damaged_area.y2 = src.y2;
> 3. alpha has changed ( because alpha handling section is not optimized,
> it can be treated with the move section)


no need to handle like this for alpha, if the plane moved if will be handled in the "if" above with or without alpha change, if it did not moved but
alpha change no need to add the old state coordinate to the pipe clip.

> 
> else if (new_plane_state->uapi.alpha != old_plane_state->uapi.alpha) {
>    damaged_area.y1 = new_plane_state->uapi.dst.y1;
>    damaged_area.y2 = new_plane_state->uapi.dst.y2;
>    clip_area_update(&pipe_clip, &damaged_area);
> 
>    damaged_area.y1 = old_plane_state->uapi.dst.y1;
>    damaged_area.y2 = old_plane_state->uapi.dst.y2;
>    clip_area_update(&pipe_clip, &damaged_area);
>    
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>    continue;
> } 
> > +		} else if (!num_clips &&
> > +			   new_plane_state->uapi.fb != old_plane_state-
> > > uapi.fb) {
> > +			/*
> > +			 * If the plane don't have damage areas but the
> > +			 * framebuffer changed, mark the whole plane
> > area as
> > +			 * damaged.
> > +			 */
> > +			damaged_area.y1 = src.y1;
> > +			damaged_area.y2 = src.y2;
> > +		}
> > +
> else if (!num_clips && new_plane_state->uapi.fb != old_plane_state-
> > uapi.fb) {
>    /*
>     * If the plane don't have damage areas but the
>     * framebuffer changed, mark the whole plane area as
>     * damaged.
>     */
>    damaged_area.y1 = new_plane_state->uapi.dst.y1;
>    damaged_area.y2 = new_plane_state->uapi.dst.y2;
>    clip_area_update(&pipe_clip, &damaged_area);
>    continue;
> }
> > +		for (j = 0; j < num_clips; j++) {
> > +			struct drm_rect clip;
> > +
> > +			clip.y1 = damaged_clips[j].y1;
> > +			clip.y2 = damaged_clips[j].y2;
> > +			clip_area_update(&damaged_area, &clip);
> > +		}
> > +
> > +		if (!drm_rect_intersect(&damaged_area, &src))
> > +			continue;
> > +
> > +		damaged_area.y1 += new_plane_state->uapi.dst.y1;
> > +		damaged_area.y2 += new_plane_state->uapi.dst.y1;
> > +		clip_area_update(&pipe_clip, &damaged_area);
> > +	}
> > +
> else if (num_clips) {
>    struct drm_rect plane_damaged_area;
>    plane_damaged_area.x1 = src.x1;
>    plane_damaged_area.x2 = src.x2;
>    plane_damaged_area.y1 = 0;
>    plane_damaged_area.y2 = 0;
> 	        
>    for (j = 0; j < num_clips; j++) {
>       struct drm_rect clip;
> 
>       clip.x1 = damaged_clips[j].x1;
>       clip.x2 = damaged_clips[j].x2;
>       clip.y1 = damaged_clips[j].y1;
>       clip.y2 = damaged_clips[j].y2;
> 
>       if (drm_rect_intersect(&clip, &src)) {
>          clip_area_update(&plane_damaged_area, &clip);
>       }

Call intersect at every clip? that don't look optimized.


>    }
> 
>   if (drm_rect_visible(plane_damaged_area)) {
>      plane_damaged_area.y1 = plane_damaged_area.y1 - src.y1 +
> new_plane_state->uapi.dst.y1;
>      plane_damaged_area.y2 = plane_damaged_area.y2 - src.y1 +
> new_plane_state->uapi.dst.y1;
> 
>      clip_area_update(&pipe_clip, &plane_damaged_area);
>      continue;
>   }
> }

Current code sum all the damage clips, if the sum of the damage clips insect with the src area it is translated to pipe coordinates and called
clip_area_update() to update pipe_clip.

> the calculation and translating cooridinates is alreay implemented here
> ( https://patchwork.freedesktop.org/patch/404264/?series=84340&rev=1
>   it has commetns which explains scenarios.) 
> > +	if (full_update)
> > +		goto skip_sel_fetch_set_loop;
> > +
> > +	/*
> > +	 * Now that we have the pipe damaged area check if it intersect
> > with
> > +	 * every plane, if it does set the plane selective fetch area.
> > +	 */
> > +	for_each_oldnew_intel_plane_in_state(state, plane,
> > old_plane_state,
> > +					     new_plane_state, i) {
> > +		struct drm_rect *sel_fetch_area, inter, src;
> > +
> > +		if (new_plane_state->uapi.crtc != crtc_state->uapi.crtc 
> > > > 
> > +		    !new_plane_state->uapi.visible)
> > +			continue;
> > +
> > +		inter = pipe_clip;
> > +		if (!drm_rect_intersect(&inter, &new_plane_state-
> > > uapi.dst))
> > +			continue;
> > +
> > +		drm_rect_convert_16_16_to_regular(&new_plane_state-
> > > uapi.src, &src);
> > +
> >  		sel_fetch_area = &new_plane_state->psr2_sel_fetch_area;
> > -		sel_fetch_area->y1 = new_plane_state->uapi.src.y1 >>
> > 16;
> > -		sel_fetch_area->y2 = new_plane_state->uapi.src.y2 >>
> > 16;
> > +		sel_fetch_area->y1 = inter.y1 - new_plane_state-
> > > uapi.dst.y1;
> > +		sel_fetch_area->y2 = inter.y2 - new_plane_state-
> > > uapi.dst.y1;
> sel_fetch_area->y1 = inter.y1 - new_plane_state->uapi.dst.y1 + src.y1;
> sel_fetch_area->y2 = inter.y2 - new_plane_state->uapi.dst.y1 + src.y1;

sel_fetch_area->y1 = inter.y1 - new_plane_state->uapi.dst.y1; + drm_rect_intersect(sel_fetch_area, &src);
does a the same job and is easier to understand(translation + clip)

> > +		sel_fetch_area->x1 = src.x1;
> > +		sel_fetch_area->x2 = src.x2;
> >  
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > -		temp = *sel_fetch_area;
> > -		temp.y1 += new_plane_state->uapi.dst.y1;
> > -		temp.y2 += new_plane_state->uapi.dst.y2;
> > -		clip_area_update(&pipe_clip, &temp);
> > +		drm_rect_intersect(sel_fetch_area, &src);
> why this line is needed?

explained above.


> >  	}
> >  
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > +skip_sel_fetch_set_loop:
> >  	psr2_man_trk_ctl_calc(crtc_state, &pipe_clip, full_update);
> >  	return 0;
> >  }

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v6 1/5] drm: Add function to convert rect in 16.16 fixed format to regular format
  2020-12-15 12:52   ` [Intel-gfx] " Mun, Gwan-gyeong
@ 2020-12-15 13:25     ` Souza, Jose
  -1 siblings, 0 replies; 28+ messages in thread
From: Souza, Jose @ 2020-12-15 13:25 UTC (permalink / raw)
  To: Mun, Gwan-gyeong, intel-gfx; +Cc: dri-devel

On Tue, 2020-12-15 at 12:52 +0000, Mun, Gwan-gyeong wrote:
> On Mon, 2020-12-14 at 09:49 -0800, José Roberto de Souza wrote:
> > Much more clear to read one function call than four lines doing this
> > conversion.
> > 
> > Cc: dri-devel@lists.freedesktop.org
> > Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > ---
> >  drivers/gpu/drm/drm_rect.c | 15 +++++++++++++++
> >  include/drm/drm_rect.h     |  2 ++
> >  2 files changed, 17 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c
> > index 0460e874896e..24345704b353 100644
> > --- a/drivers/gpu/drm/drm_rect.c
> > +++ b/drivers/gpu/drm/drm_rect.c
> > @@ -373,3 +373,18 @@ void drm_rect_rotate_inv(struct drm_rect *r,
> >  	}
> >  }
> >  EXPORT_SYMBOL(drm_rect_rotate_inv);
> > +
> > +/**
> > + * drm_rect_convert_16_16_to_regular - Convert a rect in 16.16 fixed
> > point form
> > + * to regular form.
> > + * @in: rect in 16.16 fixed point form
> > + * @out: rect to be stored the converted value
> > + */
> > +void drm_rect_convert_16_16_to_regular(struct drm_rect *in, struct
> > drm_rect *out)
> > +{
> > +	out->x1 = in->x1 >> 16;
> > +	out->y1 = in->y1 >> 16;
> > +	out->x2 = in->x2 >> 16;
> > +	out->y2 = in->y2 >> 16;
> > +}
> > +EXPORT_SYMBOL(drm_rect_convert_16_16_to_regular);
> > diff --git a/include/drm/drm_rect.h b/include/drm/drm_rect.h
> > index e7f4d24cdd00..2ef8180416cd 100644
> > --- a/include/drm/drm_rect.h
> > +++ b/include/drm/drm_rect.h
> > @@ -223,5 +223,7 @@ void drm_rect_rotate(struct drm_rect *r,
> >  void drm_rect_rotate_inv(struct drm_rect *r,
> >  			 int width, int height,
> >  			 unsigned int rotation);
> > +void drm_rect_convert_16_16_to_regular(struct drm_rect *in,
> > +				       struct drm_rect *out);
> > 
> Hi,
> if it's purpose is just converting 16.16 fp to integer, how about you
> have function prototype like this?
> extern inline struct drm_rect
> drm_rect_convert_16_16_fp_to_integer(struct drm_rect in)

I prefer have a function call as this can be reused in several places, so the binaries size can decrease a bit.
Also pointers are better, compiler can decide to not inline the function above and it would need to allocate in stack 2 drm_rects for every call.

> 
> And if there are no use case on drm core or other drivers except i915
> display yet,
> before adding this function to drm core, how about you add this
> function code to i915 first?

There is plenty of users in other drivers, just not doing in this series.

> 
> Br,
> G.G.
> >  #endif

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [Intel-gfx] [PATCH v6 1/5] drm: Add function to convert rect in 16.16 fixed format to regular format
@ 2020-12-15 13:25     ` Souza, Jose
  0 siblings, 0 replies; 28+ messages in thread
From: Souza, Jose @ 2020-12-15 13:25 UTC (permalink / raw)
  To: Mun, Gwan-gyeong, intel-gfx; +Cc: dri-devel

On Tue, 2020-12-15 at 12:52 +0000, Mun, Gwan-gyeong wrote:
> On Mon, 2020-12-14 at 09:49 -0800, José Roberto de Souza wrote:
> > Much more clear to read one function call than four lines doing this
> > conversion.
> > 
> > Cc: dri-devel@lists.freedesktop.org
> > Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > ---
> >  drivers/gpu/drm/drm_rect.c | 15 +++++++++++++++
> >  include/drm/drm_rect.h     |  2 ++
> >  2 files changed, 17 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c
> > index 0460e874896e..24345704b353 100644
> > --- a/drivers/gpu/drm/drm_rect.c
> > +++ b/drivers/gpu/drm/drm_rect.c
> > @@ -373,3 +373,18 @@ void drm_rect_rotate_inv(struct drm_rect *r,
> >  	}
> >  }
> >  EXPORT_SYMBOL(drm_rect_rotate_inv);
> > +
> > +/**
> > + * drm_rect_convert_16_16_to_regular - Convert a rect in 16.16 fixed
> > point form
> > + * to regular form.
> > + * @in: rect in 16.16 fixed point form
> > + * @out: rect to be stored the converted value
> > + */
> > +void drm_rect_convert_16_16_to_regular(struct drm_rect *in, struct
> > drm_rect *out)
> > +{
> > +	out->x1 = in->x1 >> 16;
> > +	out->y1 = in->y1 >> 16;
> > +	out->x2 = in->x2 >> 16;
> > +	out->y2 = in->y2 >> 16;
> > +}
> > +EXPORT_SYMBOL(drm_rect_convert_16_16_to_regular);
> > diff --git a/include/drm/drm_rect.h b/include/drm/drm_rect.h
> > index e7f4d24cdd00..2ef8180416cd 100644
> > --- a/include/drm/drm_rect.h
> > +++ b/include/drm/drm_rect.h
> > @@ -223,5 +223,7 @@ void drm_rect_rotate(struct drm_rect *r,
> >  void drm_rect_rotate_inv(struct drm_rect *r,
> >  			 int width, int height,
> >  			 unsigned int rotation);
> > +void drm_rect_convert_16_16_to_regular(struct drm_rect *in,
> > +				       struct drm_rect *out);
> > 
> Hi,
> if it's purpose is just converting 16.16 fp to integer, how about you
> have function prototype like this?
> extern inline struct drm_rect
> drm_rect_convert_16_16_fp_to_integer(struct drm_rect in)

I prefer have a function call as this can be reused in several places, so the binaries size can decrease a bit.
Also pointers are better, compiler can decide to not inline the function above and it would need to allocate in stack 2 drm_rects for every call.

> 
> And if there are no use case on drm core or other drivers except i915
> display yet,
> before adding this function to drm core, how about you add this
> function code to i915 first?

There is plenty of users in other drivers, just not doing in this series.

> 
> Br,
> G.G.
> >  #endif

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v6 1/5] drm: Add function to convert rect in 16.16 fixed format to regular format
  2020-12-14 17:49 ` [Intel-gfx] " José Roberto de Souza
@ 2020-12-15 14:44   ` Ville Syrjälä
  -1 siblings, 0 replies; 28+ messages in thread
From: Ville Syrjälä @ 2020-12-15 14:44 UTC (permalink / raw)
  To: José Roberto de Souza; +Cc: intel-gfx, dri-devel, Gwan-gyeong Mun

On Mon, Dec 14, 2020 at 09:49:08AM -0800, José Roberto de Souza wrote:
> Much more clear to read one function call than four lines doing this
> conversion.
> 
> Cc: dri-devel@lists.freedesktop.org
> Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> ---
>  drivers/gpu/drm/drm_rect.c | 15 +++++++++++++++
>  include/drm/drm_rect.h     |  2 ++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c
> index 0460e874896e..24345704b353 100644
> --- a/drivers/gpu/drm/drm_rect.c
> +++ b/drivers/gpu/drm/drm_rect.c
> @@ -373,3 +373,18 @@ void drm_rect_rotate_inv(struct drm_rect *r,
>  	}
>  }
>  EXPORT_SYMBOL(drm_rect_rotate_inv);
> +
> +/**
> + * drm_rect_convert_16_16_to_regular - Convert a rect in 16.16 fixed point form
> + * to regular form.
> + * @in: rect in 16.16 fixed point form
> + * @out: rect to be stored the converted value
> + */
> +void drm_rect_convert_16_16_to_regular(struct drm_rect *in, struct drm_rect *out)
> +{
> +	out->x1 = in->x1 >> 16;
> +	out->y1 = in->y1 >> 16;
> +	out->x2 = in->x2 >> 16;
> +	out->y2 = in->y2 >> 16;
> +}

That's not the same as what we do in most places. We truncate
the width/height, not x2/y2. Doing it on x2/y2 may increase
the width/height.

So I suggest something more like:

static inline void drm_rect_fp_to_int(struct drm_rect *r)
{
	drm_rect_init(r, r->x1 >> 16, r->y1 >> 16,
		      drm_rect_width(r) >> 16,
		      drm_rect_height(r) >> 16);
}

to match the current way of doing things.

-- 
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [Intel-gfx] [PATCH v6 1/5] drm: Add function to convert rect in 16.16 fixed format to regular format
@ 2020-12-15 14:44   ` Ville Syrjälä
  0 siblings, 0 replies; 28+ messages in thread
From: Ville Syrjälä @ 2020-12-15 14:44 UTC (permalink / raw)
  To: José Roberto de Souza; +Cc: intel-gfx, dri-devel

On Mon, Dec 14, 2020 at 09:49:08AM -0800, José Roberto de Souza wrote:
> Much more clear to read one function call than four lines doing this
> conversion.
> 
> Cc: dri-devel@lists.freedesktop.org
> Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> ---
>  drivers/gpu/drm/drm_rect.c | 15 +++++++++++++++
>  include/drm/drm_rect.h     |  2 ++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c
> index 0460e874896e..24345704b353 100644
> --- a/drivers/gpu/drm/drm_rect.c
> +++ b/drivers/gpu/drm/drm_rect.c
> @@ -373,3 +373,18 @@ void drm_rect_rotate_inv(struct drm_rect *r,
>  	}
>  }
>  EXPORT_SYMBOL(drm_rect_rotate_inv);
> +
> +/**
> + * drm_rect_convert_16_16_to_regular - Convert a rect in 16.16 fixed point form
> + * to regular form.
> + * @in: rect in 16.16 fixed point form
> + * @out: rect to be stored the converted value
> + */
> +void drm_rect_convert_16_16_to_regular(struct drm_rect *in, struct drm_rect *out)
> +{
> +	out->x1 = in->x1 >> 16;
> +	out->y1 = in->y1 >> 16;
> +	out->x2 = in->x2 >> 16;
> +	out->y2 = in->y2 >> 16;
> +}

That's not the same as what we do in most places. We truncate
the width/height, not x2/y2. Doing it on x2/y2 may increase
the width/height.

So I suggest something more like:

static inline void drm_rect_fp_to_int(struct drm_rect *r)
{
	drm_rect_init(r, r->x1 >> 16, r->y1 >> 16,
		      drm_rect_width(r) >> 16,
		      drm_rect_height(r) >> 16);
}

to match the current way of doing things.

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v6 1/5] drm: Add function to convert rect in 16.16 fixed format to regular format
  2020-12-15 14:44   ` [Intel-gfx] " Ville Syrjälä
@ 2020-12-15 15:43     ` Souza, Jose
  -1 siblings, 0 replies; 28+ messages in thread
From: Souza, Jose @ 2020-12-15 15:43 UTC (permalink / raw)
  To: ville.syrjala; +Cc: intel-gfx, dri-devel, Mun,  Gwan-gyeong

On Tue, 2020-12-15 at 16:44 +0200, Ville Syrjälä wrote:
> On Mon, Dec 14, 2020 at 09:49:08AM -0800, José Roberto de Souza wrote:
> > Much more clear to read one function call than four lines doing this
> > conversion.
> > 
> > Cc: dri-devel@lists.freedesktop.org
> > Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > ---
> >  drivers/gpu/drm/drm_rect.c | 15 +++++++++++++++
> >  include/drm/drm_rect.h     |  2 ++
> >  2 files changed, 17 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c
> > index 0460e874896e..24345704b353 100644
> > --- a/drivers/gpu/drm/drm_rect.c
> > +++ b/drivers/gpu/drm/drm_rect.c
> > @@ -373,3 +373,18 @@ void drm_rect_rotate_inv(struct drm_rect *r,
> >  	}
> >  }
> >  EXPORT_SYMBOL(drm_rect_rotate_inv);
> > +
> > +/**
> > + * drm_rect_convert_16_16_to_regular - Convert a rect in 16.16 fixed point form
> > + * to regular form.
> > + * @in: rect in 16.16 fixed point form
> > + * @out: rect to be stored the converted value
> > + */
> > +void drm_rect_convert_16_16_to_regular(struct drm_rect *in, struct drm_rect *out)
> > +{
> > +	out->x1 = in->x1 >> 16;
> > +	out->y1 = in->y1 >> 16;
> > +	out->x2 = in->x2 >> 16;
> > +	out->y2 = in->y2 >> 16;
> > +}
> 
> That's not the same as what we do in most places. We truncate
> the width/height, not x2/y2. Doing it on x2/y2 may increase
> the width/height.
> 
> So I suggest something more like:
> 
> static inline void drm_rect_fp_to_int(struct drm_rect *r)
> {
> 	drm_rect_init(r, r->x1 >> 16, r->y1 >> 16,
> 		      drm_rect_width(r) >> 16,
> 		      drm_rect_height(r) >> 16);
> }
> 
> to match the current way of doing things.

Okay, but most use cases takes drm_plane_state.src and converts and sets it in another rect, so will modify it to have two parameters.


> 

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [Intel-gfx] [PATCH v6 1/5] drm: Add function to convert rect in 16.16 fixed format to regular format
@ 2020-12-15 15:43     ` Souza, Jose
  0 siblings, 0 replies; 28+ messages in thread
From: Souza, Jose @ 2020-12-15 15:43 UTC (permalink / raw)
  To: ville.syrjala; +Cc: intel-gfx, dri-devel

On Tue, 2020-12-15 at 16:44 +0200, Ville Syrjälä wrote:
> On Mon, Dec 14, 2020 at 09:49:08AM -0800, José Roberto de Souza wrote:
> > Much more clear to read one function call than four lines doing this
> > conversion.
> > 
> > Cc: dri-devel@lists.freedesktop.org
> > Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > ---
> >  drivers/gpu/drm/drm_rect.c | 15 +++++++++++++++
> >  include/drm/drm_rect.h     |  2 ++
> >  2 files changed, 17 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c
> > index 0460e874896e..24345704b353 100644
> > --- a/drivers/gpu/drm/drm_rect.c
> > +++ b/drivers/gpu/drm/drm_rect.c
> > @@ -373,3 +373,18 @@ void drm_rect_rotate_inv(struct drm_rect *r,
> >  	}
> >  }
> >  EXPORT_SYMBOL(drm_rect_rotate_inv);
> > +
> > +/**
> > + * drm_rect_convert_16_16_to_regular - Convert a rect in 16.16 fixed point form
> > + * to regular form.
> > + * @in: rect in 16.16 fixed point form
> > + * @out: rect to be stored the converted value
> > + */
> > +void drm_rect_convert_16_16_to_regular(struct drm_rect *in, struct drm_rect *out)
> > +{
> > +	out->x1 = in->x1 >> 16;
> > +	out->y1 = in->y1 >> 16;
> > +	out->x2 = in->x2 >> 16;
> > +	out->y2 = in->y2 >> 16;
> > +}
> 
> That's not the same as what we do in most places. We truncate
> the width/height, not x2/y2. Doing it on x2/y2 may increase
> the width/height.
> 
> So I suggest something more like:
> 
> static inline void drm_rect_fp_to_int(struct drm_rect *r)
> {
> 	drm_rect_init(r, r->x1 >> 16, r->y1 >> 16,
> 		      drm_rect_width(r) >> 16,
> 		      drm_rect_height(r) >> 16);
> }
> 
> to match the current way of doing things.

Okay, but most use cases takes drm_plane_state.src and converts and sets it in another rect, so will modify it to have two parameters.


> 

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v6 1/5] drm: Add function to convert rect in 16.16 fixed format to regular format
  2020-12-15 15:43     ` [Intel-gfx] " Souza, Jose
@ 2020-12-15 15:50       ` Ville Syrjälä
  -1 siblings, 0 replies; 28+ messages in thread
From: Ville Syrjälä @ 2020-12-15 15:50 UTC (permalink / raw)
  To: Souza, Jose; +Cc: intel-gfx, dri-devel, Mun, Gwan-gyeong

On Tue, Dec 15, 2020 at 03:43:00PM +0000, Souza, Jose wrote:
> On Tue, 2020-12-15 at 16:44 +0200, Ville Syrjälä wrote:
> > On Mon, Dec 14, 2020 at 09:49:08AM -0800, José Roberto de Souza wrote:
> > > Much more clear to read one function call than four lines doing this
> > > conversion.
> > > 
> > > Cc: dri-devel@lists.freedesktop.org
> > > Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> > > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > > ---
> > >  drivers/gpu/drm/drm_rect.c | 15 +++++++++++++++
> > >  include/drm/drm_rect.h     |  2 ++
> > >  2 files changed, 17 insertions(+)
> > > 
> > > diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c
> > > index 0460e874896e..24345704b353 100644
> > > --- a/drivers/gpu/drm/drm_rect.c
> > > +++ b/drivers/gpu/drm/drm_rect.c
> > > @@ -373,3 +373,18 @@ void drm_rect_rotate_inv(struct drm_rect *r,
> > >  	}
> > >  }
> > >  EXPORT_SYMBOL(drm_rect_rotate_inv);
> > > +
> > > +/**
> > > + * drm_rect_convert_16_16_to_regular - Convert a rect in 16.16 fixed point form
> > > + * to regular form.
> > > + * @in: rect in 16.16 fixed point form
> > > + * @out: rect to be stored the converted value
> > > + */
> > > +void drm_rect_convert_16_16_to_regular(struct drm_rect *in, struct drm_rect *out)
> > > +{
> > > +	out->x1 = in->x1 >> 16;
> > > +	out->y1 = in->y1 >> 16;
> > > +	out->x2 = in->x2 >> 16;
> > > +	out->y2 = in->y2 >> 16;
> > > +}
> > 
> > That's not the same as what we do in most places. We truncate
> > the width/height, not x2/y2. Doing it on x2/y2 may increase
> > the width/height.
> > 
> > So I suggest something more like:
> > 
> > static inline void drm_rect_fp_to_int(struct drm_rect *r)
> > {
> > 	drm_rect_init(r, r->x1 >> 16, r->y1 >> 16,
> > 		      drm_rect_width(r) >> 16,
> > 		      drm_rect_height(r) >> 16);
> > }
> > 
> > to match the current way of doing things.
> 
> Okay, but most use cases takes drm_plane_state.src and converts and sets it in another rect, so will modify it to have two parameters.

Would seem a bit more generic by having the caller make the copy
if needed. But I guess not big deal either way.

At least make it follow the correct argument order as laid out
by memcpy() ;) (+const for the input argument ofc).

-- 
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [Intel-gfx] [PATCH v6 1/5] drm: Add function to convert rect in 16.16 fixed format to regular format
@ 2020-12-15 15:50       ` Ville Syrjälä
  0 siblings, 0 replies; 28+ messages in thread
From: Ville Syrjälä @ 2020-12-15 15:50 UTC (permalink / raw)
  To: Souza, Jose; +Cc: intel-gfx, dri-devel

On Tue, Dec 15, 2020 at 03:43:00PM +0000, Souza, Jose wrote:
> On Tue, 2020-12-15 at 16:44 +0200, Ville Syrjälä wrote:
> > On Mon, Dec 14, 2020 at 09:49:08AM -0800, José Roberto de Souza wrote:
> > > Much more clear to read one function call than four lines doing this
> > > conversion.
> > > 
> > > Cc: dri-devel@lists.freedesktop.org
> > > Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> > > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > > ---
> > >  drivers/gpu/drm/drm_rect.c | 15 +++++++++++++++
> > >  include/drm/drm_rect.h     |  2 ++
> > >  2 files changed, 17 insertions(+)
> > > 
> > > diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c
> > > index 0460e874896e..24345704b353 100644
> > > --- a/drivers/gpu/drm/drm_rect.c
> > > +++ b/drivers/gpu/drm/drm_rect.c
> > > @@ -373,3 +373,18 @@ void drm_rect_rotate_inv(struct drm_rect *r,
> > >  	}
> > >  }
> > >  EXPORT_SYMBOL(drm_rect_rotate_inv);
> > > +
> > > +/**
> > > + * drm_rect_convert_16_16_to_regular - Convert a rect in 16.16 fixed point form
> > > + * to regular form.
> > > + * @in: rect in 16.16 fixed point form
> > > + * @out: rect to be stored the converted value
> > > + */
> > > +void drm_rect_convert_16_16_to_regular(struct drm_rect *in, struct drm_rect *out)
> > > +{
> > > +	out->x1 = in->x1 >> 16;
> > > +	out->y1 = in->y1 >> 16;
> > > +	out->x2 = in->x2 >> 16;
> > > +	out->y2 = in->y2 >> 16;
> > > +}
> > 
> > That's not the same as what we do in most places. We truncate
> > the width/height, not x2/y2. Doing it on x2/y2 may increase
> > the width/height.
> > 
> > So I suggest something more like:
> > 
> > static inline void drm_rect_fp_to_int(struct drm_rect *r)
> > {
> > 	drm_rect_init(r, r->x1 >> 16, r->y1 >> 16,
> > 		      drm_rect_width(r) >> 16,
> > 		      drm_rect_height(r) >> 16);
> > }
> > 
> > to match the current way of doing things.
> 
> Okay, but most use cases takes drm_plane_state.src and converts and sets it in another rect, so will modify it to have two parameters.

Would seem a bit more generic by having the caller make the copy
if needed. But I guess not big deal either way.

At least make it follow the correct argument order as laid out
by memcpy() ;) (+const for the input argument ofc).

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [Intel-gfx] [PATCH v6 2/5] drm/i915/display/psr: Use plane damage clips to calculate damaged area
  2020-12-15 13:14     ` Souza, Jose
@ 2020-12-16 10:29       ` Mun, Gwan-gyeong
  2020-12-16 13:17         ` Souza, Jose
  0 siblings, 1 reply; 28+ messages in thread
From: Mun, Gwan-gyeong @ 2020-12-16 10:29 UTC (permalink / raw)
  To: intel-gfx, Souza, Jose

On Tue, 2020-12-15 at 05:14 -0800, Souza, Jose wrote:
> On Tue, 2020-12-15 at 13:02 +0000, Mun, Gwan-gyeong wrote:
> > On Mon, 2020-12-14 at 09:49 -0800, José Roberto de Souza wrote:
> > > Now using plane damage clips property to calcualte the damaged
> > > area.
> > > Selective fetch only supports one region to be fetched so
> > > software
> > > needs to calculate a bounding box around all damage clips.
> > > 
> > > Now that we are not complete fetching each plane, there is
> > > another
> > > loop needed as all the plane areas that intersect with the pipe
> > > damaged area needs to be fetched from memory so the complete
> > > blending
> > > of all planes can happen.
> > > 
> > Hi,
> > > v2:
> > > - do not shifthing new_plane_state->uapi.dst only src is in
> > > 16.16 
> > Typo on commit message. shifthing -> shifting
> > > format
> > > 
> > > v4:
> > > - setting plane selective fetch area using the whole pipe damage
> > > area
> > > - mark the whole plane area damaged if plane visibility or alpha
> > > changed
> > > 
> > > v5:
> > > - taking in consideration src.y1 in the damage coordinates
> > > - adding to the pipe damaged area planes that were visible but
> > > are
> > > invisible in the new state
> > > 
> > > v6:
> > > - consider old state plane coordinates when visibility changes or
> > > it
> > > moved to calculate damaged area
> > > - remove from damaged area the portion not in src clip
> > > 
> > > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> > > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/display/intel_psr.c | 98
> > > +++++++++++++++++++++-
> > > --
> > >  1 file changed, 86 insertions(+), 12 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/display/intel_psr.c
> > > b/drivers/gpu/drm/i915/display/intel_psr.c
> > > index d9a395c486d3..7daed098fa74 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_psr.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> > > @@ -1269,8 +1269,8 @@ int intel_psr2_sel_fetch_update(struct
> > > intel_atomic_state *state,
> > >  				struct intel_crtc *crtc)
> > >  {
> > >  	struct intel_crtc_state *crtc_state =
> > > intel_atomic_get_new_crtc_state(state, crtc);
> > > +	struct drm_rect pipe_clip = { .x1 = 0, .y1 = -1, .x2 = INT_MAX,
> > > .y2 = -1 };
> > >  	struct intel_plane_state *new_plane_state, *old_plane_state;
> > > -	struct drm_rect pipe_clip = { .y1 = -1 };
> > >  	struct intel_plane *plane;
> > >  	bool full_update = false;
> > >  	int i, ret;
> > > @@ -1282,9 +1282,17 @@ int intel_psr2_sel_fetch_update(struct
> > > intel_atomic_state *state,
> > >  	if (ret)
> > >  		return ret;
> > >  
> > > 
> > > 
> > > 
> > > +	/*
> > > +	 * Calculate minimal selective fetch area of each plane and
> > > calculate
> > > +	 * the pipe damaged area.
> > > +	 * In the next loop the plane selective fetch area will
> > > actually be set
> > > +	 * using whole pipe damaged area.
> > > +	 */
> > >  	for_each_oldnew_intel_plane_in_state(state, plane,
> > > old_plane_state,
> > >  					     new_plane_state, i) {
> > > -		struct drm_rect *sel_fetch_area, temp;
> > > +		struct drm_rect src, damaged_area = { .x1 = 0, .y1 =
> > > -1, .x2 = INT_MAX, .y2 = -1 };
> > > +		struct drm_mode_rect *damaged_clips;
> > > +		u32 num_clips, j;
> > >  
> > > 
> > > 
> > > 
> > >  		if (new_plane_state->uapi.crtc != crtc_state-
> > > > uapi.crtc)
> > >  			continue;
> > > @@ -1300,23 +1308,89 @@ int intel_psr2_sel_fetch_update(struct
> > > intel_atomic_state *state,
> > >  			break;
> > >  		}
> > >  
> > > 
> > > 
> > > 
> > > -		if (!new_plane_state->uapi.visible)
> > > -			continue;
> > > +		drm_rect_convert_16_16_to_regular(&new_plane_state-
> > > > uapi.src, &src);
> > > +		damaged_clips =
> > > drm_plane_get_damage_clips(&new_plane_state->uapi);
> > > +		num_clips =
> > > drm_plane_get_damage_clips_count(&new_plane_state->uapi);
> > >  
> > > 
> > > 
> > > 
> > >  		/*
> > > -		 * For now doing a selective fetch in the whole plane
> > > area,
> > > -		 * optimizations will come in the future.
> > > +		 * If visibility or plane moved, mark the whole plane
> > > area as
> > > +		 * damaged as it needs to be complete redraw in the new
> > > and old
> > > +		 * position.
> > >  		 */
> > > +		if (new_plane_state->uapi.visible != old_plane_state-
> > > > uapi.visible ||
> > > +		    !drm_rect_equals(&new_plane_state->uapi.dst,
> > > +				     &old_plane_state->uapi.dst)) {
> > > +			damaged_area.y1 = old_plane_state->uapi.src.y1
> > > > > 16;
> > > +			damaged_area.y1 = old_plane_state->uapi.src.y2
> > > > > 16;
> > > +			damaged_area.y1 += old_plane_state-
> > > > uapi.dst.y1;
> > > +			damaged_area.y2 += old_plane_state-
> > > > uapi.dst.y1;
> > > +			clip_area_update(&pipe_clip, &damaged_area);
> > > +
> > > +			num_clips = 0;
> > > +			damaged_area.y1 = src.y1;
> > > +			damaged_area.y2 = src.y2;
> > 1. Visibility change case
> >  The pipe damaged area (The Selective Update region) needs to
> > accumulate being visible plane's dst between old and new plane's
> > dst.
> > 
> > if you are implementing this scenario, the code shoule be like
> > this,
> > 
> > if (new_plane_state->uapi.visible != old_plane_state->uapi.visible) 
> > {
> >    if (new_plane_state->uapi.visible) {
> >       damaged_area.y1 = new_plane_state->uapi.dst.y1;
> >       damaged_area.y2 = new_plane_state->uapi.dst.y2;
> >    } else {
> >       damaged_area.y1 = old_plane_state->uapi.dst.y1;
> >       damaged_area.y2 = old_plane_state->uapi.dst.y2;
> >    }
> >    clip_area_update(&pipe_clip, &damaged_area);
> >    continue;
> > }
> 
> The current code does exactly above but discards the clipped in
> uapi.src.
> 
in order to accumlate the pipe damage area, we don't need to use and
calculate src coordinates on move and visibility change scenarios.
we can easily accumalates than additional calculation.
> > 2. Move case
> >  The pipe damaged area (The Selective Update region) needs to
> > accumulate both old and new plane's dst
> 
> same
> 
> > if you are implementing this scenario, the code shoule be like
> > this,
> > 
> > else if (!drm_rect_equals(&new_plane_state->uapi.dst,
> > &old_plane_state-
> > > uapi.dst)) {
> >    damaged_area.y1 = new_plane_state->uapi.dst.y1;
> >    damaged_area.y2 = new_plane_state->uapi.dst.y2;
> >    clip_area_update(&pipe_clip, &damaged_area);
> > 
> >    damaged_area.y1 = old_plane_state->uapi.dst.y1;
> >    damaged_area.y2 = old_plane_state->uapi.dst.y2;
> >    clip_area_update(&pipe_clip, &damaged_area);
> >    
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >    continue;
> > }
> > > +		} else if (new_plane_state->uapi.alpha !=
> > > old_plane_state->uapi.alpha) {
> > > +			num_clips = 0;
> > > +			damaged_area.y1 = src.y1;
> > > +			damaged_area.y2 = src.y2;
> > 3. alpha has changed ( because alpha handling section is not
> > optimized,
> > it can be treated with the move section)
> 
Yes, you are right, there was a misunderstanding of the alpha scenario
of me.
> no need to handle like this for alpha, if the plane moved if will be
> handled in the "if" above with or without alpha change, if it did not
> moved but
> alpha change no need to add the old state coordinate to the pipe
> clip.
> 
> > else if (new_plane_state->uapi.alpha != old_plane_state-
> > >uapi.alpha) {
> >    damaged_area.y1 = new_plane_state->uapi.dst.y1;
> >    damaged_area.y2 = new_plane_state->uapi.dst.y2;
> >    clip_area_update(&pipe_clip, &damaged_area);
> > 
> >    damaged_area.y1 = old_plane_state->uapi.dst.y1;
> >    damaged_area.y2 = old_plane_state->uapi.dst.y2;
> >    clip_area_update(&pipe_clip, &damaged_area);
> >    
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >    continue;
> > } 
> > > +		} else if (!num_clips &&
> > > +			   new_plane_state->uapi.fb != old_plane_state-
> > > > uapi.fb) {
> > > +			/*
> > > +			 * If the plane don't have damage areas but the
> > > +			 * framebuffer changed, mark the whole plane
> > > area as
> > > +			 * damaged.
> > > +			 */
> > > +			damaged_area.y1 = src.y1;
> > > +			damaged_area.y2 = src.y2;
> > > +		}
> > > +
> > else if (!num_clips && new_plane_state->uapi.fb != old_plane_state-
> > > uapi.fb) {
> >    /*
> >     * If the plane don't have damage areas but the
> >     * framebuffer changed, mark the whole plane area as
> >     * damaged.
> >     */
> >    damaged_area.y1 = new_plane_state->uapi.dst.y1;
> >    damaged_area.y2 = new_plane_state->uapi.dst.y2;
> >    clip_area_update(&pipe_clip, &damaged_area);
> >    continue;
> > }
> > > +		for (j = 0; j < num_clips; j++) {
> > > +			struct drm_rect clip;
> > > +
> > > +			clip.y1 = damaged_clips[j].y1;
> > > +			clip.y2 = damaged_clips[j].y2;
> > > +			clip_area_update(&damaged_area, &clip);
> > > +		}
> > > +
> > > +		if (!drm_rect_intersect(&damaged_area, &src))
> > > +			continue;
> > > +
> > > +		damaged_area.y1 += new_plane_state->uapi.dst.y1;
> > > +		damaged_area.y2 += new_plane_state->uapi.dst.y1;
> > > +		clip_area_update(&pipe_clip, &damaged_area);
> > > +	}
> > > +
> > else if (num_clips) {
> >    struct drm_rect plane_damaged_area;
> >    plane_damaged_area.x1 = src.x1;
> >    plane_damaged_area.x2 = src.x2;
> >    plane_damaged_area.y1 = 0;
> >    plane_damaged_area.y2 = 0;
> > 	        
> >    for (j = 0; j < num_clips; j++) {
> >       struct drm_rect clip;
> > 
> >       clip.x1 = damaged_clips[j].x1;
> >       clip.x2 = damaged_clips[j].x2;
> >       clip.y1 = damaged_clips[j].y1;
> >       clip.y2 = damaged_clips[j].y2;
> > 
> >       if (drm_rect_intersect(&clip, &src)) {
> >          clip_area_update(&plane_damaged_area, &clip);
> >       }
> 
> Call intersect at every clip? that don't look optimized.
> 
when the clip_area_update() is called it just accumulates the input
rects to one output rect.
it might lead to accumulating unneeded excessive update rect region
> 
> >    }
> > 
> >   if (drm_rect_visible(plane_damaged_area)) {
> >      plane_damaged_area.y1 = plane_damaged_area.y1 - src.y1 +
> > new_plane_state->uapi.dst.y1;
> >      plane_damaged_area.y2 = plane_damaged_area.y2 - src.y1 +
> > new_plane_state->uapi.dst.y1;
> > 
> >      clip_area_update(&pipe_clip, &plane_damaged_area);
> >      continue;
> >   }
> > }
> 
> Current code sum all the damage clips, if the sum of the damage clips
> insect with the src area it is translated to pipe coordinates and
> called
> clip_area_update() to update pipe_clip.
> 
> > the calculation and translating cooridinates is alreay implemented
> > here
> > ( 
> > https://patchwork.freedesktop.org/patch/404264/?series=84340&rev=1
> >   it has commetns which explains scenarios.) 
> > > +	if (full_update)
> > > +		goto skip_sel_fetch_set_loop;
> > > +
> > > +	/*
> > > +	 * Now that we have the pipe damaged area check if it intersect
> > > with
> > > +	 * every plane, if it does set the plane selective fetch area.
> > > +	 */
> > > +	for_each_oldnew_intel_plane_in_state(state, plane,
> > > old_plane_state,
> > > +					     new_plane_state, i) {
> > > +		struct drm_rect *sel_fetch_area, inter, src;
> > > +
> > > +		if (new_plane_state->uapi.crtc != crtc_state-
> > > >uapi.crtc 
> > > +		    !new_plane_state->uapi.visible)
> > > +			continue;
> > > +
> > > +		inter = pipe_clip;
> > > +		if (!drm_rect_intersect(&inter, &new_plane_state-
> > > > uapi.dst))
> > > +			continue;
> > > +
> > > +		drm_rect_convert_16_16_to_regular(&new_plane_state-
> > > > uapi.src, &src);
> > > +
> > >  		sel_fetch_area = &new_plane_state->psr2_sel_fetch_area;
> > > -		sel_fetch_area->y1 = new_plane_state->uapi.src.y1 >>
> > > 16;
> > > -		sel_fetch_area->y2 = new_plane_state->uapi.src.y2 >>
> > > 16;
> > > +		sel_fetch_area->y1 = inter.y1 - new_plane_state-
> > > > uapi.dst.y1;
> > > +		sel_fetch_area->y2 = inter.y2 - new_plane_state-
> > > > uapi.dst.y1;
> > sel_fetch_area->y1 = inter.y1 - new_plane_state->uapi.dst.y1 +
> > src.y1;
> > sel_fetch_area->y2 = inter.y2 - new_plane_state->uapi.dst.y1 +
> > src.y1;
> 
> sel_fetch_area->y1 = inter.y1 - new_plane_state->uapi.dst.y1; +
> drm_rect_intersect(sel_fetch_area, &src);
> does a the same job and is easier to understand(translation + clip)
> 
when the src's x1 and y1 indicates over than 0, does it work?
> > > +		sel_fetch_area->x1 = src.x1;
> > > +		sel_fetch_area->x2 = src.x2;
> > >  
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > -		temp = *sel_fetch_area;
> > > -		temp.y1 += new_plane_state->uapi.dst.y1;
> > > -		temp.y2 += new_plane_state->uapi.dst.y2;
> > > -		clip_area_update(&pipe_clip, &temp);
> > > +		drm_rect_intersect(sel_fetch_area, &src);
> > why this line is needed?
> 
> explained above.
> 
> 
> > >  	}
> > >  
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > +skip_sel_fetch_set_loop:
> > >  	psr2_man_trk_ctl_calc(crtc_state, &pipe_clip, full_update);
> > >  	return 0;
> > >  }
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [Intel-gfx] [PATCH v6 2/5] drm/i915/display/psr: Use plane damage clips to calculate damaged area
  2020-12-16 10:29       ` Mun, Gwan-gyeong
@ 2020-12-16 13:17         ` Souza, Jose
  2020-12-16 14:10           ` Mun, Gwan-gyeong
  0 siblings, 1 reply; 28+ messages in thread
From: Souza, Jose @ 2020-12-16 13:17 UTC (permalink / raw)
  To: Mun, Gwan-gyeong, intel-gfx

On Wed, 2020-12-16 at 10:29 +0000, Mun, Gwan-gyeong wrote:
> On Tue, 2020-12-15 at 05:14 -0800, Souza, Jose wrote:
> > On Tue, 2020-12-15 at 13:02 +0000, Mun, Gwan-gyeong wrote:
> > > On Mon, 2020-12-14 at 09:49 -0800, José Roberto de Souza wrote:
> > > > Now using plane damage clips property to calcualte the damaged
> > > > area.
> > > > Selective fetch only supports one region to be fetched so
> > > > software
> > > > needs to calculate a bounding box around all damage clips.
> > > > 
> > > > Now that we are not complete fetching each plane, there is
> > > > another
> > > > loop needed as all the plane areas that intersect with the pipe
> > > > damaged area needs to be fetched from memory so the complete
> > > > blending
> > > > of all planes can happen.
> > > > 
> > > Hi,
> > > > v2:
> > > > - do not shifthing new_plane_state->uapi.dst only src is in
> > > > 16.16 
> > > Typo on commit message. shifthing -> shifting
> > > > format
> > > > 
> > > > v4:
> > > > - setting plane selective fetch area using the whole pipe damage
> > > > area
> > > > - mark the whole plane area damaged if plane visibility or alpha
> > > > changed
> > > > 
> > > > v5:
> > > > - taking in consideration src.y1 in the damage coordinates
> > > > - adding to the pipe damaged area planes that were visible but
> > > > are
> > > > invisible in the new state
> > > > 
> > > > v6:
> > > > - consider old state plane coordinates when visibility changes or
> > > > it
> > > > moved to calculate damaged area
> > > > - remove from damaged area the portion not in src clip
> > > > 
> > > > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> > > > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > > > ---
> > > >  drivers/gpu/drm/i915/display/intel_psr.c | 98
> > > > +++++++++++++++++++++-
> > > > --
> > > >  1 file changed, 86 insertions(+), 12 deletions(-)
> > > > 
> > > > diff --git a/drivers/gpu/drm/i915/display/intel_psr.c
> > > > b/drivers/gpu/drm/i915/display/intel_psr.c
> > > > index d9a395c486d3..7daed098fa74 100644
> > > > --- a/drivers/gpu/drm/i915/display/intel_psr.c
> > > > +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> > > > @@ -1269,8 +1269,8 @@ int intel_psr2_sel_fetch_update(struct
> > > > intel_atomic_state *state,
> > > >  				struct intel_crtc *crtc)
> > > >  {
> > > >  	struct intel_crtc_state *crtc_state =
> > > > intel_atomic_get_new_crtc_state(state, crtc);
> > > > +	struct drm_rect pipe_clip = { .x1 = 0, .y1 = -1, .x2 = INT_MAX,
> > > > .y2 = -1 };
> > > >  	struct intel_plane_state *new_plane_state, *old_plane_state;
> > > > -	struct drm_rect pipe_clip = { .y1 = -1 };
> > > >  	struct intel_plane *plane;
> > > >  	bool full_update = false;
> > > >  	int i, ret;
> > > > @@ -1282,9 +1282,17 @@ int intel_psr2_sel_fetch_update(struct
> > > > intel_atomic_state *state,
> > > >  	if (ret)
> > > >  		return ret;
> > > >  
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > +	/*
> > > > +	 * Calculate minimal selective fetch area of each plane and
> > > > calculate
> > > > +	 * the pipe damaged area.
> > > > +	 * In the next loop the plane selective fetch area will
> > > > actually be set
> > > > +	 * using whole pipe damaged area.
> > > > +	 */
> > > >  	for_each_oldnew_intel_plane_in_state(state, plane,
> > > > old_plane_state,
> > > >  					     new_plane_state, i) {
> > > > -		struct drm_rect *sel_fetch_area, temp;
> > > > +		struct drm_rect src, damaged_area = { .x1 = 0, .y1 =
> > > > -1, .x2 = INT_MAX, .y2 = -1 };
> > > > +		struct drm_mode_rect *damaged_clips;
> > > > +		u32 num_clips, j;
> > > >  
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > >  		if (new_plane_state->uapi.crtc != crtc_state-
> > > > > uapi.crtc)
> > > >  			continue;
> > > > @@ -1300,23 +1308,89 @@ int intel_psr2_sel_fetch_update(struct
> > > > intel_atomic_state *state,
> > > >  			break;
> > > >  		}
> > > >  
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > -		if (!new_plane_state->uapi.visible)
> > > > -			continue;
> > > > +		drm_rect_convert_16_16_to_regular(&new_plane_state-
> > > > > uapi.src, &src);
> > > > +		damaged_clips =
> > > > drm_plane_get_damage_clips(&new_plane_state->uapi);
> > > > +		num_clips =
> > > > drm_plane_get_damage_clips_count(&new_plane_state->uapi);
> > > >  
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > >  		/*
> > > > -		 * For now doing a selective fetch in the whole plane
> > > > area,
> > > > -		 * optimizations will come in the future.
> > > > +		 * If visibility or plane moved, mark the whole plane
> > > > area as
> > > > +		 * damaged as it needs to be complete redraw in the new
> > > > and old
> > > > +		 * position.
> > > >  		 */
> > > > +		if (new_plane_state->uapi.visible != old_plane_state-
> > > > > uapi.visible ||
> > > > +		    !drm_rect_equals(&new_plane_state->uapi.dst,
> > > > +				     &old_plane_state->uapi.dst)) {
> > > > +			damaged_area.y1 = old_plane_state->uapi.src.y1
> > > > > > 16;
> > > > +			damaged_area.y1 = old_plane_state->uapi.src.y2
> > > > > > 16;
> > > > +			damaged_area.y1 += old_plane_state-
> > > > > uapi.dst.y1;
> > > > +			damaged_area.y2 += old_plane_state-
> > > > > uapi.dst.y1;
> > > > +			clip_area_update(&pipe_clip, &damaged_area);
> > > > +
> > > > +			num_clips = 0;
> > > > +			damaged_area.y1 = src.y1;
> > > > +			damaged_area.y2 = src.y2;
> > > 1. Visibility change case
> > >  The pipe damaged area (The Selective Update region) needs to
> > > accumulate being visible plane's dst between old and new plane's
> > > dst.
> > > 
> > > if you are implementing this scenario, the code shoule be like
> > > this,
> > > 
> > > if (new_plane_state->uapi.visible != old_plane_state->uapi.visible) 
> > > {
> > >    if (new_plane_state->uapi.visible) {
> > >       damaged_area.y1 = new_plane_state->uapi.dst.y1;
> > >       damaged_area.y2 = new_plane_state->uapi.dst.y2;
> > >    } else {
> > >       damaged_area.y1 = old_plane_state->uapi.dst.y1;
> > >       damaged_area.y2 = old_plane_state->uapi.dst.y2;
> > >    }
> > >    clip_area_update(&pipe_clip, &damaged_area);
> > >    continue;
> > > }
> > 
> > The current code does exactly above but discards the clipped in
> > uapi.src.
> > 
> in order to accumlate the pipe damage area, we don't need to use and
> calculate src coordinates on move and visibility change scenarios.
> we can easily accumalates than additional calculation.

Using uapi.dst will cause additional and unnecessary area be included to the pipe damaged area, imagine that a plane have src.x1 = 50, src.y1 = 100,
... the plane invisible/cropped area don't need to be added to the pipe damaged area.


> > > 2. Move case
> > >  The pipe damaged area (The Selective Update region) needs to
> > > accumulate both old and new plane's dst
> > 
> > same
> > 
> > > if you are implementing this scenario, the code shoule be like
> > > this,
> > > 
> > > else if (!drm_rect_equals(&new_plane_state->uapi.dst,
> > > &old_plane_state-
> > > > uapi.dst)) {
> > >    damaged_area.y1 = new_plane_state->uapi.dst.y1;
> > >    damaged_area.y2 = new_plane_state->uapi.dst.y2;
> > >    clip_area_update(&pipe_clip, &damaged_area);
> > > 
> > >    damaged_area.y1 = old_plane_state->uapi.dst.y1;
> > >    damaged_area.y2 = old_plane_state->uapi.dst.y2;
> > >    clip_area_update(&pipe_clip, &damaged_area);
> > >    
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > >    continue;
> > > }
> > > > +		} else if (new_plane_state->uapi.alpha !=
> > > > old_plane_state->uapi.alpha) {
> > > > +			num_clips = 0;
> > > > +			damaged_area.y1 = src.y1;
> > > > +			damaged_area.y2 = src.y2;
> > > 3. alpha has changed ( because alpha handling section is not
> > > optimized,
> > > it can be treated with the move section)
> > 
> Yes, you are right, there was a misunderstanding of the alpha scenario
> of me.
> > no need to handle like this for alpha, if the plane moved if will be
> > handled in the "if" above with or without alpha change, if it did not
> > moved but
> > alpha change no need to add the old state coordinate to the pipe
> > clip.
> > 
> > > else if (new_plane_state->uapi.alpha != old_plane_state-
> > > > uapi.alpha) {
> > >    damaged_area.y1 = new_plane_state->uapi.dst.y1;
> > >    damaged_area.y2 = new_plane_state->uapi.dst.y2;
> > >    clip_area_update(&pipe_clip, &damaged_area);
> > > 
> > >    damaged_area.y1 = old_plane_state->uapi.dst.y1;
> > >    damaged_area.y2 = old_plane_state->uapi.dst.y2;
> > >    clip_area_update(&pipe_clip, &damaged_area);
> > >    
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > >    continue;
> > > } 
> > > > +		} else if (!num_clips &&
> > > > +			   new_plane_state->uapi.fb != old_plane_state-
> > > > > uapi.fb) {
> > > > +			/*
> > > > +			 * If the plane don't have damage areas but the
> > > > +			 * framebuffer changed, mark the whole plane
> > > > area as
> > > > +			 * damaged.
> > > > +			 */
> > > > +			damaged_area.y1 = src.y1;
> > > > +			damaged_area.y2 = src.y2;
> > > > +		}
> > > > +
> > > else if (!num_clips && new_plane_state->uapi.fb != old_plane_state-
> > > > uapi.fb) {
> > >    /*
> > >     * If the plane don't have damage areas but the
> > >     * framebuffer changed, mark the whole plane area as
> > >     * damaged.
> > >     */
> > >    damaged_area.y1 = new_plane_state->uapi.dst.y1;
> > >    damaged_area.y2 = new_plane_state->uapi.dst.y2;
> > >    clip_area_update(&pipe_clip, &damaged_area);
> > >    continue;
> > > }
> > > > +		for (j = 0; j < num_clips; j++) {
> > > > +			struct drm_rect clip;
> > > > +
> > > > +			clip.y1 = damaged_clips[j].y1;
> > > > +			clip.y2 = damaged_clips[j].y2;
> > > > +			clip_area_update(&damaged_area, &clip);
> > > > +		}
> > > > +
> > > > +		if (!drm_rect_intersect(&damaged_area, &src))
> > > > +			continue;
> > > > +
> > > > +		damaged_area.y1 += new_plane_state->uapi.dst.y1;
> > > > +		damaged_area.y2 += new_plane_state->uapi.dst.y1;
> > > > +		clip_area_update(&pipe_clip, &damaged_area);
> > > > +	}
> > > > +
> > > else if (num_clips) {
> > >    struct drm_rect plane_damaged_area;
> > >    plane_damaged_area.x1 = src.x1;
> > >    plane_damaged_area.x2 = src.x2;
> > >    plane_damaged_area.y1 = 0;
> > >    plane_damaged_area.y2 = 0;
> > > 	        
> > >    for (j = 0; j < num_clips; j++) {
> > >       struct drm_rect clip;
> > > 
> > >       clip.x1 = damaged_clips[j].x1;
> > >       clip.x2 = damaged_clips[j].x2;
> > >       clip.y1 = damaged_clips[j].y1;
> > >       clip.y2 = damaged_clips[j].y2;
> > > 
> > >       if (drm_rect_intersect(&clip, &src)) {
> > >          clip_area_update(&plane_damaged_area, &clip);
> > >       }
> > 
> > Call intersect at every clip? that don't look optimized.
> > 
> when the clip_area_update() is called it just accumulates the input
> rects to one output rect.
> it might lead to accumulating unneeded excessive update rect region

The excessive rect region will be removed once after sum all clips in the current approach.

> > 
> > >    }
> > > 
> > >   if (drm_rect_visible(plane_damaged_area)) {
> > >      plane_damaged_area.y1 = plane_damaged_area.y1 - src.y1 +
> > > new_plane_state->uapi.dst.y1;
> > >      plane_damaged_area.y2 = plane_damaged_area.y2 - src.y1 +
> > > new_plane_state->uapi.dst.y1;
> > > 
> > >      clip_area_update(&pipe_clip, &plane_damaged_area);
> > >      continue;
> > >   }
> > > }
> > 
> > Current code sum all the damage clips, if the sum of the damage clips
> > insect with the src area it is translated to pipe coordinates and
> > called
> > clip_area_update() to update pipe_clip.
> > 
> > > the calculation and translating cooridinates is alreay implemented
> > > here
> > > ( 
> > > https://patchwork.freedesktop.org/patch/404264/?series=84340&rev=1
> > >   it has commetns which explains scenarios.) 
> > > > +	if (full_update)
> > > > +		goto skip_sel_fetch_set_loop;
> > > > +
> > > > +	/*
> > > > +	 * Now that we have the pipe damaged area check if it intersect
> > > > with
> > > > +	 * every plane, if it does set the plane selective fetch area.
> > > > +	 */
> > > > +	for_each_oldnew_intel_plane_in_state(state, plane,
> > > > old_plane_state,
> > > > +					     new_plane_state, i) {
> > > > +		struct drm_rect *sel_fetch_area, inter, src;
> > > > +
> > > > +		if (new_plane_state->uapi.crtc != crtc_state-
> > > > > uapi.crtc 
> > > > +		    !new_plane_state->uapi.visible)
> > > > +			continue;
> > > > +
> > > > +		inter = pipe_clip;
> > > > +		if (!drm_rect_intersect(&inter, &new_plane_state-
> > > > > uapi.dst))
> > > > +			continue;
> > > > +
> > > > +		drm_rect_convert_16_16_to_regular(&new_plane_state-
> > > > > uapi.src, &src);
> > > > +
> > > >  		sel_fetch_area = &new_plane_state->psr2_sel_fetch_area;
> > > > -		sel_fetch_area->y1 = new_plane_state->uapi.src.y1 >>
> > > > 16;
> > > > -		sel_fetch_area->y2 = new_plane_state->uapi.src.y2 >>
> > > > 16;
> > > > +		sel_fetch_area->y1 = inter.y1 - new_plane_state-
> > > > > uapi.dst.y1;
> > > > +		sel_fetch_area->y2 = inter.y2 - new_plane_state-
> > > > > uapi.dst.y1;
> > > sel_fetch_area->y1 = inter.y1 - new_plane_state->uapi.dst.y1 +
> > > src.y1;
> > > sel_fetch_area->y2 = inter.y2 - new_plane_state->uapi.dst.y1 +
> > > src.y1;
> > 
> > sel_fetch_area->y1 = inter.y1 - new_plane_state->uapi.dst.y1; +
> > drm_rect_intersect(sel_fetch_area, &src);
> > does a the same job and is easier to understand(translation + clip)
> > 
> when the src's x1 and y1 indicates over than 0, does it work?

It will, we use it for scenarios like that in this function.


> > > > +		sel_fetch_area->x1 = src.x1;
> > > > +		sel_fetch_area->x2 = src.x2;
> > > >  
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > -		temp = *sel_fetch_area;
> > > > -		temp.y1 += new_plane_state->uapi.dst.y1;
> > > > -		temp.y2 += new_plane_state->uapi.dst.y2;
> > > > -		clip_area_update(&pipe_clip, &temp);
> > > > +		drm_rect_intersect(sel_fetch_area, &src);
> > > why this line is needed?
> > 
> > explained above.
> > 
> > 
> > > >  	}
> > > >  
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > +skip_sel_fetch_set_loop:
> > > >  	psr2_man_trk_ctl_calc(crtc_state, &pipe_clip, full_update);
> > > >  	return 0;
> > > >  }

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [Intel-gfx] [PATCH v6 2/5] drm/i915/display/psr: Use plane damage clips to calculate damaged area
  2020-12-16 13:17         ` Souza, Jose
@ 2020-12-16 14:10           ` Mun, Gwan-gyeong
  2020-12-16 14:40             ` Souza, Jose
  0 siblings, 1 reply; 28+ messages in thread
From: Mun, Gwan-gyeong @ 2020-12-16 14:10 UTC (permalink / raw)
  To: intel-gfx, Souza, Jose

On Wed, 2020-12-16 at 05:17 -0800, Souza, Jose wrote:
> On Wed, 2020-12-16 at 10:29 +0000, Mun, Gwan-gyeong wrote:
> > On Tue, 2020-12-15 at 05:14 -0800, Souza, Jose wrote:
> > > On Tue, 2020-12-15 at 13:02 +0000, Mun, Gwan-gyeong wrote:
> > > > On Mon, 2020-12-14 at 09:49 -0800, José Roberto de Souza wrote:
> > > > > Now using plane damage clips property to calcualte the
> > > > > damaged
> > > > > area.
> > > > > Selective fetch only supports one region to be fetched so
> > > > > software
> > > > > needs to calculate a bounding box around all damage clips.
> > > > > 
> > > > > Now that we are not complete fetching each plane, there is
> > > > > another
> > > > > loop needed as all the plane areas that intersect with the
> > > > > pipe
> > > > > damaged area needs to be fetched from memory so the complete
> > > > > blending
> > > > > of all planes can happen.
> > > > > 
> > > > Hi,
> > > > > v2:
> > > > > - do not shifthing new_plane_state->uapi.dst only src is in
> > > > > 16.16 
> > > > Typo on commit message. shifthing -> shifting
> > > > > format
> > > > > 
> > > > > v4:
> > > > > - setting plane selective fetch area using the whole pipe
> > > > > damage
> > > > > area
> > > > > - mark the whole plane area damaged if plane visibility or
> > > > > alpha
> > > > > changed
> > > > > 
> > > > > v5:
> > > > > - taking in consideration src.y1 in the damage coordinates
> > > > > - adding to the pipe damaged area planes that were visible
> > > > > but
> > > > > are
> > > > > invisible in the new state
> > > > > 
> > > > > v6:
> > > > > - consider old state plane coordinates when visibility
> > > > > changes or
> > > > > it
> > > > > moved to calculate damaged area
> > > > > - remove from damaged area the portion not in src clip
> > > > > 
> > > > > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > > Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> > > > > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > > > > ---
> > > > >  drivers/gpu/drm/i915/display/intel_psr.c | 98
> > > > > +++++++++++++++++++++-
> > > > > --
> > > > >  1 file changed, 86 insertions(+), 12 deletions(-)
> > > > > 
> > > > > diff --git a/drivers/gpu/drm/i915/display/intel_psr.c
> > > > > b/drivers/gpu/drm/i915/display/intel_psr.c
> > > > > index d9a395c486d3..7daed098fa74 100644
> > > > > --- a/drivers/gpu/drm/i915/display/intel_psr.c
> > > > > +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> > > > > @@ -1269,8 +1269,8 @@ int intel_psr2_sel_fetch_update(struct
> > > > > intel_atomic_state *state,
> > > > >  				struct intel_crtc *crtc)
> > > > >  {
> > > > >  	struct intel_crtc_state *crtc_state =
> > > > > intel_atomic_get_new_crtc_state(state, crtc);
> > > > > +	struct drm_rect pipe_clip = { .x1 = 0, .y1 = -1, .x2 =
> > > > > INT_MAX,
> > > > > .y2 = -1 };
> > > > >  	struct intel_plane_state *new_plane_state,
> > > > > *old_plane_state;
> > > > > -	struct drm_rect pipe_clip = { .y1 = -1 };
> > > > >  	struct intel_plane *plane;
> > > > >  	bool full_update = false;
> > > > >  	int i, ret;
> > > > > @@ -1282,9 +1282,17 @@ int intel_psr2_sel_fetch_update(struct
> > > > > intel_atomic_state *state,
> > > > >  	if (ret)
> > > > >  		return ret;
> > > > >  
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > +	/*
> > > > > +	 * Calculate minimal selective fetch area of each plane
> > > > > and
> > > > > calculate
> > > > > +	 * the pipe damaged area.
> > > > > +	 * In the next loop the plane selective fetch area will
> > > > > actually be set
> > > > > +	 * using whole pipe damaged area.
> > > > > +	 */
> > > > >  	for_each_oldnew_intel_plane_in_state(state, plane,
> > > > > old_plane_state,
> > > > >  					     new_plane_state,
> > > > > i) {
> > > > > -		struct drm_rect *sel_fetch_area, temp;
> > > > > +		struct drm_rect src, damaged_area = { .x1 = 0,
> > > > > .y1 =
> > > > > -1, .x2 = INT_MAX, .y2 = -1 };
> > > > > +		struct drm_mode_rect *damaged_clips;
> > > > > +		u32 num_clips, j;
> > > > >  
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > >  		if (new_plane_state->uapi.crtc != crtc_state-
> > > > > > uapi.crtc)
> > > > >  			continue;
> > > > > @@ -1300,23 +1308,89 @@ int
> > > > > intel_psr2_sel_fetch_update(struct
> > > > > intel_atomic_state *state,
> > > > >  			break;
> > > > >  		}
> > > > >  
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > -		if (!new_plane_state->uapi.visible)
> > > > > -			continue;
> > > > > +		drm_rect_convert_16_16_to_regular(&new_plane_st
> > > > > ate-
> > > > > > uapi.src, &src);
> > > > > +		damaged_clips =
> > > > > drm_plane_get_damage_clips(&new_plane_state->uapi);
> > > > > +		num_clips =
> > > > > drm_plane_get_damage_clips_count(&new_plane_state->uapi);
> > > > >  
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > >  		/*
> > > > > -		 * For now doing a selective fetch in the whole
> > > > > plane
> > > > > area,
> > > > > -		 * optimizations will come in the future.
> > > > > +		 * If visibility or plane moved, mark the whole
> > > > > plane
> > > > > area as
> > > > > +		 * damaged as it needs to be complete redraw in
> > > > > the new
> > > > > and old
> > > > > +		 * position.
> > > > >  		 */
> > > > > +		if (new_plane_state->uapi.visible !=
> > > > > old_plane_state-
> > > > > > uapi.visible ||
> > > > > +		    !drm_rect_equals(&new_plane_state-
> > > > > >uapi.dst,
> > > > > +				     &old_plane_state-
> > > > > >uapi.dst)) {
> > > > > +			damaged_area.y1 = old_plane_state-
> > > > > >uapi.src.y1
> > > > > > > 16;
> > > > > +			damaged_area.y1 = old_plane_state-
> > > > > >uapi.src.y2
> > > > > > > 16;
> > > > > +			damaged_area.y1 += old_plane_state-
> > > > > > uapi.dst.y1;
> > > > > +			damaged_area.y2 += old_plane_state-
> > > > > > uapi.dst.y1;
> > > > > +			clip_area_update(&pipe_clip,
> > > > > &damaged_area);
> > > > > +
> > > > > +			num_clips = 0;
> > > > > +			damaged_area.y1 = src.y1;
> > > > > +			damaged_area.y2 = src.y2;
> > > > 1. Visibility change case
> > > >  The pipe damaged area (The Selective Update region) needs to
> > > > accumulate being visible plane's dst between old and new
> > > > plane's
> > > > dst.
> > > > 
> > > > if you are implementing this scenario, the code shoule be like
> > > > this,
> > > > 
> > > > if (new_plane_state->uapi.visible != old_plane_state-
> > > > >uapi.visible) 
> > > > {
> > > >    if (new_plane_state->uapi.visible) {
> > > >       damaged_area.y1 = new_plane_state->uapi.dst.y1;
> > > >       damaged_area.y2 = new_plane_state->uapi.dst.y2;
> > > >    } else {
> > > >       damaged_area.y1 = old_plane_state->uapi.dst.y1;
> > > >       damaged_area.y2 = old_plane_state->uapi.dst.y2;
> > > >    }
> > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > >    continue;
> > > > }
> > > 
> > > The current code does exactly above but discards the clipped in
> > > uapi.src.
> > > 
> > in order to accumlate the pipe damage area, we don't need to use
> > and
> > calculate src coordinates on move and visibility change scenarios.
> > we can easily accumalates than additional calculation.
> 
> Using uapi.dst will cause additional and unnecessary area be included
> to the pipe damaged area, imagine that a plane have src.x1 = 50,
> src.y1 = 100,
> ... the plane invisible/cropped area don't need to be added to the
> pipe damaged area.
> 
easist way to get damaged area for crtc is just using uapi.dst
but because fb damage clip follows uapi.src coordinates, we have to
translate fb damage clip's coordinates to dst coordinates for
accumulating crtc damage region.

therefore can you explain what is the exact burden of using uapi.dst
for calculating crtc damage area? 
> 
> > > > 2. Move case
> > > >  The pipe damaged area (The Selective Update region) needs to
> > > > accumulate both old and new plane's dst
> > > 
> > > same
> > > 
> > > > if you are implementing this scenario, the code shoule be like
> > > > this,
> > > > 
> > > > else if (!drm_rect_equals(&new_plane_state->uapi.dst,
> > > > &old_plane_state-
> > > > > uapi.dst)) {
> > > >    damaged_area.y1 = new_plane_state->uapi.dst.y1;
> > > >    damaged_area.y2 = new_plane_state->uapi.dst.y2;
> > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > 
> > > >    damaged_area.y1 = old_plane_state->uapi.dst.y1;
> > > >    damaged_area.y2 = old_plane_state->uapi.dst.y2;
> > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > >    
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > >    continue;
> > > > }
> > > > > +		} else if (new_plane_state->uapi.alpha !=
> > > > > old_plane_state->uapi.alpha) {
> > > > > +			num_clips = 0;
> > > > > +			damaged_area.y1 = src.y1;
> > > > > +			damaged_area.y2 = src.y2;
> > > > 3. alpha has changed ( because alpha handling section is not
> > > > optimized,
> > > > it can be treated with the move section)
> > Yes, you are right, there was a misunderstanding of the alpha
> > scenario
> > of me.
> > > no need to handle like this for alpha, if the plane moved if will
> > > be
> > > handled in the "if" above with or without alpha change, if it did
> > > not
> > > moved but
> > > alpha change no need to add the old state coordinate to the pipe
> > > clip.
> > > 
> > > > else if (new_plane_state->uapi.alpha != old_plane_state-
> > > > > uapi.alpha) {
> > > >    damaged_area.y1 = new_plane_state->uapi.dst.y1;
> > > >    damaged_area.y2 = new_plane_state->uapi.dst.y2;
> > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > 
> > > >    damaged_area.y1 = old_plane_state->uapi.dst.y1;
> > > >    damaged_area.y2 = old_plane_state->uapi.dst.y2;
> > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > >    
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > >    continue;
> > > > } 
> > > > > +		} else if (!num_clips &&
> > > > > +			   new_plane_state->uapi.fb !=
> > > > > old_plane_state-
> > > > > > uapi.fb) {
> > > > > +			/*
> > > > > +			 * If the plane don't have damage areas
> > > > > but the
> > > > > +			 * framebuffer changed, mark the whole
> > > > > plane
> > > > > area as
> > > > > +			 * damaged.
> > > > > +			 */
> > > > > +			damaged_area.y1 = src.y1;
> > > > > +			damaged_area.y2 = src.y2;
> > > > > +		}
> > > > > +
> > > > else if (!num_clips && new_plane_state->uapi.fb !=
> > > > old_plane_state-
> > > > > uapi.fb) {
> > > >    /*
> > > >     * If the plane don't have damage areas but the
> > > >     * framebuffer changed, mark the whole plane area as
> > > >     * damaged.
> > > >     */
> > > >    damaged_area.y1 = new_plane_state->uapi.dst.y1;
> > > >    damaged_area.y2 = new_plane_state->uapi.dst.y2;
> > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > >    continue;
> > > > }
> > > > > +		for (j = 0; j < num_clips; j++) {
> > > > > +			struct drm_rect clip;
> > > > > +
> > > > > +			clip.y1 = damaged_clips[j].y1;
> > > > > +			clip.y2 = damaged_clips[j].y2;
> > > > > +			clip_area_update(&damaged_area, &clip);
> > > > > +		}
> > > > > +
> > > > > +		if (!drm_rect_intersect(&damaged_area, &src))
> > > > > +			continue;
> > > > > +
> > > > > +		damaged_area.y1 += new_plane_state-
> > > > > >uapi.dst.y1;
> > > > > +		damaged_area.y2 += new_plane_state-
> > > > > >uapi.dst.y1;
> > > > > +		clip_area_update(&pipe_clip, &damaged_area);
> > > > > +	}
> > > > > +
> > > > else if (num_clips) {
> > > >    struct drm_rect plane_damaged_area;
> > > >    plane_damaged_area.x1 = src.x1;
> > > >    plane_damaged_area.x2 = src.x2;
> > > >    plane_damaged_area.y1 = 0;
> > > >    plane_damaged_area.y2 = 0;
> > > > 	        
> > > >    for (j = 0; j < num_clips; j++) {
> > > >       struct drm_rect clip;
> > > > 
> > > >       clip.x1 = damaged_clips[j].x1;
> > > >       clip.x2 = damaged_clips[j].x2;
> > > >       clip.y1 = damaged_clips[j].y1;
> > > >       clip.y2 = damaged_clips[j].y2;
> > > > 
> > > >       if (drm_rect_intersect(&clip, &src)) {
> > > >          clip_area_update(&plane_damaged_area, &clip);
> > > >       }
> > > 
> > > Call intersect at every clip? that don't look optimized.
> > > 
> > when the clip_area_update() is called it just accumulates the input
> > rects to one output rect.
> > it might lead to accumulating unneeded excessive update rect region
> 
> The excessive rect region will be removed once after sum all clips in
> the current approach.
> 
on the link's 2nd page,
we only need a red Selective Fetch area, but your patch seems Selective
Fetch area as green rect.
https://docs.google.com/presentation/d/1gOKE4JnC97RzRg15ZM8IaQzHnifIxwvwP_UbOoGFE9E/edit?usp=sharing
> > > >    }
> > > > 
> > > >   if (drm_rect_visible(plane_damaged_area)) {
> > > >      plane_damaged_area.y1 = plane_damaged_area.y1 - src.y1 +
> > > > new_plane_state->uapi.dst.y1;
> > > >      plane_damaged_area.y2 = plane_damaged_area.y2 - src.y1 +
> > > > new_plane_state->uapi.dst.y1;
> > > > 
> > > >      clip_area_update(&pipe_clip, &plane_damaged_area);
> > > >      continue;
> > > >   }
> > > > }
> > > 
> > > Current code sum all the damage clips, if the sum of the damage
> > > clips
> > > insect with the src area it is translated to pipe coordinates and
> > > called
> > > clip_area_update() to update pipe_clip.
> > > 
> > > > the calculation and translating cooridinates is alreay
> > > > implemented
> > > > here
> > > > ( 
> > > > https://patchwork.freedesktop.org/patch/404264/?series=84340&rev=1
> > > >   it has commetns which explains scenarios.) 
> > > > > +	if (full_update)
> > > > > +		goto skip_sel_fetch_set_loop;
> > > > > +
> > > > > +	/*
> > > > > +	 * Now that we have the pipe damaged area check if it
> > > > > intersect
> > > > > with
> > > > > +	 * every plane, if it does set the plane selective
> > > > > fetch area.
> > > > > +	 */
> > > > > +	for_each_oldnew_intel_plane_in_state(state, plane,
> > > > > old_plane_state,
> > > > > +					     new_plane_state,
> > > > > i) {
> > > > > +		struct drm_rect *sel_fetch_area, inter, src;
> > > > > +
> > > > > +		if (new_plane_state->uapi.crtc != crtc_state-
> > > > > > uapi.crtc 
> > > > > +		    !new_plane_state->uapi.visible)
> > > > > +			continue;
> > > > > +
> > > > > +		inter = pipe_clip;
> > > > > +		if (!drm_rect_intersect(&inter,
> > > > > &new_plane_state-
> > > > > > uapi.dst))
> > > > > +			continue;
> > > > > +
> > > > > +		drm_rect_convert_16_16_to_regular(&new_plane_st
> > > > > ate-
> > > > > > uapi.src, &src);
> > > > > +
> > > > >  		sel_fetch_area = &new_plane_state-
> > > > > >psr2_sel_fetch_area;
> > > > > -		sel_fetch_area->y1 = new_plane_state-
> > > > > >uapi.src.y1 >>
> > > > > 16;
> > > > > -		sel_fetch_area->y2 = new_plane_state-
> > > > > >uapi.src.y2 >>
> > > > > 16;
> > > > > +		sel_fetch_area->y1 = inter.y1 -
> > > > > new_plane_state-
> > > > > > uapi.dst.y1;
> > > > > +		sel_fetch_area->y2 = inter.y2 -
> > > > > new_plane_state-
> > > > > > uapi.dst.y1;
> > > > sel_fetch_area->y1 = inter.y1 - new_plane_state->uapi.dst.y1 +
> > > > src.y1;
> > > > sel_fetch_area->y2 = inter.y2 - new_plane_state->uapi.dst.y1 +
> > > > src.y1;
> > > 
> > > sel_fetch_area->y1 = inter.y1 - new_plane_state->uapi.dst.y1; +
> > > drm_rect_intersect(sel_fetch_area, &src);
> > > does a the same job and is easier to understand(translation +
> > > clip)
> > > 
> > when the src's x1 and y1 indicates over than 0, does it work?
> 
> It will, we use it for scenarios like that in this function.
> 
> 
here is the problematic case,
if we assume src indicates 50 x 50 +10 +10
,fb damage rect indicates 5 x 5 +55 +55 
and dst indicates 50 x 50 +100 +100

1) if whole plane src area needs to be updated
inter: 50 x 50 +100 +100
sel_fetch_area->y1 = 100 - 100 => 0
sel_fetch_area->y2 = 100 - 100 => 0


drm_rect_intersect(sel_fetch_area, &src);
 => sel_fetch_area does not fit whole src area.

2) if only the plane fb damage needs to be updated
translate fb damage's coordinates to crtc coordinates
5 x 5 +55 +55  => 5 x 5 +105 +105
inter: 5 x 5 +105 +105
sel_fetch_area->y1 = 105 - 100 => 5
sel_fetch_area->y2 = 105 - 100 => 5

drm_rect_intersect(sel_fetch_area, &src);
 => sel_fetch_area does not fit to src's damage area.

> > > > > +		sel_fetch_area->x1 = src.x1;
> > > > > +		sel_fetch_area->x2 = src.x2;
> > > > >  
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > -		temp = *sel_fetch_area;
> > > > > -		temp.y1 += new_plane_state->uapi.dst.y1;
> > > > > -		temp.y2 += new_plane_state->uapi.dst.y2;
> > > > > -		clip_area_update(&pipe_clip, &temp);
> > > > > +		drm_rect_intersect(sel_fetch_area, &src);
> > > > why this line is needed?
> > > 
> > > explained above.
> > > 
> > > 
> > > > >  	}
> > > > >  
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > +skip_sel_fetch_set_loop:
> > > > >  	psr2_man_trk_ctl_calc(crtc_state, &pipe_clip,
> > > > > full_update);
> > > > >  	return 0;
> > > > >  }
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [Intel-gfx] [PATCH v6 2/5] drm/i915/display/psr: Use plane damage clips to calculate damaged area
  2020-12-16 14:10           ` Mun, Gwan-gyeong
@ 2020-12-16 14:40             ` Souza, Jose
  2020-12-17 11:51               ` Mun, Gwan-gyeong
  0 siblings, 1 reply; 28+ messages in thread
From: Souza, Jose @ 2020-12-16 14:40 UTC (permalink / raw)
  To: Mun, Gwan-gyeong, intel-gfx

On Wed, 2020-12-16 at 14:10 +0000, Mun, Gwan-gyeong wrote:
> On Wed, 2020-12-16 at 05:17 -0800, Souza, Jose wrote:
> > On Wed, 2020-12-16 at 10:29 +0000, Mun, Gwan-gyeong wrote:
> > > On Tue, 2020-12-15 at 05:14 -0800, Souza, Jose wrote:
> > > > On Tue, 2020-12-15 at 13:02 +0000, Mun, Gwan-gyeong wrote:
> > > > > On Mon, 2020-12-14 at 09:49 -0800, José Roberto de Souza wrote:
> > > > > > Now using plane damage clips property to calcualte the
> > > > > > damaged
> > > > > > area.
> > > > > > Selective fetch only supports one region to be fetched so
> > > > > > software
> > > > > > needs to calculate a bounding box around all damage clips.
> > > > > > 
> > > > > > Now that we are not complete fetching each plane, there is
> > > > > > another
> > > > > > loop needed as all the plane areas that intersect with the
> > > > > > pipe
> > > > > > damaged area needs to be fetched from memory so the complete
> > > > > > blending
> > > > > > of all planes can happen.
> > > > > > 
> > > > > Hi,
> > > > > > v2:
> > > > > > - do not shifthing new_plane_state->uapi.dst only src is in
> > > > > > 16.16 
> > > > > Typo on commit message. shifthing -> shifting
> > > > > > format
> > > > > > 
> > > > > > v4:
> > > > > > - setting plane selective fetch area using the whole pipe
> > > > > > damage
> > > > > > area
> > > > > > - mark the whole plane area damaged if plane visibility or
> > > > > > alpha
> > > > > > changed
> > > > > > 
> > > > > > v5:
> > > > > > - taking in consideration src.y1 in the damage coordinates
> > > > > > - adding to the pipe damaged area planes that were visible
> > > > > > but
> > > > > > are
> > > > > > invisible in the new state
> > > > > > 
> > > > > > v6:
> > > > > > - consider old state plane coordinates when visibility
> > > > > > changes or
> > > > > > it
> > > > > > moved to calculate damaged area
> > > > > > - remove from damaged area the portion not in src clip
> > > > > > 
> > > > > > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > > > Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> > > > > > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > > > > > ---
> > > > > >  drivers/gpu/drm/i915/display/intel_psr.c | 98
> > > > > > +++++++++++++++++++++-
> > > > > > --
> > > > > >  1 file changed, 86 insertions(+), 12 deletions(-)
> > > > > > 
> > > > > > diff --git a/drivers/gpu/drm/i915/display/intel_psr.c
> > > > > > b/drivers/gpu/drm/i915/display/intel_psr.c
> > > > > > index d9a395c486d3..7daed098fa74 100644
> > > > > > --- a/drivers/gpu/drm/i915/display/intel_psr.c
> > > > > > +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> > > > > > @@ -1269,8 +1269,8 @@ int intel_psr2_sel_fetch_update(struct
> > > > > > intel_atomic_state *state,
> > > > > >  				struct intel_crtc *crtc)
> > > > > >  {
> > > > > >  	struct intel_crtc_state *crtc_state =
> > > > > > intel_atomic_get_new_crtc_state(state, crtc);
> > > > > > +	struct drm_rect pipe_clip = { .x1 = 0, .y1 = -1, .x2 =
> > > > > > INT_MAX,
> > > > > > .y2 = -1 };
> > > > > >  	struct intel_plane_state *new_plane_state,
> > > > > > *old_plane_state;
> > > > > > -	struct drm_rect pipe_clip = { .y1 = -1 };
> > > > > >  	struct intel_plane *plane;
> > > > > >  	bool full_update = false;
> > > > > >  	int i, ret;
> > > > > > @@ -1282,9 +1282,17 @@ int intel_psr2_sel_fetch_update(struct
> > > > > > intel_atomic_state *state,
> > > > > >  	if (ret)
> > > > > >  		return ret;
> > > > > >  
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > +	/*
> > > > > > +	 * Calculate minimal selective fetch area of each plane
> > > > > > and
> > > > > > calculate
> > > > > > +	 * the pipe damaged area.
> > > > > > +	 * In the next loop the plane selective fetch area will
> > > > > > actually be set
> > > > > > +	 * using whole pipe damaged area.
> > > > > > +	 */
> > > > > >  	for_each_oldnew_intel_plane_in_state(state, plane,
> > > > > > old_plane_state,
> > > > > >  					     new_plane_state,
> > > > > > i) {
> > > > > > -		struct drm_rect *sel_fetch_area, temp;
> > > > > > +		struct drm_rect src, damaged_area = { .x1 = 0,
> > > > > > .y1 =
> > > > > > -1, .x2 = INT_MAX, .y2 = -1 };
> > > > > > +		struct drm_mode_rect *damaged_clips;
> > > > > > +		u32 num_clips, j;
> > > > > >  
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > >  		if (new_plane_state->uapi.crtc != crtc_state-
> > > > > > > uapi.crtc)
> > > > > >  			continue;
> > > > > > @@ -1300,23 +1308,89 @@ int
> > > > > > intel_psr2_sel_fetch_update(struct
> > > > > > intel_atomic_state *state,
> > > > > >  			break;
> > > > > >  		}
> > > > > >  
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > -		if (!new_plane_state->uapi.visible)
> > > > > > -			continue;
> > > > > > +		drm_rect_convert_16_16_to_regular(&new_plane_st
> > > > > > ate-
> > > > > > > uapi.src, &src);
> > > > > > +		damaged_clips =
> > > > > > drm_plane_get_damage_clips(&new_plane_state->uapi);
> > > > > > +		num_clips =
> > > > > > drm_plane_get_damage_clips_count(&new_plane_state->uapi);
> > > > > >  
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > >  		/*
> > > > > > -		 * For now doing a selective fetch in the whole
> > > > > > plane
> > > > > > area,
> > > > > > -		 * optimizations will come in the future.
> > > > > > +		 * If visibility or plane moved, mark the whole
> > > > > > plane
> > > > > > area as
> > > > > > +		 * damaged as it needs to be complete redraw in
> > > > > > the new
> > > > > > and old
> > > > > > +		 * position.
> > > > > >  		 */
> > > > > > +		if (new_plane_state->uapi.visible !=
> > > > > > old_plane_state-
> > > > > > > uapi.visible ||
> > > > > > +		    !drm_rect_equals(&new_plane_state-
> > > > > > > uapi.dst,
> > > > > > +				     &old_plane_state-
> > > > > > > uapi.dst)) {
> > > > > > +			damaged_area.y1 = old_plane_state-
> > > > > > > uapi.src.y1
> > > > > > > > 16;
> > > > > > +			damaged_area.y1 = old_plane_state-
> > > > > > > uapi.src.y2
> > > > > > > > 16;
> > > > > > +			damaged_area.y1 += old_plane_state-
> > > > > > > uapi.dst.y1;
> > > > > > +			damaged_area.y2 += old_plane_state-
> > > > > > > uapi.dst.y1;
> > > > > > +			clip_area_update(&pipe_clip,
> > > > > > &damaged_area);
> > > > > > +
> > > > > > +			num_clips = 0;
> > > > > > +			damaged_area.y1 = src.y1;
> > > > > > +			damaged_area.y2 = src.y2;
> > > > > 1. Visibility change case
> > > > >  The pipe damaged area (The Selective Update region) needs to
> > > > > accumulate being visible plane's dst between old and new
> > > > > plane's
> > > > > dst.
> > > > > 
> > > > > if you are implementing this scenario, the code shoule be like
> > > > > this,
> > > > > 
> > > > > if (new_plane_state->uapi.visible != old_plane_state-
> > > > > > uapi.visible) 
> > > > > {
> > > > >    if (new_plane_state->uapi.visible) {
> > > > >       damaged_area.y1 = new_plane_state->uapi.dst.y1;
> > > > >       damaged_area.y2 = new_plane_state->uapi.dst.y2;
> > > > >    } else {
> > > > >       damaged_area.y1 = old_plane_state->uapi.dst.y1;
> > > > >       damaged_area.y2 = old_plane_state->uapi.dst.y2;
> > > > >    }
> > > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > >    continue;
> > > > > }
> > > > 
> > > > The current code does exactly above but discards the clipped in
> > > > uapi.src.
> > > > 
> > > in order to accumlate the pipe damage area, we don't need to use
> > > and
> > > calculate src coordinates on move and visibility change scenarios.
> > > we can easily accumalates than additional calculation.
> > 
> > Using uapi.dst will cause additional and unnecessary area be included
> > to the pipe damaged area, imagine that a plane have src.x1 = 50,
> > src.y1 = 100,
> > ... the plane invisible/cropped area don't need to be added to the
> > pipe damaged area.
> > 
> easist way to get damaged area for crtc is just using uapi.dst
> but because fb damage clip follows uapi.src coordinates, we have to
> translate fb damage clip's coordinates to dst coordinates for
> accumulating crtc damage region.
> 
> therefore can you explain what is the exact burden of using uapi.dst
> for calculating crtc damage area?
> 

I hope this ASCI drawing do not break :P

|----------------------|
|                      |
|   Pipe area          |
|----------------|     |
| whole plane A  |     |
|     |----------|     |
|     |   src    |     |
|     | visible  |     |
------------------------

Using dst would add the whole plane A area to the pipe damaged area while using src will only add the visible area.

>  
> > 
> > > > > 2. Move case
> > > > >  The pipe damaged area (The Selective Update region) needs to
> > > > > accumulate both old and new plane's dst
> > > > 
> > > > same
> > > > 
> > > > > if you are implementing this scenario, the code shoule be like
> > > > > this,
> > > > > 
> > > > > else if (!drm_rect_equals(&new_plane_state->uapi.dst,
> > > > > &old_plane_state-
> > > > > > uapi.dst)) {
> > > > >    damaged_area.y1 = new_plane_state->uapi.dst.y1;
> > > > >    damaged_area.y2 = new_plane_state->uapi.dst.y2;
> > > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > > 
> > > > >    damaged_area.y1 = old_plane_state->uapi.dst.y1;
> > > > >    damaged_area.y2 = old_plane_state->uapi.dst.y2;
> > > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > >    
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > >    continue;
> > > > > }
> > > > > > +		} else if (new_plane_state->uapi.alpha !=
> > > > > > old_plane_state->uapi.alpha) {
> > > > > > +			num_clips = 0;
> > > > > > +			damaged_area.y1 = src.y1;
> > > > > > +			damaged_area.y2 = src.y2;
> > > > > 3. alpha has changed ( because alpha handling section is not
> > > > > optimized,
> > > > > it can be treated with the move section)
> > > Yes, you are right, there was a misunderstanding of the alpha
> > > scenario
> > > of me.
> > > > no need to handle like this for alpha, if the plane moved if will
> > > > be
> > > > handled in the "if" above with or without alpha change, if it did
> > > > not
> > > > moved but
> > > > alpha change no need to add the old state coordinate to the pipe
> > > > clip.
> > > > 
> > > > > else if (new_plane_state->uapi.alpha != old_plane_state-
> > > > > > uapi.alpha) {
> > > > >    damaged_area.y1 = new_plane_state->uapi.dst.y1;
> > > > >    damaged_area.y2 = new_plane_state->uapi.dst.y2;
> > > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > > 
> > > > >    damaged_area.y1 = old_plane_state->uapi.dst.y1;
> > > > >    damaged_area.y2 = old_plane_state->uapi.dst.y2;
> > > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > >    
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > >    continue;
> > > > > } 
> > > > > > +		} else if (!num_clips &&
> > > > > > +			   new_plane_state->uapi.fb !=
> > > > > > old_plane_state-
> > > > > > > uapi.fb) {
> > > > > > +			/*
> > > > > > +			 * If the plane don't have damage areas
> > > > > > but the
> > > > > > +			 * framebuffer changed, mark the whole
> > > > > > plane
> > > > > > area as
> > > > > > +			 * damaged.
> > > > > > +			 */
> > > > > > +			damaged_area.y1 = src.y1;
> > > > > > +			damaged_area.y2 = src.y2;
> > > > > > +		}
> > > > > > +
> > > > > else if (!num_clips && new_plane_state->uapi.fb !=
> > > > > old_plane_state-
> > > > > > uapi.fb) {
> > > > >    /*
> > > > >     * If the plane don't have damage areas but the
> > > > >     * framebuffer changed, mark the whole plane area as
> > > > >     * damaged.
> > > > >     */
> > > > >    damaged_area.y1 = new_plane_state->uapi.dst.y1;
> > > > >    damaged_area.y2 = new_plane_state->uapi.dst.y2;
> > > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > >    continue;
> > > > > }
> > > > > > +		for (j = 0; j < num_clips; j++) {
> > > > > > +			struct drm_rect clip;
> > > > > > +
> > > > > > +			clip.y1 = damaged_clips[j].y1;
> > > > > > +			clip.y2 = damaged_clips[j].y2;
> > > > > > +			clip_area_update(&damaged_area, &clip);
> > > > > > +		}
> > > > > > +
> > > > > > +		if (!drm_rect_intersect(&damaged_area, &src))
> > > > > > +			continue;
> > > > > > +
> > > > > > +		damaged_area.y1 += new_plane_state-
> > > > > > > uapi.dst.y1;
> > > > > > +		damaged_area.y2 += new_plane_state-
> > > > > > > uapi.dst.y1;
> > > > > > +		clip_area_update(&pipe_clip, &damaged_area);
> > > > > > +	}
> > > > > > +
> > > > > else if (num_clips) {
> > > > >    struct drm_rect plane_damaged_area;
> > > > >    plane_damaged_area.x1 = src.x1;
> > > > >    plane_damaged_area.x2 = src.x2;
> > > > >    plane_damaged_area.y1 = 0;
> > > > >    plane_damaged_area.y2 = 0;
> > > > > 	        
> > > > >    for (j = 0; j < num_clips; j++) {
> > > > >       struct drm_rect clip;
> > > > > 
> > > > >       clip.x1 = damaged_clips[j].x1;
> > > > >       clip.x2 = damaged_clips[j].x2;
> > > > >       clip.y1 = damaged_clips[j].y1;
> > > > >       clip.y2 = damaged_clips[j].y2;
> > > > > 
> > > > >       if (drm_rect_intersect(&clip, &src)) {
> > > > >          clip_area_update(&plane_damaged_area, &clip);
> > > > >       }
> > > > 
> > > > Call intersect at every clip? that don't look optimized.
> > > > 
> > > when the clip_area_update() is called it just accumulates the input
> > > rects to one output rect.
> > > it might lead to accumulating unneeded excessive update rect region
> > 
> > The excessive rect region will be removed once after sum all clips in
> > the current approach.
> > 
> on the link's 2nd page,
> we only need a red Selective Fetch area, but your patch seems Selective
> Fetch area as green rect.
> https://docs.google.com/presentation/d/1gOKE4JnC97RzRg15ZM8IaQzHnifIxwvwP_UbOoGFE9E/edit?usp=sharing

Okay, now I got it.
Will update this but please take a look to the other answers so we do only one more version.


> > > > >    }
> > > > > 
> > > > >   if (drm_rect_visible(plane_damaged_area)) {
> > > > >      plane_damaged_area.y1 = plane_damaged_area.y1 - src.y1 +
> > > > > new_plane_state->uapi.dst.y1;
> > > > >      plane_damaged_area.y2 = plane_damaged_area.y2 - src.y1 +
> > > > > new_plane_state->uapi.dst.y1;
> > > > > 
> > > > >      clip_area_update(&pipe_clip, &plane_damaged_area);
> > > > >      continue;
> > > > >   }
> > > > > }
> > > > 
> > > > Current code sum all the damage clips, if the sum of the damage
> > > > clips
> > > > insect with the src area it is translated to pipe coordinates and
> > > > called
> > > > clip_area_update() to update pipe_clip.
> > > > 
> > > > > the calculation and translating cooridinates is alreay
> > > > > implemented
> > > > > here
> > > > > ( 
> > > > > https://patchwork.freedesktop.org/patch/404264/?series=84340&rev=1
> > > > >   it has commetns which explains scenarios.) 
> > > > > > +	if (full_update)
> > > > > > +		goto skip_sel_fetch_set_loop;
> > > > > > +
> > > > > > +	/*
> > > > > > +	 * Now that we have the pipe damaged area check if it
> > > > > > intersect
> > > > > > with
> > > > > > +	 * every plane, if it does set the plane selective
> > > > > > fetch area.
> > > > > > +	 */
> > > > > > +	for_each_oldnew_intel_plane_in_state(state, plane,
> > > > > > old_plane_state,
> > > > > > +					     new_plane_state,
> > > > > > i) {
> > > > > > +		struct drm_rect *sel_fetch_area, inter, src;
> > > > > > +
> > > > > > +		if (new_plane_state->uapi.crtc != crtc_state-
> > > > > > > uapi.crtc 
> > > > > > +		    !new_plane_state->uapi.visible)
> > > > > > +			continue;
> > > > > > +
> > > > > > +		inter = pipe_clip;
> > > > > > +		if (!drm_rect_intersect(&inter,
> > > > > > &new_plane_state-
> > > > > > > uapi.dst))
> > > > > > +			continue;
> > > > > > +
> > > > > > +		drm_rect_convert_16_16_to_regular(&new_plane_st
> > > > > > ate-
> > > > > > > uapi.src, &src);
> > > > > > +
> > > > > >  		sel_fetch_area = &new_plane_state-
> > > > > > > psr2_sel_fetch_area;
> > > > > > -		sel_fetch_area->y1 = new_plane_state-
> > > > > > > uapi.src.y1 >>
> > > > > > 16;
> > > > > > -		sel_fetch_area->y2 = new_plane_state-
> > > > > > > uapi.src.y2 >>
> > > > > > 16;
> > > > > > +		sel_fetch_area->y1 = inter.y1 -
> > > > > > new_plane_state-
> > > > > > > uapi.dst.y1;
> > > > > > +		sel_fetch_area->y2 = inter.y2 -
> > > > > > new_plane_state-
> > > > > > > uapi.dst.y1;
> > > > > sel_fetch_area->y1 = inter.y1 - new_plane_state->uapi.dst.y1 +
> > > > > src.y1;
> > > > > sel_fetch_area->y2 = inter.y2 - new_plane_state->uapi.dst.y1 +
> > > > > src.y1;
> > > > 
> > > > sel_fetch_area->y1 = inter.y1 - new_plane_state->uapi.dst.y1; +
> > > > drm_rect_intersect(sel_fetch_area, &src);
> > > > does a the same job and is easier to understand(translation +
> > > > clip)
> > > > 
> > > when the src's x1 and y1 indicates over than 0, does it work?
> > 
> > It will, we use it for scenarios like that in this function.
> > 
> > 
> here is the problematic case,
> if we assume src indicates 50 x 50 +10 +10
> ,fb damage rect indicates 5 x 5 +55 +55 
> and dst indicates 50 x 50 +100 +100
> 
> 1) if whole plane src area needs to be updated
> inter: 50 x 50 +100 +100
> sel_fetch_area->y1 = 100 - 100 => 0
> sel_fetch_area->y2 = 100 - 100 => 0
> 
> 
> drm_rect_intersect(sel_fetch_area, &src);
>  => sel_fetch_area does not fit whole src area.

Your values are wrong.

# 50 x 50 +10 +10

src.x1 = 50
src.y1 = 50
src.x2 = 60
src.y2 = 60

# 5 x 5 +55 +55. * not used in example 1
damaged.x1 = 5
damaged.y1 = 5
damaged.x2 = 60
damaged.y2 = 60

# 50 x 50 +100 +100
dst.x1 = 50
dst.y1 = 50
dst.x2 = 150
dst.y2 = 150

####

1) if whole plane src are needs to be updated
pipe_clip.x1 = src.x1 + dst.x1 = 100
pipe_clip.y2 = src.y1 + dst.y1 = 100
pipe_clip.x2 = src.x2 + dst.y1 = 110
pipe_clip.y2 = src.y2 + dst.y2 = 110

# drm_rect_intersect(&inter, &new_plane_state->uapi.dst)
iter.x1 = 100
iter.y1 = 100
iter.x2 = 110
iter.y2 = 110

# sel_fetch_area->y1 = inter.y1 - new_plane_state->uapi.dst.y1;
sel_fetch_area.y1 = 100 - 50 = 50
sel_fetch_area.y2 = 110 - 50 = 60

drm_rect_intersect(sel_fetch_area, &src);

sel_fetch_area.y1 = 50
sel_fetch_area.y2 = 60

> 
> 2) if only the plane fb damage needs to be updated
> translate fb damage's coordinates to crtc coordinates
> 5 x 5 +55 +55  => 5 x 5 +105 +105
> inter: 5 x 5 +105 +105
> sel_fetch_area->y1 = 105 - 100 => 5
> sel_fetch_area->y2 = 105 - 100 => 5
> 
> drm_rect_intersect(sel_fetch_area, &src);
>  => sel_fetch_area does not fit to src's damage area.

Let me know if this case is broken after use the right values.

> 
> > > > > > +		sel_fetch_area->x1 = src.x1;
> > > > > > +		sel_fetch_area->x2 = src.x2;
> > > > > >  
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > -		temp = *sel_fetch_area;
> > > > > > -		temp.y1 += new_plane_state->uapi.dst.y1;
> > > > > > -		temp.y2 += new_plane_state->uapi.dst.y2;
> > > > > > -		clip_area_update(&pipe_clip, &temp);
> > > > > > +		drm_rect_intersect(sel_fetch_area, &src);
> > > > > why this line is needed?
> > > > 
> > > > explained above.
> > > > 
> > > > 
> > > > > >  	}
> > > > > >  
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > +skip_sel_fetch_set_loop:
> > > > > >  	psr2_man_trk_ctl_calc(crtc_state, &pipe_clip,
> > > > > > full_update);
> > > > > >  	return 0;
> > > > > >  }

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [Intel-gfx] [PATCH v6 2/5] drm/i915/display/psr: Use plane damage clips to calculate damaged area
  2020-12-16 14:40             ` Souza, Jose
@ 2020-12-17 11:51               ` Mun, Gwan-gyeong
  2020-12-17 13:34                 ` Souza, Jose
  0 siblings, 1 reply; 28+ messages in thread
From: Mun, Gwan-gyeong @ 2020-12-17 11:51 UTC (permalink / raw)
  To: intel-gfx, Souza, Jose

On Wed, 2020-12-16 at 06:40 -0800, Souza, Jose wrote:
> On Wed, 2020-12-16 at 14:10 +0000, Mun, Gwan-gyeong wrote:
> > On Wed, 2020-12-16 at 05:17 -0800, Souza, Jose wrote:
> > > On Wed, 2020-12-16 at 10:29 +0000, Mun, Gwan-gyeong wrote:
> > > > On Tue, 2020-12-15 at 05:14 -0800, Souza, Jose wrote:
> > > > > On Tue, 2020-12-15 at 13:02 +0000, Mun, Gwan-gyeong wrote:
> > > > > > On Mon, 2020-12-14 at 09:49 -0800, José Roberto de Souza
> > > > > > wrote:
> > > > > > > Now using plane damage clips property to calcualte the
> > > > > > > damaged
> > > > > > > area.
> > > > > > > Selective fetch only supports one region to be fetched so
> > > > > > > software
> > > > > > > needs to calculate a bounding box around all damage
> > > > > > > clips.
> > > > > > > 
> > > > > > > Now that we are not complete fetching each plane, there
> > > > > > > is
> > > > > > > another
> > > > > > > loop needed as all the plane areas that intersect with
> > > > > > > the
> > > > > > > pipe
> > > > > > > damaged area needs to be fetched from memory so the
> > > > > > > complete
> > > > > > > blending
> > > > > > > of all planes can happen.
> > > > > > > 
> > > > > > Hi,
> > > > > > > v2:
> > > > > > > - do not shifthing new_plane_state->uapi.dst only src is
> > > > > > > in
> > > > > > > 16.16 
> > > > > > Typo on commit message. shifthing -> shifting
> > > > > > > format
> > > > > > > 
> > > > > > > v4:
> > > > > > > - setting plane selective fetch area using the whole pipe
> > > > > > > damage
> > > > > > > area
> > > > > > > - mark the whole plane area damaged if plane visibility
> > > > > > > or
> > > > > > > alpha
> > > > > > > changed
> > > > > > > 
> > > > > > > v5:
> > > > > > > - taking in consideration src.y1 in the damage
> > > > > > > coordinates
> > > > > > > - adding to the pipe damaged area planes that were
> > > > > > > visible
> > > > > > > but
> > > > > > > are
> > > > > > > invisible in the new state
> > > > > > > 
> > > > > > > v6:
> > > > > > > - consider old state plane coordinates when visibility
> > > > > > > changes or
> > > > > > > it
> > > > > > > moved to calculate damaged area
> > > > > > > - remove from damaged area the portion not in src clip
> > > > > > > 
> > > > > > > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > > > > Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> > > > > > > Signed-off-by: José Roberto de Souza <
> > > > > > > jose.souza@intel.com>
> > > > > > > ---
> > > > > > >  drivers/gpu/drm/i915/display/intel_psr.c | 98
> > > > > > > +++++++++++++++++++++-
> > > > > > > --
> > > > > > >  1 file changed, 86 insertions(+), 12 deletions(-)
> > > > > > > 
> > > > > > > diff --git a/drivers/gpu/drm/i915/display/intel_psr.c
> > > > > > > b/drivers/gpu/drm/i915/display/intel_psr.c
> > > > > > > index d9a395c486d3..7daed098fa74 100644
> > > > > > > --- a/drivers/gpu/drm/i915/display/intel_psr.c
> > > > > > > +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> > > > > > > @@ -1269,8 +1269,8 @@ int
> > > > > > > intel_psr2_sel_fetch_update(struct
> > > > > > > intel_atomic_state *state,
> > > > > > >  				struct intel_crtc *crtc)
> > > > > > >  {
> > > > > > >  	struct intel_crtc_state *crtc_state =
> > > > > > > intel_atomic_get_new_crtc_state(state, crtc);
> > > > > > > +	struct drm_rect pipe_clip = { .x1 = 0, .y1 = -1, .x2 =
> > > > > > > INT_MAX,
> > > > > > > .y2 = -1 };
> > > > > > >  	struct intel_plane_state *new_plane_state,
> > > > > > > *old_plane_state;
> > > > > > > -	struct drm_rect pipe_clip = { .y1 = -1 };
> > > > > > >  	struct intel_plane *plane;
> > > > > > >  	bool full_update = false;
> > > > > > >  	int i, ret;
> > > > > > > @@ -1282,9 +1282,17 @@ int
> > > > > > > intel_psr2_sel_fetch_update(struct
> > > > > > > intel_atomic_state *state,
> > > > > > >  	if (ret)
> > > > > > >  		return ret;
> > > > > > >  
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > +	/*
> > > > > > > +	 * Calculate minimal selective fetch area of each plane
> > > > > > > and
> > > > > > > calculate
> > > > > > > +	 * the pipe damaged area.
> > > > > > > +	 * In the next loop the plane selective fetch area will
> > > > > > > actually be set
> > > > > > > +	 * using whole pipe damaged area.
> > > > > > > +	 */
> > > > > > >  	for_each_oldnew_intel_plane_in_state(state, plane,
> > > > > > > old_plane_state,
> > > > > > >  					     new_plane_state,
> > > > > > > i) {
> > > > > > > -		struct drm_rect *sel_fetch_area, temp;
> > > > > > > +		struct drm_rect src, damaged_area = { .x1 = 0,
> > > > > > > .y1 =
> > > > > > > -1, .x2 = INT_MAX, .y2 = -1 };
> > > > > > > +		struct drm_mode_rect *damaged_clips;
> > > > > > > +		u32 num_clips, j;
> > > > > > >  
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > >  		if (new_plane_state->uapi.crtc != crtc_state-
> > > > > > > > uapi.crtc)
> > > > > > >  			continue;
> > > > > > > @@ -1300,23 +1308,89 @@ int
> > > > > > > intel_psr2_sel_fetch_update(struct
> > > > > > > intel_atomic_state *state,
> > > > > > >  			break;
> > > > > > >  		}
> > > > > > >  
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > -		if (!new_plane_state->uapi.visible)
> > > > > > > -			continue;
> > > > > > > +		drm_rect_convert_16_16_to_regular(&new_plane_st
> > > > > > > ate-
> > > > > > > > uapi.src, &src);
> > > > > > > +		damaged_clips =
> > > > > > > drm_plane_get_damage_clips(&new_plane_state->uapi);
> > > > > > > +		num_clips =
> > > > > > > drm_plane_get_damage_clips_count(&new_plane_state->uapi);
> > > > > > >  
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > >  		/*
> > > > > > > -		 * For now doing a selective fetch in the whole
> > > > > > > plane
> > > > > > > area,
> > > > > > > -		 * optimizations will come in the future.
> > > > > > > +		 * If visibility or plane moved, mark the whole
> > > > > > > plane
> > > > > > > area as
> > > > > > > +		 * damaged as it needs to be complete redraw in
> > > > > > > the new
> > > > > > > and old
> > > > > > > +		 * position.
> > > > > > >  		 */
> > > > > > > +		if (new_plane_state->uapi.visible !=
> > > > > > > old_plane_state-
> > > > > > > > uapi.visible ||
> > > > > > > +		    !drm_rect_equals(&new_plane_state-
> > > > > > > > uapi.dst,
> > > > > > > +				     &old_plane_state-
> > > > > > > > uapi.dst)) {
> > > > > > > +			damaged_area.y1 = old_plane_state-
> > > > > > > > uapi.src.y1
> > > > > > > > > 16;
> > > > > > > +			damaged_area.y1 = old_plane_state-
> > > > > > > > uapi.src.y2
> > > > > > > > > 16;
> > > > > > > +			damaged_area.y1 += old_plane_state-
> > > > > > > > uapi.dst.y1;
> > > > > > > +			damaged_area.y2 += old_plane_state-
> > > > > > > > uapi.dst.y1;
> > > > > > > +			clip_area_update(&pipe_clip,
> > > > > > > &damaged_area);
> > > > > > > +
> > > > > > > +			num_clips = 0;
> > > > > > > +			damaged_area.y1 = src.y1;
> > > > > > > +			damaged_area.y2 = src.y2;
> > > > > > 1. Visibility change case
> > > > > >  The pipe damaged area (The Selective Update region) needs
> > > > > > to
> > > > > > accumulate being visible plane's dst between old and new
> > > > > > plane's
> > > > > > dst.
> > > > > > 
> > > > > > if you are implementing this scenario, the code shoule be
> > > > > > like
> > > > > > this,
> > > > > > 
> > > > > > if (new_plane_state->uapi.visible != old_plane_state-
> > > > > > > uapi.visible) 
> > > > > > {
> > > > > >    if (new_plane_state->uapi.visible) {
> > > > > >       damaged_area.y1 = new_plane_state->uapi.dst.y1;
> > > > > >       damaged_area.y2 = new_plane_state->uapi.dst.y2;
> > > > > >    } else {
> > > > > >       damaged_area.y1 = old_plane_state->uapi.dst.y1;
> > > > > >       damaged_area.y2 = old_plane_state->uapi.dst.y2;
> > > > > >    }
> > > > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > > >    continue;
> > > > > > }
> > > > > 
> > > > > The current code does exactly above but discards the clipped
> > > > > in
> > > > > uapi.src.
> > > > > 
> > > > in order to accumlate the pipe damage area, we don't need to
> > > > use
> > > > and
> > > > calculate src coordinates on move and visibility change
> > > > scenarios.
> > > > we can easily accumalates than additional calculation.
> > > 
> > > Using uapi.dst will cause additional and unnecessary area be
> > > included
> > > to the pipe damaged area, imagine that a plane have src.x1 = 50,
> > > src.y1 = 100,
> > > ... the plane invisible/cropped area don't need to be added to
> > > the
> > > pipe damaged area.
> > > 
> > easist way to get damaged area for crtc is just using uapi.dst
> > but because fb damage clip follows uapi.src coordinates, we have to
> > translate fb damage clip's coordinates to dst coordinates for
> > accumulating crtc damage region.
> > 
> > therefore can you explain what is the exact burden of using
> > uapi.dst
> > for calculating crtc damage area?
> > 
> 
> I hope this ASCI drawing do not break :P
> 
> > ----------------------|
> >                      |
> >   Pipe area          |
> > ----------------|     |
> > whole plane A  |     |
> >     |----------|     |
> >     |   src    |     |
> >     | visible  |     |
> ------------------------
> 
> Using dst would add the whole plane A area to the pipe damaged area
> while using src will only add the visible area.
> 

if you expect to be shown the src visible area to pipe area, 
(that means the dst area has the same width and height, but the x1, y1
will be based on crtc coordinates.)
in the crte point of view, the src visible area is the dst area.
(but because the src area use fb based coordinates, we should use dst)

and if you are expecting handling obscured area by other planes, (for
optimizing)
we should use dst too.

we only need to use src for handling fb damaged clip rects. 
but after accumulating the fb damaged clip rects, it also has to be
translated to crtc coordinates from fb (src ) coordinates.

> >  
> > > > > > 2. Move case
> > > > > >  The pipe damaged area (The Selective Update region) needs
> > > > > > to
> > > > > > accumulate both old and new plane's dst
> > > > > 
> > > > > same
> > > > > 
> > > > > > if you are implementing this scenario, the code shoule be
> > > > > > like
> > > > > > this,
> > > > > > 
> > > > > > else if (!drm_rect_equals(&new_plane_state->uapi.dst,
> > > > > > &old_plane_state-
> > > > > > > uapi.dst)) {
> > > > > >    damaged_area.y1 = new_plane_state->uapi.dst.y1;
> > > > > >    damaged_area.y2 = new_plane_state->uapi.dst.y2;
> > > > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > > > 
> > > > > >    damaged_area.y1 = old_plane_state->uapi.dst.y1;
> > > > > >    damaged_area.y2 = old_plane_state->uapi.dst.y2;
> > > > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > > >    
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > >    continue;
> > > > > > }
> > > > > > > +		} else if (new_plane_state->uapi.alpha !=
> > > > > > > old_plane_state->uapi.alpha) {
> > > > > > > +			num_clips = 0;
> > > > > > > +			damaged_area.y1 = src.y1;
> > > > > > > +			damaged_area.y2 = src.y2;
> > > > > > 3. alpha has changed ( because alpha handling section is
> > > > > > not
> > > > > > optimized,
> > > > > > it can be treated with the move section)
> > > > Yes, you are right, there was a misunderstanding of the alpha
> > > > scenario
> > > > of me.
> > > > > no need to handle like this for alpha, if the plane moved if
> > > > > will
> > > > > be
> > > > > handled in the "if" above with or without alpha change, if it
> > > > > did
> > > > > not
> > > > > moved but
> > > > > alpha change no need to add the old state coordinate to the
> > > > > pipe
> > > > > clip.
> > > > > 
> > > > > > else if (new_plane_state->uapi.alpha != old_plane_state-
> > > > > > > uapi.alpha) {
> > > > > >    damaged_area.y1 = new_plane_state->uapi.dst.y1;
> > > > > >    damaged_area.y2 = new_plane_state->uapi.dst.y2;
> > > > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > > > 
> > > > > >    damaged_area.y1 = old_plane_state->uapi.dst.y1;
> > > > > >    damaged_area.y2 = old_plane_state->uapi.dst.y2;
> > > > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > > >    
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > >    continue;
> > > > > > } 
> > > > > > > +		} else if (!num_clips &&
> > > > > > > +			   new_plane_state->uapi.fb !=
> > > > > > > old_plane_state-
> > > > > > > > uapi.fb) {
> > > > > > > +			/*
> > > > > > > +			 * If the plane don't have damage areas
> > > > > > > but the
> > > > > > > +			 * framebuffer changed, mark the whole
> > > > > > > plane
> > > > > > > area as
> > > > > > > +			 * damaged.
> > > > > > > +			 */
> > > > > > > +			damaged_area.y1 = src.y1;
> > > > > > > +			damaged_area.y2 = src.y2;
> > > > > > > +		}
> > > > > > > +
> > > > > > else if (!num_clips && new_plane_state->uapi.fb !=
> > > > > > old_plane_state-
> > > > > > > uapi.fb) {
> > > > > >    /*
> > > > > >     * If the plane don't have damage areas but the
> > > > > >     * framebuffer changed, mark the whole plane area as
> > > > > >     * damaged.
> > > > > >     */
> > > > > >    damaged_area.y1 = new_plane_state->uapi.dst.y1;
> > > > > >    damaged_area.y2 = new_plane_state->uapi.dst.y2;
> > > > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > > >    continue;
> > > > > > }
> > > > > > > +		for (j = 0; j < num_clips; j++) {
> > > > > > > +			struct drm_rect clip;
> > > > > > > +
> > > > > > > +			clip.y1 = damaged_clips[j].y1;
> > > > > > > +			clip.y2 = damaged_clips[j].y2;
> > > > > > > +			clip_area_update(&damaged_area, &clip);
> > > > > > > +		}
> > > > > > > +
> > > > > > > +		if (!drm_rect_intersect(&damaged_area, &src))
> > > > > > > +			continue;
> > > > > > > +
> > > > > > > +		damaged_area.y1 += new_plane_state-
> > > > > > > > uapi.dst.y1;
> > > > > > > +		damaged_area.y2 += new_plane_state-
> > > > > > > > uapi.dst.y1;
> > > > > > > +		clip_area_update(&pipe_clip, &damaged_area);
> > > > > > > +	}
> > > > > > > +
> > > > > > else if (num_clips) {
> > > > > >    struct drm_rect plane_damaged_area;
> > > > > >    plane_damaged_area.x1 = src.x1;
> > > > > >    plane_damaged_area.x2 = src.x2;
> > > > > >    plane_damaged_area.y1 = 0;
> > > > > >    plane_damaged_area.y2 = 0;
> > > > > > 	        
> > > > > >    for (j = 0; j < num_clips; j++) {
> > > > > >       struct drm_rect clip;
> > > > > > 
> > > > > >       clip.x1 = damaged_clips[j].x1;
> > > > > >       clip.x2 = damaged_clips[j].x2;
> > > > > >       clip.y1 = damaged_clips[j].y1;
> > > > > >       clip.y2 = damaged_clips[j].y2;
> > > > > > 
> > > > > >       if (drm_rect_intersect(&clip, &src)) {
> > > > > >          clip_area_update(&plane_damaged_area, &clip);
> > > > > >       }
> > > > > 
> > > > > Call intersect at every clip? that don't look optimized.
> > > > > 
> > > > when the clip_area_update() is called it just accumulates the
> > > > input
> > > > rects to one output rect.
> > > > it might lead to accumulating unneeded excessive update rect
> > > > region
> > > 
> > > The excessive rect region will be removed once after sum all
> > > clips in
> > > the current approach.
> > > 
> > on the link's 2nd page,
> > we only need a red Selective Fetch area, but your patch seems
> > Selective
> > Fetch area as green rect.
> > https://docs.google.com/presentation/d/1gOKE4JnC97RzRg15ZM8IaQzHnifIxwvwP_UbOoGFE9E/edit?usp=sharing
> 
> Okay, now I got it.
> Will update this but please take a look to the other answers so we do
> only one more version.
> 
> 
> > > > > >    }
> > > > > > 
> > > > > >   if (drm_rect_visible(plane_damaged_area)) {
> > > > > >      plane_damaged_area.y1 = plane_damaged_area.y1 - src.y1
> > > > > > +
> > > > > > new_plane_state->uapi.dst.y1;
> > > > > >      plane_damaged_area.y2 = plane_damaged_area.y2 - src.y1
> > > > > > +
> > > > > > new_plane_state->uapi.dst.y1;
> > > > > > 
> > > > > >      clip_area_update(&pipe_clip, &plane_damaged_area);
> > > > > >      continue;
> > > > > >   }
> > > > > > }
> > > > > 
> > > > > Current code sum all the damage clips, if the sum of the
> > > > > damage
> > > > > clips
> > > > > insect with the src area it is translated to pipe coordinates
> > > > > and
> > > > > called
> > > > > clip_area_update() to update pipe_clip.
> > > > > 
> > > > > > the calculation and translating cooridinates is alreay
> > > > > > implemented
> > > > > > here
> > > > > > ( 
> > > > > > https://patchwork.freedesktop.org/patch/404264/?series=84340&rev=1
> > > > > >   it has commetns which explains scenarios.) 
> > > > > > > +	if (full_update)
> > > > > > > +		goto skip_sel_fetch_set_loop;
> > > > > > > +
> > > > > > > +	/*
> > > > > > > +	 * Now that we have the pipe damaged area check if it
> > > > > > > intersect
> > > > > > > with
> > > > > > > +	 * every plane, if it does set the plane selective
> > > > > > > fetch area.
> > > > > > > +	 */
> > > > > > > +	for_each_oldnew_intel_plane_in_state(state, plane,
> > > > > > > old_plane_state,
> > > > > > > +					     new_plane_state,
> > > > > > > i) {
> > > > > > > +		struct drm_rect *sel_fetch_area, inter, src;
> > > > > > > +
> > > > > > > +		if (new_plane_state->uapi.crtc != crtc_state-
> > > > > > > > uapi.crtc 
> > > > > > > +		    !new_plane_state->uapi.visible)
> > > > > > > +			continue;
> > > > > > > +
> > > > > > > +		inter = pipe_clip;
> > > > > > > +		if (!drm_rect_intersect(&inter,
> > > > > > > &new_plane_state-
> > > > > > > > uapi.dst))
> > > > > > > +			continue;
> > > > > > > +
> > > > > > > +		drm_rect_convert_16_16_to_regular(&new_plane_st
> > > > > > > ate-
> > > > > > > > uapi.src, &src);
> > > > > > > +
> > > > > > >  		sel_fetch_area = &new_plane_state-
> > > > > > > > psr2_sel_fetch_area;
> > > > > > > -		sel_fetch_area->y1 = new_plane_state-
> > > > > > > > uapi.src.y1 >>
> > > > > > > 16;
> > > > > > > -		sel_fetch_area->y2 = new_plane_state-
> > > > > > > > uapi.src.y2 >>
> > > > > > > 16;
> > > > > > > +		sel_fetch_area->y1 = inter.y1 -
> > > > > > > new_plane_state-
> > > > > > > > uapi.dst.y1;
> > > > > > > +		sel_fetch_area->y2 = inter.y2 -
> > > > > > > new_plane_state-
> > > > > > > > uapi.dst.y1;
> > > > > > sel_fetch_area->y1 = inter.y1 - new_plane_state-
> > > > > > >uapi.dst.y1 +
> > > > > > src.y1;
> > > > > > sel_fetch_area->y2 = inter.y2 - new_plane_state-
> > > > > > >uapi.dst.y1 +
> > > > > > src.y1;
> > > > > 
> > > > > sel_fetch_area->y1 = inter.y1 - new_plane_state->uapi.dst.y1; 
> > > > > +
> > > > > drm_rect_intersect(sel_fetch_area, &src);
> > > > > does a the same job and is easier to understand(translation +
> > > > > clip)
> > > > > 
> > > > when the src's x1 and y1 indicates over than 0, does it work?
> > > 
> > > It will, we use it for scenarios like that in this function.
> > > 
> > > 
> > here is the problematic case,
> > if we assume src indicates 50 x 50 +10 +10
> > ,fb damage rect indicates 5 x 5 +55 +55 
> > and dst indicates 50 x 50 +100 +100
> > 
> > 1) if whole plane src area needs to be updated
> > inter: 50 x 50 +100 +100
> > sel_fetch_area->y1 = 100 - 100 => 0
> > sel_fetch_area->y2 = 100 - 100 => 0
> > 
> > 
> > drm_rect_intersect(sel_fetch_area, &src);
> >  => sel_fetch_area does not fit whole src area.
> 
> Your values are wrong.
> 
I used DRM_RECT_FMT style.

#define DRM_RECT_FMT    "%dx%d%+d%+d"
#define DRM_RECT_ARG(r) drm_rect_width(r), drm_rect_height(r), (r)->x1, 
(r)->y1 

> # 50 x 50 +10 +10
> 
> src.x1 = 50
> src.y1 = 50
> src.x2 = 60
> src.y2 = 60
> 
src.x1 = 10
src.y1 = 10
src.x2 = 60
src.y2 = 60

> # 5 x 5 +55 +55. * not used in example 1
> damaged.x1 = 5
> damaged.y1 = 5
> damaged.x2 = 60
> damaged.y2 = 60
> 
damaged.x1 = 55
damaged.y1 = 55
damaged.x2 = 60
damaged.y2 = 60

> # 50 x 50 +100 +100
> dst.x1 = 50
> dst.y1 = 50
> dst.x2 = 150
> dst.y2 = 150
> 
dst.x1 = 100
dst.y1 = 100
dst.x2 = 150
dst.y2 = 150

therefore below result seems to wrong result.

> ####
> 
> 1) if whole plane src are needs to be updated
> pipe_clip.x1 = src.x1 + dst.x1 = 100
> pipe_clip.y2 = src.y1 + dst.y1 = 100
> pipe_clip.x2 = src.x2 + dst.y1 = 110
> pipe_clip.y2 = src.y2 + dst.y2 = 110
> 
> # drm_rect_intersect(&inter, &new_plane_state->uapi.dst)
> iter.x1 = 100
> iter.y1 = 100
> iter.x2 = 110
> iter.y2 = 110
> 
> # sel_fetch_area->y1 = inter.y1 - new_plane_state->uapi.dst.y1;
> sel_fetch_area.y1 = 100 - 50 = 50
> sel_fetch_area.y2 = 110 - 50 = 60
> 
> drm_rect_intersect(sel_fetch_area, &src);
> 
> sel_fetch_area.y1 = 50
> sel_fetch_area.y2 = 60
> 
> > 2) if only the plane fb damage needs to be updated
> > translate fb damage's coordinates to crtc coordinates
> > 5 x 5 +55 +55  => 5 x 5 +105 +105
> > inter: 5 x 5 +105 +105
> > sel_fetch_area->y1 = 105 - 100 => 5
> > sel_fetch_area->y2 = 105 - 100 => 5
> > 
> > drm_rect_intersect(sel_fetch_area, &src);
> >  => sel_fetch_area does not fit to src's damage area.
> 
> Let me know if this case is broken after use the right values.
> 
> > > > > > > +		sel_fetch_area->x1 = src.x1;
> > > > > > > +		sel_fetch_area->x2 = src.x2;
> > > > > > >  
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > -		temp = *sel_fetch_area;
> > > > > > > -		temp.y1 += new_plane_state->uapi.dst.y1;
> > > > > > > -		temp.y2 += new_plane_state->uapi.dst.y2;
> > > > > > > -		clip_area_update(&pipe_clip, &temp);
> > > > > > > +		drm_rect_intersect(sel_fetch_area, &src);
> > > > > > why this line is needed?
> > > > > 
> > > > > explained above.
> > > > > 
> > > > > 
> > > > > > >  	}
> > > > > > >  
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > +skip_sel_fetch_set_loop:
> > > > > > >  	psr2_man_trk_ctl_calc(crtc_state, &pipe_clip,
> > > > > > > full_update);
> > > > > > >  	return 0;
> > > > > > >  }
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [Intel-gfx] [PATCH v6 2/5] drm/i915/display/psr: Use plane damage clips to calculate damaged area
  2020-12-17 11:51               ` Mun, Gwan-gyeong
@ 2020-12-17 13:34                 ` Souza, Jose
  2020-12-17 16:04                   ` Mun, Gwan-gyeong
  0 siblings, 1 reply; 28+ messages in thread
From: Souza, Jose @ 2020-12-17 13:34 UTC (permalink / raw)
  To: Mun, Gwan-gyeong, intel-gfx

On Thu, 2020-12-17 at 11:51 +0000, Mun, Gwan-gyeong wrote:
> On Wed, 2020-12-16 at 06:40 -0800, Souza, Jose wrote:
> > On Wed, 2020-12-16 at 14:10 +0000, Mun, Gwan-gyeong wrote:
> > > On Wed, 2020-12-16 at 05:17 -0800, Souza, Jose wrote:
> > > > On Wed, 2020-12-16 at 10:29 +0000, Mun, Gwan-gyeong wrote:
> > > > > On Tue, 2020-12-15 at 05:14 -0800, Souza, Jose wrote:
> > > > > > On Tue, 2020-12-15 at 13:02 +0000, Mun, Gwan-gyeong wrote:
> > > > > > > On Mon, 2020-12-14 at 09:49 -0800, José Roberto de Souza
> > > > > > > wrote:
> > > > > > > > Now using plane damage clips property to calcualte the
> > > > > > > > damaged
> > > > > > > > area.
> > > > > > > > Selective fetch only supports one region to be fetched so
> > > > > > > > software
> > > > > > > > needs to calculate a bounding box around all damage
> > > > > > > > clips.
> > > > > > > > 
> > > > > > > > Now that we are not complete fetching each plane, there
> > > > > > > > is
> > > > > > > > another
> > > > > > > > loop needed as all the plane areas that intersect with
> > > > > > > > the
> > > > > > > > pipe
> > > > > > > > damaged area needs to be fetched from memory so the
> > > > > > > > complete
> > > > > > > > blending
> > > > > > > > of all planes can happen.
> > > > > > > > 
> > > > > > > Hi,
> > > > > > > > v2:
> > > > > > > > - do not shifthing new_plane_state->uapi.dst only src is
> > > > > > > > in
> > > > > > > > 16.16 
> > > > > > > Typo on commit message. shifthing -> shifting
> > > > > > > > format
> > > > > > > > 
> > > > > > > > v4:
> > > > > > > > - setting plane selective fetch area using the whole pipe
> > > > > > > > damage
> > > > > > > > area
> > > > > > > > - mark the whole plane area damaged if plane visibility
> > > > > > > > or
> > > > > > > > alpha
> > > > > > > > changed
> > > > > > > > 
> > > > > > > > v5:
> > > > > > > > - taking in consideration src.y1 in the damage
> > > > > > > > coordinates
> > > > > > > > - adding to the pipe damaged area planes that were
> > > > > > > > visible
> > > > > > > > but
> > > > > > > > are
> > > > > > > > invisible in the new state
> > > > > > > > 
> > > > > > > > v6:
> > > > > > > > - consider old state plane coordinates when visibility
> > > > > > > > changes or
> > > > > > > > it
> > > > > > > > moved to calculate damaged area
> > > > > > > > - remove from damaged area the portion not in src clip
> > > > > > > > 
> > > > > > > > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > > > > > Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> > > > > > > > Signed-off-by: José Roberto de Souza <
> > > > > > > > jose.souza@intel.com>
> > > > > > > > ---
> > > > > > > >  drivers/gpu/drm/i915/display/intel_psr.c | 98
> > > > > > > > +++++++++++++++++++++-
> > > > > > > > --
> > > > > > > >  1 file changed, 86 insertions(+), 12 deletions(-)
> > > > > > > > 
> > > > > > > > diff --git a/drivers/gpu/drm/i915/display/intel_psr.c
> > > > > > > > b/drivers/gpu/drm/i915/display/intel_psr.c
> > > > > > > > index d9a395c486d3..7daed098fa74 100644
> > > > > > > > --- a/drivers/gpu/drm/i915/display/intel_psr.c
> > > > > > > > +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> > > > > > > > @@ -1269,8 +1269,8 @@ int
> > > > > > > > intel_psr2_sel_fetch_update(struct
> > > > > > > > intel_atomic_state *state,
> > > > > > > >  				struct intel_crtc *crtc)
> > > > > > > >  {
> > > > > > > >  	struct intel_crtc_state *crtc_state =
> > > > > > > > intel_atomic_get_new_crtc_state(state, crtc);
> > > > > > > > +	struct drm_rect pipe_clip = { .x1 = 0, .y1 = -1, .x2 =
> > > > > > > > INT_MAX,
> > > > > > > > .y2 = -1 };
> > > > > > > >  	struct intel_plane_state *new_plane_state,
> > > > > > > > *old_plane_state;
> > > > > > > > -	struct drm_rect pipe_clip = { .y1 = -1 };
> > > > > > > >  	struct intel_plane *plane;
> > > > > > > >  	bool full_update = false;
> > > > > > > >  	int i, ret;
> > > > > > > > @@ -1282,9 +1282,17 @@ int
> > > > > > > > intel_psr2_sel_fetch_update(struct
> > > > > > > > intel_atomic_state *state,
> > > > > > > >  	if (ret)
> > > > > > > >  		return ret;
> > > > > > > >  
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > +	/*
> > > > > > > > +	 * Calculate minimal selective fetch area of each plane
> > > > > > > > and
> > > > > > > > calculate
> > > > > > > > +	 * the pipe damaged area.
> > > > > > > > +	 * In the next loop the plane selective fetch area will
> > > > > > > > actually be set
> > > > > > > > +	 * using whole pipe damaged area.
> > > > > > > > +	 */
> > > > > > > >  	for_each_oldnew_intel_plane_in_state(state, plane,
> > > > > > > > old_plane_state,
> > > > > > > >  					     new_plane_state,
> > > > > > > > i) {
> > > > > > > > -		struct drm_rect *sel_fetch_area, temp;
> > > > > > > > +		struct drm_rect src, damaged_area = { .x1 = 0,
> > > > > > > > .y1 =
> > > > > > > > -1, .x2 = INT_MAX, .y2 = -1 };
> > > > > > > > +		struct drm_mode_rect *damaged_clips;
> > > > > > > > +		u32 num_clips, j;
> > > > > > > >  
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > >  		if (new_plane_state->uapi.crtc != crtc_state-
> > > > > > > > > uapi.crtc)
> > > > > > > >  			continue;
> > > > > > > > @@ -1300,23 +1308,89 @@ int
> > > > > > > > intel_psr2_sel_fetch_update(struct
> > > > > > > > intel_atomic_state *state,
> > > > > > > >  			break;
> > > > > > > >  		}
> > > > > > > >  
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > -		if (!new_plane_state->uapi.visible)
> > > > > > > > -			continue;
> > > > > > > > +		drm_rect_convert_16_16_to_regular(&new_plane_st
> > > > > > > > ate-
> > > > > > > > > uapi.src, &src);
> > > > > > > > +		damaged_clips =
> > > > > > > > drm_plane_get_damage_clips(&new_plane_state->uapi);
> > > > > > > > +		num_clips =
> > > > > > > > drm_plane_get_damage_clips_count(&new_plane_state->uapi);
> > > > > > > >  
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > >  		/*
> > > > > > > > -		 * For now doing a selective fetch in the whole
> > > > > > > > plane
> > > > > > > > area,
> > > > > > > > -		 * optimizations will come in the future.
> > > > > > > > +		 * If visibility or plane moved, mark the whole
> > > > > > > > plane
> > > > > > > > area as
> > > > > > > > +		 * damaged as it needs to be complete redraw in
> > > > > > > > the new
> > > > > > > > and old
> > > > > > > > +		 * position.
> > > > > > > >  		 */
> > > > > > > > +		if (new_plane_state->uapi.visible !=
> > > > > > > > old_plane_state-
> > > > > > > > > uapi.visible ||
> > > > > > > > +		    !drm_rect_equals(&new_plane_state-
> > > > > > > > > uapi.dst,
> > > > > > > > +				     &old_plane_state-
> > > > > > > > > uapi.dst)) {
> > > > > > > > +			damaged_area.y1 = old_plane_state-
> > > > > > > > > uapi.src.y1
> > > > > > > > > > 16;
> > > > > > > > +			damaged_area.y1 = old_plane_state-
> > > > > > > > > uapi.src.y2
> > > > > > > > > > 16;
> > > > > > > > +			damaged_area.y1 += old_plane_state-
> > > > > > > > > uapi.dst.y1;
> > > > > > > > +			damaged_area.y2 += old_plane_state-
> > > > > > > > > uapi.dst.y1;
> > > > > > > > +			clip_area_update(&pipe_clip,
> > > > > > > > &damaged_area);
> > > > > > > > +
> > > > > > > > +			num_clips = 0;
> > > > > > > > +			damaged_area.y1 = src.y1;
> > > > > > > > +			damaged_area.y2 = src.y2;
> > > > > > > 1. Visibility change case
> > > > > > >  The pipe damaged area (The Selective Update region) needs
> > > > > > > to
> > > > > > > accumulate being visible plane's dst between old and new
> > > > > > > plane's
> > > > > > > dst.
> > > > > > > 
> > > > > > > if you are implementing this scenario, the code shoule be
> > > > > > > like
> > > > > > > this,
> > > > > > > 
> > > > > > > if (new_plane_state->uapi.visible != old_plane_state-
> > > > > > > > uapi.visible) 
> > > > > > > {
> > > > > > >    if (new_plane_state->uapi.visible) {
> > > > > > >       damaged_area.y1 = new_plane_state->uapi.dst.y1;
> > > > > > >       damaged_area.y2 = new_plane_state->uapi.dst.y2;
> > > > > > >    } else {
> > > > > > >       damaged_area.y1 = old_plane_state->uapi.dst.y1;
> > > > > > >       damaged_area.y2 = old_plane_state->uapi.dst.y2;
> > > > > > >    }
> > > > > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > > > >    continue;
> > > > > > > }
> > > > > > 
> > > > > > The current code does exactly above but discards the clipped
> > > > > > in
> > > > > > uapi.src.
> > > > > > 
> > > > > in order to accumlate the pipe damage area, we don't need to
> > > > > use
> > > > > and
> > > > > calculate src coordinates on move and visibility change
> > > > > scenarios.
> > > > > we can easily accumalates than additional calculation.
> > > > 
> > > > Using uapi.dst will cause additional and unnecessary area be
> > > > included
> > > > to the pipe damaged area, imagine that a plane have src.x1 = 50,
> > > > src.y1 = 100,
> > > > ... the plane invisible/cropped area don't need to be added to
> > > > the
> > > > pipe damaged area.
> > > > 
> > > easist way to get damaged area for crtc is just using uapi.dst
> > > but because fb damage clip follows uapi.src coordinates, we have to
> > > translate fb damage clip's coordinates to dst coordinates for
> > > accumulating crtc damage region.
> > > 
> > > therefore can you explain what is the exact burden of using
> > > uapi.dst
> > > for calculating crtc damage area?
> > > 
> > 
> > I hope this ASCI drawing do not break :P
> > 
> > > ----------------------|
> > >                      |
> > >   Pipe area          |
> > > ----------------|     |
> > > whole plane A  |     |
> > >     |----------|     |
> > >     |   src    |     |
> > >     | visible  |     |
> > ------------------------
> > 
> > Using dst would add the whole plane A area to the pipe damaged area
> > while using src will only add the visible area.
> > 
> 
> if you expect to be shown the src visible area to pipe area, 
> (that means the dst area has the same width and height, but the x1, y1
> will be based on crtc coordinates.)
> in the crte point of view, the src visible area is the dst area.
> (but because the src area use fb based coordinates, we should use dst)
> 
> and if you are expecting handling obscured area by other planes, (for
> optimizing)
> we should use dst too.
> 
> we only need to use src for handling fb damaged clip rects. 
> but after accumulating the fb damaged clip rects, it also has to be
> translated to crtc coordinates from fb (src ) coordinates.


That is being done, src are then translated to CRTC coordinates using dst but only using dst is not a optimized solution.


damaged_area.y1 = old_plane_state->uapi.src.y1 >> 16;
damaged_area.y1 = old_plane_state->uapi.src.y2 >> 16;
damaged_area.y1 += old_plane_state->uapi.dst.y1;
damaged_area.y2 += old_plane_state->uapi.dst.y1;
clip_area_update(&pipe_clip, &damaged_area);

num_clips = 0;
damaged_area.y1 = src.y1;
damaged_area.y2 = src.y2;
...

damaged_area.y1 += new_plane_state->uapi.dst.y1;
damaged_area.y2 += new_plane_state->uapi.dst.y1;
clip_area_update(&pipe_clip, &damaged_area);



> 
> > >  
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > > > > > 2. Move case
> > > > > > >  The pipe damaged area (The Selective Update region) needs
> > > > > > > to
> > > > > > > accumulate both old and new plane's dst
> > > > > > 
> > > > > > same
> > > > > > 
> > > > > > > if you are implementing this scenario, the code shoule be
> > > > > > > like
> > > > > > > this,
> > > > > > > 
> > > > > > > else if (!drm_rect_equals(&new_plane_state->uapi.dst,
> > > > > > > &old_plane_state-
> > > > > > > > uapi.dst)) {
> > > > > > >    damaged_area.y1 = new_plane_state->uapi.dst.y1;
> > > > > > >    damaged_area.y2 = new_plane_state->uapi.dst.y2;
> > > > > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > > > > 
> > > > > > >    damaged_area.y1 = old_plane_state->uapi.dst.y1;
> > > > > > >    damaged_area.y2 = old_plane_state->uapi.dst.y2;
> > > > > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > > > >    
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > >    continue;
> > > > > > > }
> > > > > > > > +		} else if (new_plane_state->uapi.alpha !=
> > > > > > > > old_plane_state->uapi.alpha) {
> > > > > > > > +			num_clips = 0;
> > > > > > > > +			damaged_area.y1 = src.y1;
> > > > > > > > +			damaged_area.y2 = src.y2;
> > > > > > > 3. alpha has changed ( because alpha handling section is
> > > > > > > not
> > > > > > > optimized,
> > > > > > > it can be treated with the move section)
> > > > > Yes, you are right, there was a misunderstanding of the alpha
> > > > > scenario
> > > > > of me.
> > > > > > no need to handle like this for alpha, if the plane moved if
> > > > > > will
> > > > > > be
> > > > > > handled in the "if" above with or without alpha change, if it
> > > > > > did
> > > > > > not
> > > > > > moved but
> > > > > > alpha change no need to add the old state coordinate to the
> > > > > > pipe
> > > > > > clip.
> > > > > > 
> > > > > > > else if (new_plane_state->uapi.alpha != old_plane_state-
> > > > > > > > uapi.alpha) {
> > > > > > >    damaged_area.y1 = new_plane_state->uapi.dst.y1;
> > > > > > >    damaged_area.y2 = new_plane_state->uapi.dst.y2;
> > > > > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > > > > 
> > > > > > >    damaged_area.y1 = old_plane_state->uapi.dst.y1;
> > > > > > >    damaged_area.y2 = old_plane_state->uapi.dst.y2;
> > > > > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > > > >    
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > >    continue;
> > > > > > > } 
> > > > > > > > +		} else if (!num_clips &&
> > > > > > > > +			   new_plane_state->uapi.fb !=
> > > > > > > > old_plane_state-
> > > > > > > > > uapi.fb) {
> > > > > > > > +			/*
> > > > > > > > +			 * If the plane don't have damage areas
> > > > > > > > but the
> > > > > > > > +			 * framebuffer changed, mark the whole
> > > > > > > > plane
> > > > > > > > area as
> > > > > > > > +			 * damaged.
> > > > > > > > +			 */
> > > > > > > > +			damaged_area.y1 = src.y1;
> > > > > > > > +			damaged_area.y2 = src.y2;
> > > > > > > > +		}
> > > > > > > > +
> > > > > > > else if (!num_clips && new_plane_state->uapi.fb !=
> > > > > > > old_plane_state-
> > > > > > > > uapi.fb) {
> > > > > > >    /*
> > > > > > >     * If the plane don't have damage areas but the
> > > > > > >     * framebuffer changed, mark the whole plane area as
> > > > > > >     * damaged.
> > > > > > >     */
> > > > > > >    damaged_area.y1 = new_plane_state->uapi.dst.y1;
> > > > > > >    damaged_area.y2 = new_plane_state->uapi.dst.y2;
> > > > > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > > > >    continue;
> > > > > > > }
> > > > > > > > +		for (j = 0; j < num_clips; j++) {
> > > > > > > > +			struct drm_rect clip;
> > > > > > > > +
> > > > > > > > +			clip.y1 = damaged_clips[j].y1;
> > > > > > > > +			clip.y2 = damaged_clips[j].y2;
> > > > > > > > +			clip_area_update(&damaged_area, &clip);
> > > > > > > > +		}
> > > > > > > > +
> > > > > > > > +		if (!drm_rect_intersect(&damaged_area, &src))
> > > > > > > > +			continue;
> > > > > > > > +
> > > > > > > > +		damaged_area.y1 += new_plane_state-
> > > > > > > > > uapi.dst.y1;
> > > > > > > > +		damaged_area.y2 += new_plane_state-
> > > > > > > > > uapi.dst.y1;
> > > > > > > > +		clip_area_update(&pipe_clip, &damaged_area);
> > > > > > > > +	}
> > > > > > > > +
> > > > > > > else if (num_clips) {
> > > > > > >    struct drm_rect plane_damaged_area;
> > > > > > >    plane_damaged_area.x1 = src.x1;
> > > > > > >    plane_damaged_area.x2 = src.x2;
> > > > > > >    plane_damaged_area.y1 = 0;
> > > > > > >    plane_damaged_area.y2 = 0;
> > > > > > > 	        
> > > > > > >    for (j = 0; j < num_clips; j++) {
> > > > > > >       struct drm_rect clip;
> > > > > > > 
> > > > > > >       clip.x1 = damaged_clips[j].x1;
> > > > > > >       clip.x2 = damaged_clips[j].x2;
> > > > > > >       clip.y1 = damaged_clips[j].y1;
> > > > > > >       clip.y2 = damaged_clips[j].y2;
> > > > > > > 
> > > > > > >       if (drm_rect_intersect(&clip, &src)) {
> > > > > > >          clip_area_update(&plane_damaged_area, &clip);
> > > > > > >       }
> > > > > > 
> > > > > > Call intersect at every clip? that don't look optimized.
> > > > > > 
> > > > > when the clip_area_update() is called it just accumulates the
> > > > > input
> > > > > rects to one output rect.
> > > > > it might lead to accumulating unneeded excessive update rect
> > > > > region
> > > > 
> > > > The excessive rect region will be removed once after sum all
> > > > clips in
> > > > the current approach.
> > > > 
> > > on the link's 2nd page,
> > > we only need a red Selective Fetch area, but your patch seems
> > > Selective
> > > Fetch area as green rect.
> > > https://docs.google.com/presentation/d/1gOKE4JnC97RzRg15ZM8IaQzHnifIxwvwP_UbOoGFE9E/edit?usp=sharing
> > 
> > Okay, now I got it.
> > Will update this but please take a look to the other answers so we do
> > only one more version.
> > 
> > 
> > > > > > >    }
> > > > > > > 
> > > > > > >   if (drm_rect_visible(plane_damaged_area)) {
> > > > > > >      plane_damaged_area.y1 = plane_damaged_area.y1 - src.y1
> > > > > > > +
> > > > > > > new_plane_state->uapi.dst.y1;
> > > > > > >      plane_damaged_area.y2 = plane_damaged_area.y2 - src.y1
> > > > > > > +
> > > > > > > new_plane_state->uapi.dst.y1;
> > > > > > > 
> > > > > > >      clip_area_update(&pipe_clip, &plane_damaged_area);
> > > > > > >      continue;
> > > > > > >   }
> > > > > > > }
> > > > > > 
> > > > > > Current code sum all the damage clips, if the sum of the
> > > > > > damage
> > > > > > clips
> > > > > > insect with the src area it is translated to pipe coordinates
> > > > > > and
> > > > > > called
> > > > > > clip_area_update() to update pipe_clip.
> > > > > > 
> > > > > > > the calculation and translating cooridinates is alreay
> > > > > > > implemented
> > > > > > > here
> > > > > > > ( 
> > > > > > > https://patchwork.freedesktop.org/patch/404264/?series=84340&rev=1
> > > > > > >   it has commetns which explains scenarios.) 
> > > > > > > > +	if (full_update)
> > > > > > > > +		goto skip_sel_fetch_set_loop;
> > > > > > > > +
> > > > > > > > +	/*
> > > > > > > > +	 * Now that we have the pipe damaged area check if it
> > > > > > > > intersect
> > > > > > > > with
> > > > > > > > +	 * every plane, if it does set the plane selective
> > > > > > > > fetch area.
> > > > > > > > +	 */
> > > > > > > > +	for_each_oldnew_intel_plane_in_state(state, plane,
> > > > > > > > old_plane_state,
> > > > > > > > +					     new_plane_state,
> > > > > > > > i) {
> > > > > > > > +		struct drm_rect *sel_fetch_area, inter, src;
> > > > > > > > +
> > > > > > > > +		if (new_plane_state->uapi.crtc != crtc_state-
> > > > > > > > > uapi.crtc 
> > > > > > > > +		    !new_plane_state->uapi.visible)
> > > > > > > > +			continue;
> > > > > > > > +
> > > > > > > > +		inter = pipe_clip;
> > > > > > > > +		if (!drm_rect_intersect(&inter,
> > > > > > > > &new_plane_state-
> > > > > > > > > uapi.dst))
> > > > > > > > +			continue;
> > > > > > > > +
> > > > > > > > +		drm_rect_convert_16_16_to_regular(&new_plane_st
> > > > > > > > ate-
> > > > > > > > > uapi.src, &src);
> > > > > > > > +
> > > > > > > >  		sel_fetch_area = &new_plane_state-
> > > > > > > > > psr2_sel_fetch_area;
> > > > > > > > -		sel_fetch_area->y1 = new_plane_state-
> > > > > > > > > uapi.src.y1 >>
> > > > > > > > 16;
> > > > > > > > -		sel_fetch_area->y2 = new_plane_state-
> > > > > > > > > uapi.src.y2 >>
> > > > > > > > 16;
> > > > > > > > +		sel_fetch_area->y1 = inter.y1 -
> > > > > > > > new_plane_state-
> > > > > > > > > uapi.dst.y1;
> > > > > > > > +		sel_fetch_area->y2 = inter.y2 -
> > > > > > > > new_plane_state-
> > > > > > > > > uapi.dst.y1;
> > > > > > > sel_fetch_area->y1 = inter.y1 - new_plane_state-
> > > > > > > > uapi.dst.y1 +
> > > > > > > src.y1;
> > > > > > > sel_fetch_area->y2 = inter.y2 - new_plane_state-
> > > > > > > > uapi.dst.y1 +
> > > > > > > src.y1;
> > > > > > 
> > > > > > sel_fetch_area->y1 = inter.y1 - new_plane_state->uapi.dst.y1; 
> > > > > > +
> > > > > > drm_rect_intersect(sel_fetch_area, &src);
> > > > > > does a the same job and is easier to understand(translation +
> > > > > > clip)
> > > > > > 
> > > > > when the src's x1 and y1 indicates over than 0, does it work?
> > > > 
> > > > It will, we use it for scenarios like that in this function.
> > > > 
> > > > 
> > > here is the problematic case,
> > > if we assume src indicates 50 x 50 +10 +10
> > > ,fb damage rect indicates 5 x 5 +55 +55 
> > > and dst indicates 50 x 50 +100 +100
> > > 
> > > 1) if whole plane src area needs to be updated
> > > inter: 50 x 50 +100 +100
> > > sel_fetch_area->y1 = 100 - 100 => 0
> > > sel_fetch_area->y2 = 100 - 100 => 0
> > > 
> > > 
> > > drm_rect_intersect(sel_fetch_area, &src);
> > >  => sel_fetch_area does not fit whole src area.
> > 
> > Your values are wrong.
> > 
> I used DRM_RECT_FMT style.
> 
> #define DRM_RECT_FMT    "%dx%d%+d%+d"
> #define DRM_RECT_ARG(r) drm_rect_width(r), drm_rect_height(r), (r)->x1, 
> (r)->y1 
> 
> > # 50 x 50 +10 +10
> > 
> > src.x1 = 50
> > src.y1 = 50
> > src.x2 = 60
> > src.y2 = 60
> > 
> src.x1 = 10
> src.y1 = 10
> src.x2 = 60
> src.y2 = 60

If plane dst has 50px of width and height the src above is not possible.
Adjusting it to:

src.x2 = 50
src.y2 = 50

src.x1 = 10
src.y1 = 10
src.x2 = 50
src.y2 = 50

damaged.x1 = 55
damaged.y1 = 55
damaged.x2 = 60
damaged.y2 = 60

dst.x1 = 100
dst.y1 = 100
dst.x2 = 150
dst.y2 = 150

1) if whole plane src are needs to be updated
pipe_clip.y1 = src.y1 + dst.y1 = 110
pipe_clip.y2 = src.y2 + dst.y1 = 150

# drm_rect_intersect(&inter, &new_plane_state->uapi.dst)
iter.y1 = 110
iter.y2 = 150

# sel_fetch_area->y1 = inter.y1 - new_plane_state->uapi.dst.y1;
sel_fetch_area.y1 = 110 - 100 = 10
sel_fetch_area.y2 = 150 - 100 = 50

drm_rect_intersect(sel_fetch_area, &src);
sel_fetch_area.y1 = 10
sel_fetch_area.y2 = 50

> 
> > # 5 x 5 +55 +55. * not used in example 1
> > damaged.x1 = 5
> > damaged.y1 = 5
> > damaged.x2 = 60
> > damaged.y2 = 60
> > 
> damaged.x1 = 55
> damaged.y1 = 55
> damaged.x2 = 60
> damaged.y2 = 60
> 
> > # 50 x 50 +100 +100
> > dst.x1 = 50
> > dst.y1 = 50
> > dst.x2 = 150
> > dst.y2 = 150
> > 
> dst.x1 = 100
> dst.y1 = 100
> dst.x2 = 150
> dst.y2 = 150
> 
> therefore below result seems to wrong result.
> 
> > ####
> > 
> > 1) if whole plane src are needs to be updated
> > pipe_clip.x1 = src.x1 + dst.x1 = 100
> > pipe_clip.y2 = src.y1 + dst.y1 = 100
> > pipe_clip.x2 = src.x2 + dst.y1 = 110
> > pipe_clip.y2 = src.y2 + dst.y2 = 110
> > 
> > # drm_rect_intersect(&inter, &new_plane_state->uapi.dst)
> > iter.x1 = 100
> > iter.y1 = 100
> > iter.x2 = 110
> > iter.y2 = 110
> > 
> > # sel_fetch_area->y1 = inter.y1 - new_plane_state->uapi.dst.y1;
> > sel_fetch_area.y1 = 100 - 50 = 50
> > sel_fetch_area.y2 = 110 - 50 = 60
> > 
> > drm_rect_intersect(sel_fetch_area, &src);
> > 
> > sel_fetch_area.y1 = 50
> > sel_fetch_area.y2 = 60
> > 
> > > 2) if only the plane fb damage needs to be updated
> > > translate fb damage's coordinates to crtc coordinates
> > > 5 x 5 +55 +55  => 5 x 5 +105 +105
> > > inter: 5 x 5 +105 +105
> > > sel_fetch_area->y1 = 105 - 100 => 5
> > > sel_fetch_area->y2 = 105 - 100 => 5
> > > 
> > > drm_rect_intersect(sel_fetch_area, &src);
> > >  => sel_fetch_area does not fit to src's damage area.
> > 
> > Let me know if this case is broken after use the right values.
> > 
> > > > > > > > +		sel_fetch_area->x1 = src.x1;
> > > > > > > > +		sel_fetch_area->x2 = src.x2;
> > > > > > > >  
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > -		temp = *sel_fetch_area;
> > > > > > > > -		temp.y1 += new_plane_state->uapi.dst.y1;
> > > > > > > > -		temp.y2 += new_plane_state->uapi.dst.y2;
> > > > > > > > -		clip_area_update(&pipe_clip, &temp);
> > > > > > > > +		drm_rect_intersect(sel_fetch_area, &src);
> > > > > > > why this line is needed?
> > > > > > 
> > > > > > explained above.
> > > > > > 
> > > > > > 
> > > > > > > >  	}
> > > > > > > >  
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > +skip_sel_fetch_set_loop:
> > > > > > > >  	psr2_man_trk_ctl_calc(crtc_state, &pipe_clip,
> > > > > > > > full_update);
> > > > > > > >  	return 0;
> > > > > > > >  }

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [Intel-gfx] [PATCH v6 2/5] drm/i915/display/psr: Use plane damage clips to calculate damaged area
  2020-12-17 13:34                 ` Souza, Jose
@ 2020-12-17 16:04                   ` Mun, Gwan-gyeong
  0 siblings, 0 replies; 28+ messages in thread
From: Mun, Gwan-gyeong @ 2020-12-17 16:04 UTC (permalink / raw)
  To: intel-gfx, Souza, Jose

On Thu, 2020-12-17 at 05:34 -0800, Souza, Jose wrote:
> On Thu, 2020-12-17 at 11:51 +0000, Mun, Gwan-gyeong wrote:
> > On Wed, 2020-12-16 at 06:40 -0800, Souza, Jose wrote:
> > > On Wed, 2020-12-16 at 14:10 +0000, Mun, Gwan-gyeong wrote:
> > > > On Wed, 2020-12-16 at 05:17 -0800, Souza, Jose wrote:
> > > > > On Wed, 2020-12-16 at 10:29 +0000, Mun, Gwan-gyeong wrote:
> > > > > > On Tue, 2020-12-15 at 05:14 -0800, Souza, Jose wrote:
> > > > > > > On Tue, 2020-12-15 at 13:02 +0000, Mun, Gwan-gyeong
> > > > > > > wrote:
> > > > > > > > On Mon, 2020-12-14 at 09:49 -0800, José Roberto de
> > > > > > > > Souza
> > > > > > > > wrote:
> > > > > > > > > Now using plane damage clips property to calcualte
> > > > > > > > > the
> > > > > > > > > damaged
> > > > > > > > > area.
> > > > > > > > > Selective fetch only supports one region to be
> > > > > > > > > fetched so
> > > > > > > > > software
> > > > > > > > > needs to calculate a bounding box around all damage
> > > > > > > > > clips.
> > > > > > > > > 
> > > > > > > > > Now that we are not complete fetching each plane,
> > > > > > > > > there
> > > > > > > > > is
> > > > > > > > > another
> > > > > > > > > loop needed as all the plane areas that intersect
> > > > > > > > > with
> > > > > > > > > the
> > > > > > > > > pipe
> > > > > > > > > damaged area needs to be fetched from memory so the
> > > > > > > > > complete
> > > > > > > > > blending
> > > > > > > > > of all planes can happen.
> > > > > > > > > 
> > > > > > > > Hi,
> > > > > > > > > v2:
> > > > > > > > > - do not shifthing new_plane_state->uapi.dst only src
> > > > > > > > > is
> > > > > > > > > in
> > > > > > > > > 16.16 
> > > > > > > > Typo on commit message. shifthing -> shifting
> > > > > > > > > format
> > > > > > > > > 
> > > > > > > > > v4:
> > > > > > > > > - setting plane selective fetch area using the whole
> > > > > > > > > pipe
> > > > > > > > > damage
> > > > > > > > > area
> > > > > > > > > - mark the whole plane area damaged if plane
> > > > > > > > > visibility
> > > > > > > > > or
> > > > > > > > > alpha
> > > > > > > > > changed
> > > > > > > > > 
> > > > > > > > > v5:
> > > > > > > > > - taking in consideration src.y1 in the damage
> > > > > > > > > coordinates
> > > > > > > > > - adding to the pipe damaged area planes that were
> > > > > > > > > visible
> > > > > > > > > but
> > > > > > > > > are
> > > > > > > > > invisible in the new state
> > > > > > > > > 
> > > > > > > > > v6:
> > > > > > > > > - consider old state plane coordinates when
> > > > > > > > > visibility
> > > > > > > > > changes or
> > > > > > > > > it
> > > > > > > > > moved to calculate damaged area
> > > > > > > > > - remove from damaged area the portion not in src
> > > > > > > > > clip
> > > > > > > > > 
> > > > > > > > > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > > > > > > Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> > > > > > > > > Signed-off-by: José Roberto de Souza <
> > > > > > > > > jose.souza@intel.com>
> > > > > > > > > ---
> > > > > > > > >  drivers/gpu/drm/i915/display/intel_psr.c | 98
> > > > > > > > > +++++++++++++++++++++-
> > > > > > > > > --
> > > > > > > > >  1 file changed, 86 insertions(+), 12 deletions(-)
> > > > > > > > > 
> > > > > > > > > diff --git a/drivers/gpu/drm/i915/display/intel_psr.c
> > > > > > > > > b/drivers/gpu/drm/i915/display/intel_psr.c
> > > > > > > > > index d9a395c486d3..7daed098fa74 100644
> > > > > > > > > --- a/drivers/gpu/drm/i915/display/intel_psr.c
> > > > > > > > > +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> > > > > > > > > @@ -1269,8 +1269,8 @@ int
> > > > > > > > > intel_psr2_sel_fetch_update(struct
> > > > > > > > > intel_atomic_state *state,
> > > > > > > > >  				struct intel_crtc
> > > > > > > > > *crtc)
> > > > > > > > >  {
> > > > > > > > >  	struct intel_crtc_state *crtc_state =
> > > > > > > > > intel_atomic_get_new_crtc_state(state, crtc);
> > > > > > > > > +	struct drm_rect pipe_clip = { .x1 = 0, .y1 =
> > > > > > > > > -1, .x2 =
> > > > > > > > > INT_MAX,
> > > > > > > > > .y2 = -1 };
> > > > > > > > >  	struct intel_plane_state *new_plane_state,
> > > > > > > > > *old_plane_state;
> > > > > > > > > -	struct drm_rect pipe_clip = { .y1 = -1 };
> > > > > > > > >  	struct intel_plane *plane;
> > > > > > > > >  	bool full_update = false;
> > > > > > > > >  	int i, ret;
> > > > > > > > > @@ -1282,9 +1282,17 @@ int
> > > > > > > > > intel_psr2_sel_fetch_update(struct
> > > > > > > > > intel_atomic_state *state,
> > > > > > > > >  	if (ret)
> > > > > > > > >  		return ret;
> > > > > > > > >  
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > +	/*
> > > > > > > > > +	 * Calculate minimal selective fetch area of
> > > > > > > > > each plane
> > > > > > > > > and
> > > > > > > > > calculate
> > > > > > > > > +	 * the pipe damaged area.
> > > > > > > > > +	 * In the next loop the plane selective fetch
> > > > > > > > > area will
> > > > > > > > > actually be set
> > > > > > > > > +	 * using whole pipe damaged area.
> > > > > > > > > +	 */
> > > > > > > > >  	for_each_oldnew_intel_plane_in_state(state,
> > > > > > > > > plane,
> > > > > > > > > old_plane_state,
> > > > > > > > >  					     new_plane_
> > > > > > > > > state,
> > > > > > > > > i) {
> > > > > > > > > -		struct drm_rect *sel_fetch_area, temp;
> > > > > > > > > +		struct drm_rect src, damaged_area = {
> > > > > > > > > .x1 = 0,
> > > > > > > > > .y1 =
> > > > > > > > > -1, .x2 = INT_MAX, .y2 = -1 };
> > > > > > > > > +		struct drm_mode_rect *damaged_clips;
> > > > > > > > > +		u32 num_clips, j;
> > > > > > > > >  
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > >  		if (new_plane_state->uapi.crtc !=
> > > > > > > > > crtc_state-
> > > > > > > > > > uapi.crtc)
> > > > > > > > >  			continue;
> > > > > > > > > @@ -1300,23 +1308,89 @@ int
> > > > > > > > > intel_psr2_sel_fetch_update(struct
> > > > > > > > > intel_atomic_state *state,
> > > > > > > > >  			break;
> > > > > > > > >  		}
> > > > > > > > >  
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > -		if (!new_plane_state->uapi.visible)
> > > > > > > > > -			continue;
> > > > > > > > > +		drm_rect_convert_16_16_to_regular(&new_
> > > > > > > > > plane_st
> > > > > > > > > ate-
> > > > > > > > > > uapi.src, &src);
> > > > > > > > > +		damaged_clips =
> > > > > > > > > drm_plane_get_damage_clips(&new_plane_state->uapi);
> > > > > > > > > +		num_clips =
> > > > > > > > > drm_plane_get_damage_clips_count(&new_plane_state-
> > > > > > > > > >uapi);
> > > > > > > > >  
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > >  		/*
> > > > > > > > > -		 * For now doing a selective fetch in
> > > > > > > > > the whole
> > > > > > > > > plane
> > > > > > > > > area,
> > > > > > > > > -		 * optimizations will come in the
> > > > > > > > > future.
> > > > > > > > > +		 * If visibility or plane moved, mark
> > > > > > > > > the whole
> > > > > > > > > plane
> > > > > > > > > area as
> > > > > > > > > +		 * damaged as it needs to be complete
> > > > > > > > > redraw in
> > > > > > > > > the new
> > > > > > > > > and old
> > > > > > > > > +		 * position.
> > > > > > > > >  		 */
> > > > > > > > > +		if (new_plane_state->uapi.visible !=
> > > > > > > > > old_plane_state-
> > > > > > > > > > uapi.visible ||
> > > > > > > > > +		    !drm_rect_equals(&new_plane_state-
> > > > > > > > > > uapi.dst,
> > > > > > > > > +				     &old_plane_state-
> > > > > > > > > > uapi.dst)) {
> > > > > > > > > +			damaged_area.y1 =
> > > > > > > > > old_plane_state-
> > > > > > > > > > uapi.src.y1
> > > > > > > > > > > 16;
> > > > > > > > > +			damaged_area.y1 =
> > > > > > > > > old_plane_state-
> > > > > > > > > > uapi.src.y2
> > > > > > > > > > > 16;
> > > > > > > > > +			damaged_area.y1 +=
> > > > > > > > > old_plane_state-
> > > > > > > > > > uapi.dst.y1;
> > > > > > > > > +			damaged_area.y2 +=
> > > > > > > > > old_plane_state-
> > > > > > > > > > uapi.dst.y1;
> > > > > > > > > +			clip_area_update(&pipe_clip,
> > > > > > > > > &damaged_area);
> > > > > > > > > +
> > > > > > > > > +			num_clips = 0;
> > > > > > > > > +			damaged_area.y1 = src.y1;
> > > > > > > > > +			damaged_area.y2 = src.y2;
> > > > > > > > 1. Visibility change case
> > > > > > > >  The pipe damaged area (The Selective Update region)
> > > > > > > > needs
> > > > > > > > to
> > > > > > > > accumulate being visible plane's dst between old and
> > > > > > > > new
> > > > > > > > plane's
> > > > > > > > dst.
> > > > > > > > 
> > > > > > > > if you are implementing this scenario, the code shoule
> > > > > > > > be
> > > > > > > > like
> > > > > > > > this,
> > > > > > > > 
> > > > > > > > if (new_plane_state->uapi.visible != old_plane_state-
> > > > > > > > > uapi.visible) 
> > > > > > > > {
> > > > > > > >    if (new_plane_state->uapi.visible) {
> > > > > > > >       damaged_area.y1 = new_plane_state->uapi.dst.y1;
> > > > > > > >       damaged_area.y2 = new_plane_state->uapi.dst.y2;
> > > > > > > >    } else {
> > > > > > > >       damaged_area.y1 = old_plane_state->uapi.dst.y1;
> > > > > > > >       damaged_area.y2 = old_plane_state->uapi.dst.y2;
> > > > > > > >    }
> > > > > > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > > > > >    continue;
> > > > > > > > }
> > > > > > > 
> > > > > > > The current code does exactly above but discards the
> > > > > > > clipped
> > > > > > > in
> > > > > > > uapi.src.
> > > > > > > 
> > > > > > in order to accumlate the pipe damage area, we don't need
> > > > > > to
> > > > > > use
> > > > > > and
> > > > > > calculate src coordinates on move and visibility change
> > > > > > scenarios.
> > > > > > we can easily accumalates than additional calculation.
> > > > > 
> > > > > Using uapi.dst will cause additional and unnecessary area be
> > > > > included
> > > > > to the pipe damaged area, imagine that a plane have src.x1 =
> > > > > 50,
> > > > > src.y1 = 100,
> > > > > ... the plane invisible/cropped area don't need to be added
> > > > > to
> > > > > the
> > > > > pipe damaged area.
> > > > > 
> > > > easist way to get damaged area for crtc is just using uapi.dst
> > > > but because fb damage clip follows uapi.src coordinates, we
> > > > have to
> > > > translate fb damage clip's coordinates to dst coordinates for
> > > > accumulating crtc damage region.
> > > > 
> > > > therefore can you explain what is the exact burden of using
> > > > uapi.dst
> > > > for calculating crtc damage area?
> > > > 
> > > 
> > > I hope this ASCI drawing do not break :P
> > > 
> > > > ----------------------|
> > > >                      |
> > > >   Pipe area          |
> > > > ----------------|     |
> > > > whole plane A  |     |
> > > >     |----------|     |
> > > >     |   src    |     |
> > > >     | visible  |     |
> > > ------------------------
> > > 
> > > Using dst would add the whole plane A area to the pipe damaged
> > > area
> > > while using src will only add the visible area.
> > > 
> > 
> > if you expect to be shown the src visible area to pipe area, 
> > (that means the dst area has the same width and height, but the x1,
> > y1
> > will be based on crtc coordinates.)
> > in the crte point of view, the src visible area is the dst area.
> > (but because the src area use fb based coordinates, we should use
> > dst)
> > 
> > and if you are expecting handling obscured area by other planes,
> > (for
> > optimizing)
> > we should use dst too.
> > 
> > we only need to use src for handling fb damaged clip rects. 
> > but after accumulating the fb damaged clip rects, it also has to be
> > translated to crtc coordinates from fb (src ) coordinates.
> 
> That is being done, src are then translated to CRTC coordinates using
> dst but only using dst is not a optimized solution.
> 
> 
> damaged_area.y1 = old_plane_state->uapi.src.y1 >> 16;
> damaged_area.y1 = old_plane_state->uapi.src.y2 >> 16;
why do you save it to damaged_area.y1 twice?

> damaged_area.y1 += old_plane_state->uapi.dst.y1;
> damaged_area.y2 += old_plane_state->uapi.dst.y1;

and if we just want to accumulate pipe_clip for the move or visibility.
we should just use dst. (if src.y1 is over 0, your result leads to
wrong geometry.)

> clip_area_update(&pipe_clip, &damaged_area);
> 
> num_clips = 0;
> damaged_area.y1 = src.y1;
> damaged_area.y2 = src.y2;
> ...
> 
> damaged_area.y1 += new_plane_state->uapi.dst.y1;
> damaged_area.y2 += new_plane_state->uapi.dst.y1;
> clip_area_update(&pipe_clip, &damaged_area);
> 
> 
> 
> > > >  
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > > > > > 2. Move case
> > > > > > > >  The pipe damaged area (The Selective Update region)
> > > > > > > > needs
> > > > > > > > to
> > > > > > > > accumulate both old and new plane's dst
> > > > > > > 
> > > > > > > same
> > > > > > > 
> > > > > > > > if you are implementing this scenario, the code shoule
> > > > > > > > be
> > > > > > > > like
> > > > > > > > this,
> > > > > > > > 
> > > > > > > > else if (!drm_rect_equals(&new_plane_state->uapi.dst,
> > > > > > > > &old_plane_state-
> > > > > > > > > uapi.dst)) {
> > > > > > > >    damaged_area.y1 = new_plane_state->uapi.dst.y1;
> > > > > > > >    damaged_area.y2 = new_plane_state->uapi.dst.y2;
> > > > > > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > > > > > 
> > > > > > > >    damaged_area.y1 = old_plane_state->uapi.dst.y1;
> > > > > > > >    damaged_area.y2 = old_plane_state->uapi.dst.y2;
> > > > > > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > > > > >    
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > >    continue;
> > > > > > > > }
> > > > > > > > > +		} else if (new_plane_state->uapi.alpha
> > > > > > > > > !=
> > > > > > > > > old_plane_state->uapi.alpha) {
> > > > > > > > > +			num_clips = 0;
> > > > > > > > > +			damaged_area.y1 = src.y1;
> > > > > > > > > +			damaged_area.y2 = src.y2;
> > > > > > > > 3. alpha has changed ( because alpha handling section
> > > > > > > > is
> > > > > > > > not
> > > > > > > > optimized,
> > > > > > > > it can be treated with the move section)
> > > > > > Yes, you are right, there was a misunderstanding of the
> > > > > > alpha
> > > > > > scenario
> > > > > > of me.
> > > > > > > no need to handle like this for alpha, if the plane moved
> > > > > > > if
> > > > > > > will
> > > > > > > be
> > > > > > > handled in the "if" above with or without alpha change,
> > > > > > > if it
> > > > > > > did
> > > > > > > not
> > > > > > > moved but
> > > > > > > alpha change no need to add the old state coordinate to
> > > > > > > the
> > > > > > > pipe
> > > > > > > clip.
> > > > > > > 
> > > > > > > > else if (new_plane_state->uapi.alpha !=
> > > > > > > > old_plane_state-
> > > > > > > > > uapi.alpha) {
> > > > > > > >    damaged_area.y1 = new_plane_state->uapi.dst.y1;
> > > > > > > >    damaged_area.y2 = new_plane_state->uapi.dst.y2;
> > > > > > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > > > > > 
> > > > > > > >    damaged_area.y1 = old_plane_state->uapi.dst.y1;
> > > > > > > >    damaged_area.y2 = old_plane_state->uapi.dst.y2;
> > > > > > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > > > > >    
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > >    continue;
> > > > > > > > } 
> > > > > > > > > +		} else if (!num_clips &&
> > > > > > > > > +			   new_plane_state->uapi.fb !=
> > > > > > > > > old_plane_state-
> > > > > > > > > > uapi.fb) {
> > > > > > > > > +			/*
> > > > > > > > > +			 * If the plane don't have
> > > > > > > > > damage areas
> > > > > > > > > but the
> > > > > > > > > +			 * framebuffer changed, mark
> > > > > > > > > the whole
> > > > > > > > > plane
> > > > > > > > > area as
> > > > > > > > > +			 * damaged.
> > > > > > > > > +			 */
> > > > > > > > > +			damaged_area.y1 = src.y1;
> > > > > > > > > +			damaged_area.y2 = src.y2;
> > > > > > > > > +		}
> > > > > > > > > +
> > > > > > > > else if (!num_clips && new_plane_state->uapi.fb !=
> > > > > > > > old_plane_state-
> > > > > > > > > uapi.fb) {
> > > > > > > >    /*
> > > > > > > >     * If the plane don't have damage areas but the
> > > > > > > >     * framebuffer changed, mark the whole plane area as
> > > > > > > >     * damaged.
> > > > > > > >     */
> > > > > > > >    damaged_area.y1 = new_plane_state->uapi.dst.y1;
> > > > > > > >    damaged_area.y2 = new_plane_state->uapi.dst.y2;
> > > > > > > >    clip_area_update(&pipe_clip, &damaged_area);
> > > > > > > >    continue;
> > > > > > > > }
> > > > > > > > > +		for (j = 0; j < num_clips; j++) {
> > > > > > > > > +			struct drm_rect clip;
> > > > > > > > > +
> > > > > > > > > +			clip.y1 = damaged_clips[j].y1;
> > > > > > > > > +			clip.y2 = damaged_clips[j].y2;
> > > > > > > > > +			clip_area_update(&damaged_area,
> > > > > > > > > &clip);
> > > > > > > > > +		}
> > > > > > > > > +
> > > > > > > > > +		if (!drm_rect_intersect(&damaged_area,
> > > > > > > > > &src))
> > > > > > > > > +			continue;
> > > > > > > > > +
> > > > > > > > > +		damaged_area.y1 += new_plane_state-
> > > > > > > > > > uapi.dst.y1;
> > > > > > > > > +		damaged_area.y2 += new_plane_state-
> > > > > > > > > > uapi.dst.y1;
> > > > > > > > > +		clip_area_update(&pipe_clip,
> > > > > > > > > &damaged_area);
> > > > > > > > > +	}
> > > > > > > > > +
> > > > > > > > else if (num_clips) {
> > > > > > > >    struct drm_rect plane_damaged_area;
> > > > > > > >    plane_damaged_area.x1 = src.x1;
> > > > > > > >    plane_damaged_area.x2 = src.x2;
> > > > > > > >    plane_damaged_area.y1 = 0;
> > > > > > > >    plane_damaged_area.y2 = 0;
> > > > > > > > 	        
> > > > > > > >    for (j = 0; j < num_clips; j++) {
> > > > > > > >       struct drm_rect clip;
> > > > > > > > 
> > > > > > > >       clip.x1 = damaged_clips[j].x1;
> > > > > > > >       clip.x2 = damaged_clips[j].x2;
> > > > > > > >       clip.y1 = damaged_clips[j].y1;
> > > > > > > >       clip.y2 = damaged_clips[j].y2;
> > > > > > > > 
> > > > > > > >       if (drm_rect_intersect(&clip, &src)) {
> > > > > > > >          clip_area_update(&plane_damaged_area, &clip);
> > > > > > > >       }
> > > > > > > 
> > > > > > > Call intersect at every clip? that don't look optimized.
> > > > > > > 
> > > > > > when the clip_area_update() is called it just accumulates
> > > > > > the
> > > > > > input
> > > > > > rects to one output rect.
> > > > > > it might lead to accumulating unneeded excessive update
> > > > > > rect
> > > > > > region
> > > > > 
> > > > > The excessive rect region will be removed once after sum all
> > > > > clips in
> > > > > the current approach.
> > > > > 
> > > > on the link's 2nd page,
> > > > we only need a red Selective Fetch area, but your patch seems
> > > > Selective
> > > > Fetch area as green rect.
> > > > https://docs.google.com/presentation/d/1gOKE4JnC97RzRg15ZM8IaQzHnifIxwvwP_UbOoGFE9E/edit?usp=sharing
> > > 
> > > Okay, now I got it.
> > > Will update this but please take a look to the other answers so
> > > we do
> > > only one more version.
> > > 
> > > 
> > > > > > > >    }
> > > > > > > > 
> > > > > > > >   if (drm_rect_visible(plane_damaged_area)) {
> > > > > > > >      plane_damaged_area.y1 = plane_damaged_area.y1 -
> > > > > > > > src.y1
> > > > > > > > +
> > > > > > > > new_plane_state->uapi.dst.y1;
> > > > > > > >      plane_damaged_area.y2 = plane_damaged_area.y2 -
> > > > > > > > src.y1
> > > > > > > > +
> > > > > > > > new_plane_state->uapi.dst.y1;
> > > > > > > > 
> > > > > > > >      clip_area_update(&pipe_clip, &plane_damaged_area);
> > > > > > > >      continue;
> > > > > > > >   }
> > > > > > > > }
> > > > > > > 
> > > > > > > Current code sum all the damage clips, if the sum of the
> > > > > > > damage
> > > > > > > clips
> > > > > > > insect with the src area it is translated to pipe
> > > > > > > coordinates
> > > > > > > and
> > > > > > > called
> > > > > > > clip_area_update() to update pipe_clip.
> > > > > > > 
> > > > > > > > the calculation and translating cooridinates is alreay
> > > > > > > > implemented
> > > > > > > > here
> > > > > > > > ( 
> > > > > > > > https://patchwork.freedesktop.org/patch/404264/?series=84340&rev=1
> > > > > > > >   it has commetns which explains scenarios.) 
> > > > > > > > > +	if (full_update)
> > > > > > > > > +		goto skip_sel_fetch_set_loop;
> > > > > > > > > +
> > > > > > > > > +	/*
> > > > > > > > > +	 * Now that we have the pipe damaged area check
> > > > > > > > > if it
> > > > > > > > > intersect
> > > > > > > > > with
> > > > > > > > > +	 * every plane, if it does set the plane
> > > > > > > > > selective
> > > > > > > > > fetch area.
> > > > > > > > > +	 */
> > > > > > > > > +	for_each_oldnew_intel_plane_in_state(state,
> > > > > > > > > plane,
> > > > > > > > > old_plane_state,
> > > > > > > > > +					     new_plane_
> > > > > > > > > state,
> > > > > > > > > i) {
> > > > > > > > > +		struct drm_rect *sel_fetch_area, inter,
> > > > > > > > > src;
> > > > > > > > > +
> > > > > > > > > +		if (new_plane_state->uapi.crtc !=
> > > > > > > > > crtc_state-
> > > > > > > > > > uapi.crtc 
> > > > > > > > > +		    !new_plane_state->uapi.visible)
> > > > > > > > > +			continue;
> > > > > > > > > +
> > > > > > > > > +		inter = pipe_clip;
> > > > > > > > > +		if (!drm_rect_intersect(&inter,
> > > > > > > > > &new_plane_state-
> > > > > > > > > > uapi.dst))
> > > > > > > > > +			continue;
> > > > > > > > > +
> > > > > > > > > +		drm_rect_convert_16_16_to_regular(&new_
> > > > > > > > > plane_st
> > > > > > > > > ate-
> > > > > > > > > > uapi.src, &src);
> > > > > > > > > +
> > > > > > > > >  		sel_fetch_area = &new_plane_state-
> > > > > > > > > > psr2_sel_fetch_area;
> > > > > > > > > -		sel_fetch_area->y1 = new_plane_state-
> > > > > > > > > > uapi.src.y1 >>
> > > > > > > > > 16;
> > > > > > > > > -		sel_fetch_area->y2 = new_plane_state-
> > > > > > > > > > uapi.src.y2 >>
> > > > > > > > > 16;
> > > > > > > > > +		sel_fetch_area->y1 = inter.y1 -
> > > > > > > > > new_plane_state-
> > > > > > > > > > uapi.dst.y1;
> > > > > > > > > +		sel_fetch_area->y2 = inter.y2 -
> > > > > > > > > new_plane_state-
> > > > > > > > > > uapi.dst.y1;
> > > > > > > > sel_fetch_area->y1 = inter.y1 - new_plane_state-
> > > > > > > > > uapi.dst.y1 +
> > > > > > > > src.y1;
> > > > > > > > sel_fetch_area->y2 = inter.y2 - new_plane_state-
> > > > > > > > > uapi.dst.y1 +
> > > > > > > > src.y1;
> > > > > > > 
> > > > > > > sel_fetch_area->y1 = inter.y1 - new_plane_state-
> > > > > > > >uapi.dst.y1; 
> > > > > > > +
> > > > > > > drm_rect_intersect(sel_fetch_area, &src);
> > > > > > > does a the same job and is easier to
> > > > > > > understand(translation +
> > > > > > > clip)
> > > > > > > 
> > > > > > when the src's x1 and y1 indicates over than 0, does it
> > > > > > work?
> > > > > 
> > > > > It will, we use it for scenarios like that in this function.
> > > > > 
> > > > > 
> > > > here is the problematic case,
> > > > if we assume src indicates 50 x 50 +10 +10
> > > > ,fb damage rect indicates 5 x 5 +55 +55 
> > > > and dst indicates 50 x 50 +100 +100
> > > > 
> > > > 1) if whole plane src area needs to be updated
> > > > inter: 50 x 50 +100 +100
> > > > sel_fetch_area->y1 = 100 - 100 => 0
> > > > sel_fetch_area->y2 = 100 - 100 => 0
> > > > 
> > > > 
> > > > drm_rect_intersect(sel_fetch_area, &src);
> > > >  => sel_fetch_area does not fit whole src area.
> > > 
> > > Your values are wrong.
> > > 
> > I used DRM_RECT_FMT style.
> > 
> > #define DRM_RECT_FMT    "%dx%d%+d%+d"
> > #define DRM_RECT_ARG(r) drm_rect_width(r), drm_rect_height(r), (r)-
> > >x1, 
> > (r)->y1 
> > 
> > > # 50 x 50 +10 +10
> > > 
> > > src.x1 = 50
> > > src.y1 = 50
> > > src.x2 = 60
> > > src.y2 = 60
> > > 
> > src.x1 = 10
> > src.y1 = 10
> > src.x2 = 60
> > src.y2 = 60
> 
> If plane dst has 50px of width and height the src above is not
> possible.
if src width and height has 50x50, the dst can have 50 x 50 too.
> Adjusting it to:
> 
> src.x2 = 50
> src.y2 = 50
> 
> src.x1 = 10
> src.y1 = 10
> src.x2 = 50
src.x2 = 60
> src.y2 = 50
src.y2 = 60
> 
> damaged.x1 = 55
> damaged.y1 = 55
> damaged.x2 = 60
> damaged.y2 = 60
> 
> dst.x1 = 100
> dst.y1 = 100
> dst.x2 = 150
> dst.y2 = 150
> 
> 1) if whole plane src are needs to be updated
> pipe_clip.y1 = src.y1 + dst.y1 = 110
> pipe_clip.y2 = src.y2 + dst.y1 = 150
pipe_clip.y2 = src.y2 + dst.y1 = 160
> 
> # drm_rect_intersect(&inter, &new_plane_state->uapi.dst)
> iter.y1 = 110
> iter.y2 = 150
> 
inter = pipe_clip;
pipe_clip.x1 = 0
pipe_clip.y1 = 110
=> in the crtc point of view, the pipe_clip.y1 shoule be 100.
but the middle of value is wrong.

pipe_clip.x2 = INT_MAX
pipe_clip.y2 = 160
=> in the crtc point of view, the pipe_clip.y1 shoule be 150.
but the
middle of value is wrong.

dst.x1 = 100
dst.y1 = 100
dst.x2 = 150
dst.y2 = 150


drm_rect_intersect(&inter, &new_plane_state->uapi.dst)
=>
iter.x1 = 100
iter.y1 = 110
iter.x2 = 150
iter.y2 = 150

because we only add one dst, 
the inter should be same to dst.
but the result of iter does not have same geometry to dst.

wrong pipe_clip region leads wrong SelectiveUpdate region.

> # sel_fetch_area->y1 = inter.y1 - new_plane_state->uapi.dst.y1;
> sel_fetch_area.y1 = 110 - 100 = 10
> sel_fetch_area.y2 = 150 - 100 = 50
> drm_rect_intersect(sel_fetch_area, &src);
> sel_fetch_area.y1 = 10
> sel_fetch_area.y2 = 50
> 
> > > # 5 x 5 +55 +55. * not used in example 1
> > > damaged.x1 = 5
> > > damaged.y1 = 5
> > > damaged.x2 = 60
> > > damaged.y2 = 60
> > > 
> > damaged.x1 = 55
> > damaged.y1 = 55
> > damaged.x2 = 60
> > damaged.y2 = 60
> > 
> > > # 50 x 50 +100 +100
> > > dst.x1 = 50
> > > dst.y1 = 50
> > > dst.x2 = 150
> > > dst.y2 = 150
> > > 
> > dst.x1 = 100
> > dst.y1 = 100
> > dst.x2 = 150
> > dst.y2 = 150
> > 
> > therefore below result seems to wrong result.
> > 
> > > ####
> > > 
> > > 1) if whole plane src are needs to be updated
> > > pipe_clip.x1 = src.x1 + dst.x1 = 100
> > > pipe_clip.y2 = src.y1 + dst.y1 = 100
> > > pipe_clip.x2 = src.x2 + dst.y1 = 110
> > > pipe_clip.y2 = src.y2 + dst.y2 = 110
> > > 
> > > # drm_rect_intersect(&inter, &new_plane_state->uapi.dst)
> > > iter.x1 = 100
> > > iter.y1 = 100
> > > iter.x2 = 110
> > > iter.y2 = 110
> > > 
> > > # sel_fetch_area->y1 = inter.y1 - new_plane_state->uapi.dst.y1;
> > > sel_fetch_area.y1 = 100 - 50 = 50
> > > sel_fetch_area.y2 = 110 - 50 = 60
> > > 
> > > drm_rect_intersect(sel_fetch_area, &src);
> > > 
> > > sel_fetch_area.y1 = 50
> > > sel_fetch_area.y2 = 60
> > > 
> > > > 2) if only the plane fb damage needs to be updated
> > > > translate fb damage's coordinates to crtc coordinates
> > > > 5 x 5 +55 +55  => 5 x 5 +105 +105
> > > > inter: 5 x 5 +105 +105
> > > > sel_fetch_area->y1 = 105 - 100 => 5
> > > > sel_fetch_area->y2 = 105 - 100 => 5
> > > > 

> > > > drm_rect_intersect(sel_fetch_area, &src);
> > > >  => sel_fetch_area does not fit to src's damage area.
> > > 
> > > Let me know if this case is broken after use the right values.
> > > 
> > > > > > > > > +		sel_fetch_area->x1 = src.x1;
> > > > > > > > > +		sel_fetch_area->x2 = src.x2;
> > > > > > > > >  
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > -		temp = *sel_fetch_area;
> > > > > > > > > -		temp.y1 += new_plane_state-
> > > > > > > > > >uapi.dst.y1;
> > > > > > > > > -		temp.y2 += new_plane_state-
> > > > > > > > > >uapi.dst.y2;
> > > > > > > > > -		clip_area_update(&pipe_clip, &temp);
> > > > > > > > > +		drm_rect_intersect(sel_fetch_area,
> > > > > > > > > &src);
> > > > > > > > why this line is needed?
> > > > > > > 
> > > > > > > explained above.
> > > > > > > 
> > > > > > > 
> > > > > > > > >  	}
> > > > > > > > >  
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > +skip_sel_fetch_set_loop:
> > > > > > > > >  	psr2_man_trk_ctl_calc(crtc_state, &pipe_clip,
> > > > > > > > > full_update);
> > > > > > > > >  	return 0;
> > > > > > > > >  }
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2020-12-17 16:05 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-14 17:49 [PATCH v6 1/5] drm: Add function to convert rect in 16.16 fixed format to regular format José Roberto de Souza
2020-12-14 17:49 ` [Intel-gfx] " José Roberto de Souza
2020-12-14 17:49 ` [Intel-gfx] [PATCH v6 2/5] drm/i915/display/psr: Use plane damage clips to calculate damaged area José Roberto de Souza
2020-12-15 13:02   ` Mun, Gwan-gyeong
2020-12-15 13:14     ` Souza, Jose
2020-12-16 10:29       ` Mun, Gwan-gyeong
2020-12-16 13:17         ` Souza, Jose
2020-12-16 14:10           ` Mun, Gwan-gyeong
2020-12-16 14:40             ` Souza, Jose
2020-12-17 11:51               ` Mun, Gwan-gyeong
2020-12-17 13:34                 ` Souza, Jose
2020-12-17 16:04                   ` Mun, Gwan-gyeong
2020-12-14 17:49 ` [Intel-gfx] [PATCH v6 3/5] drm/i915/display: Split and export main surface calculation from skl_check_main_surface() José Roberto de Souza
2020-12-14 17:49 ` [Intel-gfx] [PATCH v6 4/5] drm/i915/display/psr: Program plane's calculated offset to plane SF register José Roberto de Souza
2020-12-14 17:49 ` [Intel-gfx] [PATCH v6 5/5] HAX/DO_NOT_MERGE_IT: drm/i915/display: Enable PSR2 selective fetch for testing José Roberto de Souza
2020-12-14 18:39 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [v6,1/5] drm: Add function to convert rect in 16.16 fixed format to regular format Patchwork
2020-12-14 18:42 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2020-12-14 19:07 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2020-12-15 12:52 ` [PATCH v6 1/5] " Mun, Gwan-gyeong
2020-12-15 12:52   ` [Intel-gfx] " Mun, Gwan-gyeong
2020-12-15 13:25   ` Souza, Jose
2020-12-15 13:25     ` [Intel-gfx] " Souza, Jose
2020-12-15 14:44 ` Ville Syrjälä
2020-12-15 14:44   ` [Intel-gfx] " Ville Syrjälä
2020-12-15 15:43   ` Souza, Jose
2020-12-15 15:43     ` [Intel-gfx] " Souza, Jose
2020-12-15 15:50     ` Ville Syrjälä
2020-12-15 15:50       ` [Intel-gfx] " Ville Syrjälä

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.