diff options
| author | Jani Nikula <jani.nikula@intel.com> | 2025-12-15 18:28:22 +0300 |
|---|---|---|
| committer | Jani Nikula <jani.nikula@intel.com> | 2025-12-22 16:09:23 +0300 |
| commit | 3629264e4d7dd255180e99ed6be05af57e4bea6b (patch) | |
| tree | 9dfbce4e739bc44ac0a8520a82e177a6a79dc147 | |
| parent | 1b3cc68df363820537d6c837069db4c303ee58a9 (diff) | |
| download | linux-3629264e4d7dd255180e99ed6be05af57e4bea6b.tar.xz | |
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>
| -rw-r--r-- | drivers/gpu/drm/i915/i915_initial_plane.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/gpu/drm/i915/i915_initial_plane.c b/drivers/gpu/drm/i915/i915_initial_plane.c index 57afe6e29ce3..40b9f981c9ac 100644 --- a/drivers/gpu/drm/i915/i915_initial_plane.c +++ b/drivers/gpu/drm/i915/i915_initial_plane.c @@ -25,11 +25,9 @@ static void i915_initial_plane_vblank_wait(struct drm_crtc *crtc) intel_crtc_wait_for_next_vblank(to_intel_crtc(crtc)); } -static bool +static const struct intel_plane_state * intel_reuse_initial_plane_obj(struct intel_crtc *this, - const struct intel_initial_plane_config plane_configs[], - struct drm_framebuffer **fb, - struct i915_vma **vma) + const struct intel_initial_plane_config plane_configs[]) { struct intel_display *display = to_intel_display(this); struct intel_crtc *crtc; @@ -48,14 +46,11 @@ intel_reuse_initial_plane_obj(struct intel_crtc *this, if (!plane_state->ggtt_vma) continue; - if (plane_configs[this->pipe].base == plane_configs[crtc->pipe].base) { - *fb = plane_state->hw.fb; - *vma = plane_state->ggtt_vma; - return true; - } + if (plane_configs[this->pipe].base == plane_configs[crtc->pipe].base) + return plane_state; } - return false; + return NULL; } static enum intel_memory_type @@ -329,8 +324,15 @@ i915_find_initial_plane_obj(struct drm_crtc *_crtc, if (intel_alloc_initial_plane_obj(crtc, plane_config)) { fb = &plane_config->fb->base; vma = plane_config->vma; - } else if (!intel_reuse_initial_plane_obj(crtc, plane_configs, &fb, &vma)) { - return -EINVAL; + } else { + const struct intel_plane_state *other_plane_state; + + other_plane_state = intel_reuse_initial_plane_obj(crtc, plane_configs); + if (!other_plane_state) + return -EINVAL; + + fb = other_plane_state->hw.fb; + vma = other_plane_state->ggtt_vma; } plane_state->uapi.rotation = plane_config->rotation; |
