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/xe: return plane_state from intel_reuse_initial_plane_obj()

Initialize fb in the same level as the other code path.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/47d3272cff13dc8f5d7323c32bfb3cc34c0c977d.1765812266.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

+15 -11
+15 -11
drivers/gpu/drm/xe/display/xe_initial_plane.c
··· 45 45 drm_warn(&xe->drm, "waiting for early vblank failed with %i\n", ret); 46 46 } 47 47 48 - static bool 48 + static const struct intel_plane_state * 49 49 intel_reuse_initial_plane_obj(struct intel_crtc *this, 50 - const struct intel_initial_plane_config plane_configs[], 51 - struct drm_framebuffer **fb) 50 + const struct intel_initial_plane_config plane_configs[]) 52 51 { 53 52 struct xe_device *xe = to_xe_device(this->base.dev); 54 53 struct intel_crtc *crtc; ··· 66 67 if (!plane_state->ggtt_vma) 67 68 continue; 68 69 69 - if (plane_configs[this->pipe].base == plane_configs[crtc->pipe].base) { 70 - *fb = plane_state->hw.fb; 71 - return true; 72 - } 70 + if (plane_configs[this->pipe].base == plane_configs[crtc->pipe].base) 71 + return plane_state; 73 72 } 74 73 75 - return false; 74 + return NULL; 76 75 } 77 76 78 77 static struct xe_bo * ··· 214 217 struct drm_framebuffer *fb; 215 218 struct i915_vma *vma; 216 219 217 - if (intel_alloc_initial_plane_obj(crtc, plane_config)) 220 + if (intel_alloc_initial_plane_obj(crtc, plane_config)) { 218 221 fb = &plane_config->fb->base; 219 - else if (!intel_reuse_initial_plane_obj(crtc, plane_configs, &fb)) 220 - return -EINVAL; 222 + } else { 223 + const struct intel_plane_state *other_plane_state; 224 + 225 + other_plane_state = intel_reuse_initial_plane_obj(crtc, plane_configs); 226 + if (!other_plane_state) 227 + return -EINVAL; 228 + 229 + fb = other_plane_state->hw.fb; 230 + } 221 231 222 232 plane_state->uapi.rotation = plane_config->rotation; 223 233 intel_fb_fill_view(to_intel_framebuffer(fb),