Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/i915/display: add a gelper to relative data rate handling

Add a helper to the relative data rate handling in skl_watermarks.c
where other similar functions are implemented. Also get rid of
use_min_ddb() and use use_minimal_wm0() instead to decide whether
the relative data rate can be returned as 0

v2: re-phrase the commit description (uma)

Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241121112726.510220-3-vinod.govindapillai@intel.com

+26 -21
+6 -21
drivers/gpu/drm/i915/display/intel_atomic_plane.c
··· 207 207 fb->format->cpp[color_plane]; 208 208 } 209 209 210 - static bool 211 - use_min_ddb(const struct intel_crtc_state *crtc_state, 212 - struct intel_plane *plane) 213 - { 214 - struct drm_i915_private *i915 = to_i915(plane->base.dev); 215 - 216 - return DISPLAY_VER(i915) >= 13 && 217 - crtc_state->uapi.async_flip && 218 - plane->async_flip; 219 - } 220 - 221 210 static unsigned int 222 211 intel_plane_relative_data_rate(const struct intel_crtc_state *crtc_state, 223 212 const struct intel_plane_state *plane_state, ··· 214 225 { 215 226 struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); 216 227 const struct drm_framebuffer *fb = plane_state->hw.fb; 217 - int width, height; 218 228 unsigned int rel_data_rate; 229 + int width, height; 219 230 220 231 if (plane->id == PLANE_CURSOR) 221 232 return 0; 222 233 223 234 if (!plane_state->uapi.visible) 224 - return 0; 225 - 226 - /* 227 - * We calculate extra ddb based on ratio plane rate/total data rate 228 - * in case, in some cases we should not allocate extra ddb for the plane, 229 - * so do not count its data rate, if this is the case. 230 - */ 231 - if (use_min_ddb(crtc_state, plane)) 232 235 return 0; 233 236 234 237 /* ··· 237 256 height /= 2; 238 257 } 239 258 240 - rel_data_rate = width * height * fb->format->cpp[color_plane]; 259 + rel_data_rate = 260 + skl_plane_relative_data_rate(crtc_state, plane, width, height, 261 + fb->format->cpp[color_plane]); 262 + if (!rel_data_rate) 263 + return 0; 241 264 242 265 return intel_adjusted_rate(&plane_state->uapi.src, 243 266 &plane_state->uapi.dst,
+16
drivers/gpu/drm/i915/display/skl_watermark.c
··· 1383 1383 plane->async_flip; 1384 1384 } 1385 1385 1386 + unsigned int 1387 + skl_plane_relative_data_rate(const struct intel_crtc_state *crtc_state, 1388 + struct intel_plane *plane, int width, int height, 1389 + int cpp) 1390 + { 1391 + /* 1392 + * We calculate extra ddb based on ratio plane rate/total data rate 1393 + * in case, in some cases we should not allocate extra ddb for the plane, 1394 + * so do not count its data rate, if this is the case. 1395 + */ 1396 + if (use_minimal_wm0_only(crtc_state, plane)) 1397 + return 0; 1398 + 1399 + return width * height * cpp; 1400 + } 1401 + 1386 1402 static u64 1387 1403 skl_total_relative_data_rate(const struct intel_crtc_state *crtc_state) 1388 1404 {
+4
drivers/gpu/drm/i915/display/skl_watermark.h
··· 18 18 struct intel_crtc; 19 19 struct intel_crtc_state; 20 20 struct intel_plane; 21 + struct intel_plane_state; 21 22 struct skl_pipe_wm; 22 23 struct skl_wm_level; 23 24 ··· 54 53 int level); 55 54 const struct skl_wm_level *skl_plane_trans_wm(const struct skl_pipe_wm *pipe_wm, 56 55 enum plane_id plane_id); 56 + unsigned int skl_plane_relative_data_rate(const struct intel_crtc_state *crtc_state, 57 + struct intel_plane *plane, int width, 58 + int height, int cpp); 57 59 58 60 struct intel_dbuf_state { 59 61 struct intel_global_state base;