mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 08:15:07 -04:00
drm/i915/display: Don’t use atomic state back-pointer to derive color pipeline
Instead of relying on the plane_state->uapi.state back-pointer to reach the intel_atomic_state inside intel_plane_color_copy_uapi_to_hw_state(), accept the intel_atomic_state as an argument to make the dependency explicit. Update intel_plane_copy_uapi_to_hw_state() and its callers accordingly. Call sites that do not have an atomic state available (e.g. legacy cursor update and initial plane setup) pass NULL. In such cases, skip color pipeline programming as there is no corresponding atomic colorop state to consume. v2: - Rebase Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Assisted-by: GitHub-Copilot:Claude-Sonnet-4.6 Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com> Reviewed-by: Uma Shankar <uma.shankar@intel.com> Signed-off-by: Uma Shankar <uma.shankar@intel.com> Link: https://patch.msgid.link/20260601082953.128539-2-chaitanya.kumar.borah@intel.com
This commit is contained in:
committed by
Uma Shankar
parent
9cc47acc2f
commit
9ba383c240
@@ -876,7 +876,7 @@ intel_legacy_cursor_update(struct drm_plane *_plane,
|
||||
new_plane_state->uapi.crtc_w = crtc_w;
|
||||
new_plane_state->uapi.crtc_h = crtc_h;
|
||||
|
||||
intel_plane_copy_uapi_to_hw_state(new_plane_state, new_plane_state, crtc);
|
||||
intel_plane_copy_uapi_to_hw_state(NULL, new_plane_state, new_plane_state, crtc);
|
||||
|
||||
ret = intel_plane_atomic_check_with_state(crtc_state, new_crtc_state,
|
||||
old_plane_state, new_plane_state);
|
||||
|
||||
@@ -170,7 +170,7 @@ intel_find_initial_plane_obj(struct intel_crtc *crtc,
|
||||
drm_framebuffer_get(fb);
|
||||
|
||||
plane_state->uapi.crtc = &crtc->base;
|
||||
intel_plane_copy_uapi_to_hw_state(plane_state, plane_state, crtc);
|
||||
intel_plane_copy_uapi_to_hw_state(NULL, plane_state, plane_state, crtc);
|
||||
|
||||
atomic_or(plane->frontbuffer_bit, &to_intel_frontbuffer(fb)->bits);
|
||||
|
||||
|
||||
@@ -381,25 +381,27 @@ intel_plane_colorop_replace_blob(struct intel_plane_state *plane_state,
|
||||
}
|
||||
|
||||
static void
|
||||
intel_plane_color_copy_uapi_to_hw_state(struct intel_plane_state *plane_state,
|
||||
intel_plane_color_copy_uapi_to_hw_state(struct intel_atomic_state *state,
|
||||
struct intel_plane_state *plane_state,
|
||||
const struct intel_plane_state *from_plane_state,
|
||||
struct intel_crtc *crtc)
|
||||
{
|
||||
struct drm_colorop *iter_colorop, *colorop;
|
||||
struct drm_colorop_state *new_colorop_state;
|
||||
struct drm_atomic_commit *state = plane_state->uapi.state;
|
||||
struct intel_colorop *intel_colorop;
|
||||
struct drm_property_blob *blob;
|
||||
struct intel_atomic_state *intel_atomic_state = to_intel_atomic_state(state);
|
||||
struct intel_crtc_state *new_crtc_state = intel_atomic_state ?
|
||||
intel_atomic_get_new_crtc_state(intel_atomic_state, crtc) : NULL;
|
||||
struct intel_crtc_state *new_crtc_state = state ?
|
||||
intel_atomic_get_new_crtc_state(state, crtc) : NULL;
|
||||
bool changed = false;
|
||||
int i = 0;
|
||||
|
||||
if (!state)
|
||||
return;
|
||||
|
||||
iter_colorop = from_plane_state->uapi.color_pipeline;
|
||||
|
||||
while (iter_colorop) {
|
||||
for_each_new_colorop_in_state(state, colorop, new_colorop_state, i) {
|
||||
for_each_new_colorop_in_state(&state->base, colorop, new_colorop_state, i) {
|
||||
if (new_colorop_state->colorop == iter_colorop) {
|
||||
blob = new_colorop_state->bypass ? NULL : new_colorop_state->data;
|
||||
intel_colorop = to_intel_colorop(colorop);
|
||||
@@ -415,7 +417,8 @@ intel_plane_color_copy_uapi_to_hw_state(struct intel_plane_state *plane_state,
|
||||
new_crtc_state->plane_color_changed = true;
|
||||
}
|
||||
|
||||
void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state,
|
||||
void intel_plane_copy_uapi_to_hw_state(struct intel_atomic_state *state,
|
||||
struct intel_plane_state *plane_state,
|
||||
const struct intel_plane_state *from_plane_state,
|
||||
struct intel_crtc *crtc)
|
||||
{
|
||||
@@ -444,7 +447,7 @@ void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state,
|
||||
plane_state->uapi.src = drm_plane_state_src(&from_plane_state->uapi);
|
||||
plane_state->uapi.dst = drm_plane_state_dest(&from_plane_state->uapi);
|
||||
|
||||
intel_plane_color_copy_uapi_to_hw_state(plane_state, from_plane_state, crtc);
|
||||
intel_plane_color_copy_uapi_to_hw_state(state, plane_state, from_plane_state, crtc);
|
||||
}
|
||||
|
||||
void intel_plane_copy_hw_state(struct intel_plane_state *plane_state,
|
||||
@@ -841,7 +844,8 @@ static int plane_atomic_check(struct intel_atomic_state *state,
|
||||
old_primary_crtc_plane_state,
|
||||
new_primary_crtc_plane_state);
|
||||
|
||||
intel_plane_copy_uapi_to_hw_state(new_plane_state,
|
||||
intel_plane_copy_uapi_to_hw_state(state,
|
||||
new_plane_state,
|
||||
new_primary_crtc_plane_state,
|
||||
crtc);
|
||||
|
||||
|
||||
@@ -35,7 +35,8 @@ unsigned int intel_plane_pixel_rate(const struct intel_crtc_state *crtc_state,
|
||||
unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state,
|
||||
const struct intel_plane_state *plane_state,
|
||||
int color_plane);
|
||||
void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state,
|
||||
void intel_plane_copy_uapi_to_hw_state(struct intel_atomic_state *state,
|
||||
struct intel_plane_state *plane_state,
|
||||
const struct intel_plane_state *from_plane_state,
|
||||
struct intel_crtc *crtc);
|
||||
void intel_plane_copy_hw_state(struct intel_plane_state *plane_state,
|
||||
|
||||
Reference in New Issue
Block a user