@@ -71,7 +71,7 @@ intel_pin_fb_obj_dpt(struct drm_framebuffer *fb,
return vma;
}
-struct i915_vma *
+static struct i915_vma *
intel_pin_and_fence_fb_obj(struct drm_framebuffer *fb,
bool phys_cursor,
const struct i915_ggtt_view *view,
@@ -199,7 +199,8 @@ intel_pin_and_fence_fb_obj(struct drm_framebuffer *fb,
return vma;
}
-void intel_unpin_fb_vma(struct i915_vma *vma, unsigned long flags)
+static void
+intel_unpin_fb_vma(struct i915_vma *vma, unsigned long flags)
{
if (flags & PLANE_HAS_FENCE)
i915_vma_unpin_fence(vma);
@@ -272,3 +273,32 @@ void intel_plane_unpin_fb(struct intel_plane_state *old_plane_state)
intel_dpt_unpin(intel_fb->dpt_vm);
}
}
+
+int intel_fbdev_pin_and_fence(struct drm_i915_private *dev_priv,
+ struct intel_fbdev *ifbdev,
+ void **vaddr)
+{
+ const struct i915_ggtt_view view = {
+ .type = I915_GGTT_VIEW_NORMAL,
+ };
+ ifbdev->vma = intel_pin_and_fence_fb_obj(&ifbdev->fb->base, false,
+ &view, false, &ifbdev->vma_flags);
+
+ if (IS_ERR(ifbdev->vma)) {
+ return PTR_ERR(ifbdev->vma);
+ }
+
+ *vaddr = i915_vma_pin_iomap(ifbdev->vma);
+ if (IS_ERR(*vaddr)) {
+ drm_err(&dev_priv->drm,
+ "Failed to remap framebuffer into virtual memory\n");
+ return PTR_ERR(vaddr);
+ }
+ return 0;
+}
+
+void intel_fbdev_unpin(struct intel_fbdev *ifbdev)
+{
+ if (ifbdev->vma)
+ intel_unpin_fb_vma(ifbdev->vma, ifbdev->vma_flags);
+}
@@ -8,21 +8,18 @@
#include <linux/types.h>
+struct drm_i915_private;
struct drm_framebuffer;
+struct intel_fbdev;
struct i915_vma;
struct intel_plane_state;
struct i915_ggtt_view;
-struct i915_vma *
-intel_pin_and_fence_fb_obj(struct drm_framebuffer *fb,
- bool phys_cursor,
- const struct i915_ggtt_view *view,
- bool uses_fence,
- unsigned long *out_flags);
-
-void intel_unpin_fb_vma(struct i915_vma *vma, unsigned long flags);
-
int intel_plane_pin_fb(struct intel_plane_state *plane_state);
void intel_plane_unpin_fb(struct intel_plane_state *old_plane_state);
+int intel_fbdev_pin_and_fence(struct drm_i915_private *dev_priv,
+ struct intel_fbdev *ifbdev,
+ void **vaddr);
+void intel_fbdev_unpin(struct intel_fbdev *ifbdev);
#endif
@@ -171,35 +171,6 @@ static int intelfb_alloc(struct drm_fb_helper *helper,
return 0;
}
-static int intel_fbdev_pin_and_fence(struct drm_i915_private *dev_priv,
- struct intel_fbdev *ifbdev,
- void **vaddr)
-{
- const struct i915_ggtt_view view = {
- .type = I915_GGTT_VIEW_NORMAL,
- };
- ifbdev->vma = intel_pin_and_fence_fb_obj(&ifbdev->fb->base, false,
- &view, false, &ifbdev->vma_flags);
-
- if (IS_ERR(ifbdev->vma)) {
- return PTR_ERR(ifbdev->vma);
- }
-
- *vaddr = i915_vma_pin_iomap(ifbdev->vma);
- if (IS_ERR(*vaddr)) {
- drm_err(&dev_priv->drm,
- "Failed to remap framebuffer into virtual memory\n");
- return PTR_ERR(vaddr);
- }
- return 0;
-}
-
-static void intel_fbdev_unpin(struct intel_fbdev *ifbdev)
-{
- if (ifbdev->vma)
- intel_unpin_fb_vma(ifbdev->vma, ifbdev->vma_flags);
-}
-
static int intelfb_create(struct drm_fb_helper *helper,
struct drm_fb_helper_surface_size *sizes)
{