⬢ DragonFlyBSD Kernel Audit
DF-3572 / upstream_v5.2_divergence.diff
← back to finding ↓ download raw
 skl_plane_relative_data_rate(const struct intel_crtc_state *cstate,
-			     const struct intel_plane_state *intel_pstate,
+			     const struct drm_plane_state *pstate,
 			     const int plane)
 {
-	struct intel_plane *intel_plane =
-		to_intel_plane(intel_pstate->base.plane);
-	u32 data_rate;
-	u32 width = 0, height = 0;
+	struct intel_plane *intel_plane = to_intel_plane(pstate->plane);
+	struct intel_plane_state *intel_pstate = to_intel_plane_state(pstate);
+	uint32_t data_rate;
+	uint32_t width = 0, height = 0;
 	struct drm_framebuffer *fb;
 	u32 format;
 	uint_fixed_16_16_t down_scale_amount;
-	u64 rate;
 
 	if (!intel_pstate->base.visible)
 		return 0;
 
-	fb = intel_pstate->base.fb;
+	fb = pstate->fb;
 	format = fb->format->format;
 
 	if (intel_plane->id == PLANE_CURSOR)
 		return 0;
-	if (plane == 1 && !is_planar_yuv_format(format))
+	if (plane == 1 && format != DRM_FORMAT_NV12)
 		return 0;
 
 	/*
@@ -4231,31 +4208,33 @@
 		rate = skl_plane_relative_data_rate(intel_cstate,
-						    intel_pstate, 0);
+						    pstate, 0);
 		plane_data_rate[plane_id] = rate;
+
 		total_data_rate += rate;
 
 		/* uv-plane */
 		rate = skl_plane_relative_data_rate(intel_cstate,
-						    intel_pstate, 1);
+						    pstate, 1);
 		uv_plane_data_rate[plane_id] = rate;
+
 		total_data_rate += rate;
 	}
 
 	return total_data_rate;
 }
 
-static u64
-icl_get_total_relative_data_rate(struct intel_crtc_state *intel_cstate,
-				 u64 *plane_data_rate)
+static uint16_t
+skl_ddb_min_alloc(const struct drm_plane_state *pstate, const int plane)
 {
-	struct drm_crtc_state *cstate = &intel_cstate->base;
-	struct drm_atomic_state *state = cstate->state;
 skl_get_total_relative_data_rate(struct intel_crtc_state *intel_cstate,
-				 u64 *plane_data_rate,
-				 u64 *uv_plane_data_rate)
+				 unsigned int *plane_data_rate,
+				 unsigned int *uv_plane_data_rate)
 {
 	struct drm_crtc_state *cstate = &intel_cstate->base;
 	struct drm_atomic_state *state = cstate->state;
 	struct drm_plane *plane;
 	const struct drm_plane_state *pstate;
-	u64 total_data_rate = 0;
+	unsigned int total_data_rate = 0;
 
 	if (WARN_ON(!state))
 		return 0;
@@ -4263,79 +4242,110 @@
-			skl_get_total_relative_data_rate(cstate,
-							 plane_data_rate,
-							 uv_plane_data_rate);
-	else
-		total_data_rate =
-			icl_get_total_relative_data_rate(cstate,
-							 plane_data_rate);
-
-	skl_ddb_get_pipe_allocation_limits(dev_priv, cstate, total_data_rate,
-					   ddb, alloc, &num_active);
+	total_data_rate = skl_get_total_relative_data_rate(cstate,
+							   plane_data_rate,
+							   uv_plane_data_rate);
+	skl_ddb_get_pipe_allocation_limits(dev, cstate, total_data_rate, ddb,