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

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

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

+14 -12
+14 -12
drivers/gpu/drm/i915/i915_initial_plane.c
··· 25 25 intel_crtc_wait_for_next_vblank(to_intel_crtc(crtc)); 26 26 } 27 27 28 - static bool 28 + static const struct intel_plane_state * 29 29 intel_reuse_initial_plane_obj(struct intel_crtc *this, 30 - const struct intel_initial_plane_config plane_configs[], 31 - struct drm_framebuffer **fb, 32 - struct i915_vma **vma) 30 + const struct intel_initial_plane_config plane_configs[]) 33 31 { 34 32 struct intel_display *display = to_intel_display(this); 35 33 struct intel_crtc *crtc; ··· 46 48 if (!plane_state->ggtt_vma) 47 49 continue; 48 50 49 - if (plane_configs[this->pipe].base == plane_configs[crtc->pipe].base) { 50 - *fb = plane_state->hw.fb; 51 - *vma = plane_state->ggtt_vma; 52 - return true; 53 - } 51 + if (plane_configs[this->pipe].base == plane_configs[crtc->pipe].base) 52 + return plane_state; 54 53 } 55 54 56 - return false; 55 + return NULL; 57 56 } 58 57 59 58 static enum intel_memory_type ··· 324 329 if (intel_alloc_initial_plane_obj(crtc, plane_config)) { 325 330 fb = &plane_config->fb->base; 326 331 vma = plane_config->vma; 327 - } else if (!intel_reuse_initial_plane_obj(crtc, plane_configs, &fb, &vma)) { 328 - return -EINVAL; 332 + } else { 333 + const struct intel_plane_state *other_plane_state; 334 + 335 + other_plane_state = intel_reuse_initial_plane_obj(crtc, plane_configs); 336 + if (!other_plane_state) 337 + return -EINVAL; 338 + 339 + fb = other_plane_state->hw.fb; 340 + vma = other_plane_state->ggtt_vma; 329 341 } 330 342 331 343 plane_state->uapi.rotation = plane_config->rotation;