Commit c7df997b authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Rename the fb pinning functions to indicate the address space

Rename the fb pinning functions such that their name directly
informs us what gets pinned into which address space.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240506125718.26001-10-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Acked-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
parent 9e9402b6
...@@ -121,7 +121,7 @@ static void dpt_cleanup(struct i915_address_space *vm) ...@@ -121,7 +121,7 @@ static void dpt_cleanup(struct i915_address_space *vm)
i915_gem_object_put(dpt->obj); i915_gem_object_put(dpt->obj);
} }
struct i915_vma *intel_dpt_pin(struct i915_address_space *vm, struct i915_vma *intel_dpt_pin_to_ggtt(struct i915_address_space *vm,
unsigned int alignment) unsigned int alignment)
{ {
struct drm_i915_private *i915 = vm->i915; struct drm_i915_private *i915 = vm->i915;
...@@ -173,7 +173,7 @@ struct i915_vma *intel_dpt_pin(struct i915_address_space *vm, ...@@ -173,7 +173,7 @@ struct i915_vma *intel_dpt_pin(struct i915_address_space *vm,
return err ? ERR_PTR(err) : vma; return err ? ERR_PTR(err) : vma;
} }
void intel_dpt_unpin(struct i915_address_space *vm) void intel_dpt_unpin_from_ggtt(struct i915_address_space *vm)
{ {
struct i915_dpt *dpt = i915_vm_to_dpt(vm); struct i915_dpt *dpt = i915_vm_to_dpt(vm);
......
...@@ -13,9 +13,9 @@ struct i915_vma; ...@@ -13,9 +13,9 @@ struct i915_vma;
struct intel_framebuffer; struct intel_framebuffer;
void intel_dpt_destroy(struct i915_address_space *vm); void intel_dpt_destroy(struct i915_address_space *vm);
struct i915_vma *intel_dpt_pin(struct i915_address_space *vm, struct i915_vma *intel_dpt_pin_to_ggtt(struct i915_address_space *vm,
unsigned int alignment); unsigned int alignment);
void intel_dpt_unpin(struct i915_address_space *vm); void intel_dpt_unpin_from_ggtt(struct i915_address_space *vm);
void intel_dpt_suspend(struct drm_i915_private *i915); void intel_dpt_suspend(struct drm_i915_private *i915);
void intel_dpt_resume(struct drm_i915_private *i915); void intel_dpt_resume(struct drm_i915_private *i915);
struct i915_address_space * struct i915_address_space *
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "intel_fb_pin.h" #include "intel_fb_pin.h"
static struct i915_vma * static struct i915_vma *
intel_pin_fb_obj_dpt(const struct drm_framebuffer *fb, intel_fb_pin_to_dpt(const struct drm_framebuffer *fb,
const struct i915_gtt_view *view, const struct i915_gtt_view *view,
unsigned int alignment, unsigned int alignment,
unsigned long *out_flags, unsigned long *out_flags,
...@@ -102,7 +102,7 @@ intel_pin_fb_obj_dpt(const struct drm_framebuffer *fb, ...@@ -102,7 +102,7 @@ intel_pin_fb_obj_dpt(const struct drm_framebuffer *fb,
} }
struct i915_vma * struct i915_vma *
intel_pin_and_fence_fb_obj(const struct drm_framebuffer *fb, intel_fb_pin_to_ggtt(const struct drm_framebuffer *fb,
bool phys_cursor, bool phys_cursor,
const struct i915_gtt_view *view, const struct i915_gtt_view *view,
bool uses_fence, bool uses_fence,
...@@ -226,7 +226,7 @@ intel_pin_and_fence_fb_obj(const struct drm_framebuffer *fb, ...@@ -226,7 +226,7 @@ intel_pin_and_fence_fb_obj(const struct drm_framebuffer *fb,
return vma; return vma;
} }
void intel_unpin_fb_vma(struct i915_vma *vma, unsigned long flags) void intel_fb_unpin_vma(struct i915_vma *vma, unsigned long flags)
{ {
if (flags & PLANE_HAS_FENCE) if (flags & PLANE_HAS_FENCE)
i915_vma_unpin_fence(vma); i915_vma_unpin_fence(vma);
...@@ -242,7 +242,7 @@ int intel_plane_pin_fb(struct intel_plane_state *plane_state) ...@@ -242,7 +242,7 @@ int intel_plane_pin_fb(struct intel_plane_state *plane_state)
struct i915_vma *vma; struct i915_vma *vma;
if (!intel_fb_uses_dpt(&fb->base)) { if (!intel_fb_uses_dpt(&fb->base)) {
vma = intel_pin_and_fence_fb_obj(&fb->base, intel_plane_needs_physical(plane), vma = intel_fb_pin_to_ggtt(&fb->base, intel_plane_needs_physical(plane),
&plane_state->view.gtt, &plane_state->view.gtt,
intel_plane_uses_fence(plane_state), intel_plane_uses_fence(plane_state),
&plane_state->flags); &plane_state->flags);
...@@ -263,17 +263,17 @@ int intel_plane_pin_fb(struct intel_plane_state *plane_state) ...@@ -263,17 +263,17 @@ int intel_plane_pin_fb(struct intel_plane_state *plane_state)
} else { } else {
unsigned int alignment = intel_surf_alignment(&fb->base, 0); unsigned int alignment = intel_surf_alignment(&fb->base, 0);
vma = intel_dpt_pin(fb->dpt_vm, alignment / 512); vma = intel_dpt_pin_to_ggtt(fb->dpt_vm, alignment / 512);
if (IS_ERR(vma)) if (IS_ERR(vma))
return PTR_ERR(vma); return PTR_ERR(vma);
plane_state->ggtt_vma = vma; plane_state->ggtt_vma = vma;
vma = intel_pin_fb_obj_dpt(&fb->base, &plane_state->view.gtt, vma = intel_fb_pin_to_dpt(&fb->base, &plane_state->view.gtt,
alignment, &plane_state->flags, alignment, &plane_state->flags,
fb->dpt_vm); fb->dpt_vm);
if (IS_ERR(vma)) { if (IS_ERR(vma)) {
intel_dpt_unpin(fb->dpt_vm); intel_dpt_unpin_from_ggtt(fb->dpt_vm);
plane_state->ggtt_vma = NULL; plane_state->ggtt_vma = NULL;
return PTR_ERR(vma); return PTR_ERR(vma);
} }
...@@ -295,14 +295,14 @@ void intel_plane_unpin_fb(struct intel_plane_state *old_plane_state) ...@@ -295,14 +295,14 @@ void intel_plane_unpin_fb(struct intel_plane_state *old_plane_state)
if (!intel_fb_uses_dpt(&fb->base)) { if (!intel_fb_uses_dpt(&fb->base)) {
vma = fetch_and_zero(&old_plane_state->ggtt_vma); vma = fetch_and_zero(&old_plane_state->ggtt_vma);
if (vma) if (vma)
intel_unpin_fb_vma(vma, old_plane_state->flags); intel_fb_unpin_vma(vma, old_plane_state->flags);
} else { } else {
vma = fetch_and_zero(&old_plane_state->dpt_vma); vma = fetch_and_zero(&old_plane_state->dpt_vma);
if (vma) if (vma)
intel_unpin_fb_vma(vma, old_plane_state->flags); intel_fb_unpin_vma(vma, old_plane_state->flags);
vma = fetch_and_zero(&old_plane_state->ggtt_vma); vma = fetch_and_zero(&old_plane_state->ggtt_vma);
if (vma) if (vma)
intel_dpt_unpin(fb->dpt_vm); intel_dpt_unpin_from_ggtt(fb->dpt_vm);
} }
} }
...@@ -14,13 +14,13 @@ struct intel_plane_state; ...@@ -14,13 +14,13 @@ struct intel_plane_state;
struct i915_gtt_view; struct i915_gtt_view;
struct i915_vma * struct i915_vma *
intel_pin_and_fence_fb_obj(const struct drm_framebuffer *fb, intel_fb_pin_to_ggtt(const struct drm_framebuffer *fb,
bool phys_cursor, bool phys_cursor,
const struct i915_gtt_view *view, const struct i915_gtt_view *view,
bool uses_fence, bool uses_fence,
unsigned long *out_flags); unsigned long *out_flags);
void intel_unpin_fb_vma(struct i915_vma *vma, unsigned long flags); void intel_fb_unpin_vma(struct i915_vma *vma, unsigned long flags);
int intel_plane_pin_fb(struct intel_plane_state *plane_state); int intel_plane_pin_fb(struct intel_plane_state *plane_state);
void intel_plane_unpin_fb(struct intel_plane_state *old_plane_state); void intel_plane_unpin_fb(struct intel_plane_state *old_plane_state);
......
...@@ -146,7 +146,7 @@ static void intel_fbdev_fb_destroy(struct fb_info *info) ...@@ -146,7 +146,7 @@ static void intel_fbdev_fb_destroy(struct fb_info *info)
* the info->screen_base mmaping. Leaking the VMA is simpler than * the info->screen_base mmaping. Leaking the VMA is simpler than
* trying to rectify all the possible error paths leading here. * trying to rectify all the possible error paths leading here.
*/ */
intel_unpin_fb_vma(ifbdev->vma, ifbdev->vma_flags); intel_fb_unpin_vma(ifbdev->vma, ifbdev->vma_flags);
drm_framebuffer_remove(&ifbdev->fb->base); drm_framebuffer_remove(&ifbdev->fb->base);
drm_client_release(&fb_helper->client); drm_client_release(&fb_helper->client);
...@@ -227,7 +227,7 @@ static int intelfb_create(struct drm_fb_helper *helper, ...@@ -227,7 +227,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
* This also validates that any existing fb inherited from the * This also validates that any existing fb inherited from the
* BIOS is suitable for own access. * BIOS is suitable for own access.
*/ */
vma = intel_pin_and_fence_fb_obj(&fb->base, false, vma = intel_fb_pin_to_ggtt(&fb->base, false,
&view, false, &flags); &view, false, &flags);
if (IS_ERR(vma)) { if (IS_ERR(vma)) {
ret = PTR_ERR(vma); ret = PTR_ERR(vma);
...@@ -274,7 +274,7 @@ static int intelfb_create(struct drm_fb_helper *helper, ...@@ -274,7 +274,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
return 0; return 0;
out_unpin: out_unpin:
intel_unpin_fb_vma(vma, flags); intel_fb_unpin_vma(vma, flags);
out_unlock: out_unlock:
intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref); intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref);
return ret; return ret;
......
...@@ -333,7 +333,7 @@ static void __xe_unpin_fb_vma(struct i915_vma *vma) ...@@ -333,7 +333,7 @@ static void __xe_unpin_fb_vma(struct i915_vma *vma)
} }
struct i915_vma * struct i915_vma *
intel_pin_and_fence_fb_obj(const struct drm_framebuffer *fb, intel_fb_pin_to_ggtt(const struct drm_framebuffer *fb,
bool phys_cursor, bool phys_cursor,
const struct i915_gtt_view *view, const struct i915_gtt_view *view,
bool uses_fence, bool uses_fence,
...@@ -344,7 +344,7 @@ intel_pin_and_fence_fb_obj(const struct drm_framebuffer *fb, ...@@ -344,7 +344,7 @@ intel_pin_and_fence_fb_obj(const struct drm_framebuffer *fb,
return __xe_pin_fb_vma(to_intel_framebuffer(fb), view); return __xe_pin_fb_vma(to_intel_framebuffer(fb), view);
} }
void intel_unpin_fb_vma(struct i915_vma *vma, unsigned long flags) void intel_fb_unpin_vma(struct i915_vma *vma, unsigned long flags)
{ {
__xe_unpin_fb_vma(vma); __xe_unpin_fb_vma(vma);
} }
......
...@@ -211,7 +211,7 @@ intel_find_initial_plane_obj(struct intel_crtc *crtc, ...@@ -211,7 +211,7 @@ intel_find_initial_plane_obj(struct intel_crtc *crtc,
intel_fb_fill_view(to_intel_framebuffer(fb), intel_fb_fill_view(to_intel_framebuffer(fb),
plane_state->uapi.rotation, &plane_state->view); plane_state->uapi.rotation, &plane_state->view);
vma = intel_pin_and_fence_fb_obj(fb, false, &plane_state->view.gtt, vma = intel_fb_pin_to_ggtt(fb, false, &plane_state->view.gtt,
false, &plane_state->flags); false, &plane_state->flags);
if (IS_ERR(vma)) if (IS_ERR(vma))
goto nofb; goto nofb;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment