Commit 29b9bde6 authored by Daniel Vetter's avatar Daniel Vetter

drm/i915: Make ->update_primary_plane infallible

Way back we've used this to reject framebuffers with unsupported
pixel formats. But since the modesetting reorg with the compute
config stage we reject those much earlier and just BUG() in this
callback. So switch to a void return type.
Reviewed-by: default avatarAkash Goel <akash.goel@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 227f782e
...@@ -471,9 +471,9 @@ struct drm_i915_display_funcs { ...@@ -471,9 +471,9 @@ struct drm_i915_display_funcs {
struct drm_framebuffer *fb, struct drm_framebuffer *fb,
struct drm_i915_gem_object *obj, struct drm_i915_gem_object *obj,
uint32_t flags); uint32_t flags);
int (*update_primary_plane)(struct drm_crtc *crtc, void (*update_primary_plane)(struct drm_crtc *crtc,
struct drm_framebuffer *fb, struct drm_framebuffer *fb,
int x, int y); int x, int y);
void (*hpd_irq_setup)(struct drm_device *dev); void (*hpd_irq_setup)(struct drm_device *dev);
/* clock updates for mode set */ /* clock updates for mode set */
/* cursor updates */ /* cursor updates */
......
...@@ -2330,9 +2330,9 @@ static void intel_find_plane_obj(struct intel_crtc *intel_crtc, ...@@ -2330,9 +2330,9 @@ static void intel_find_plane_obj(struct intel_crtc *intel_crtc,
} }
} }
static int i9xx_update_primary_plane(struct drm_crtc *crtc, static void i9xx_update_primary_plane(struct drm_crtc *crtc,
struct drm_framebuffer *fb, struct drm_framebuffer *fb,
int x, int y) int x, int y)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
...@@ -2418,13 +2418,11 @@ static int i9xx_update_primary_plane(struct drm_crtc *crtc, ...@@ -2418,13 +2418,11 @@ static int i9xx_update_primary_plane(struct drm_crtc *crtc,
} else } else
I915_WRITE(DSPADDR(plane), i915_gem_obj_ggtt_offset(obj) + linear_offset); I915_WRITE(DSPADDR(plane), i915_gem_obj_ggtt_offset(obj) + linear_offset);
POSTING_READ(reg); POSTING_READ(reg);
return 0;
} }
static int ironlake_update_primary_plane(struct drm_crtc *crtc, static void ironlake_update_primary_plane(struct drm_crtc *crtc,
struct drm_framebuffer *fb, struct drm_framebuffer *fb,
int x, int y) int x, int y)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
...@@ -2502,8 +2500,6 @@ static int ironlake_update_primary_plane(struct drm_crtc *crtc, ...@@ -2502,8 +2500,6 @@ static int ironlake_update_primary_plane(struct drm_crtc *crtc,
I915_WRITE(DSPLINOFF(plane), linear_offset); I915_WRITE(DSPLINOFF(plane), linear_offset);
} }
POSTING_READ(reg); POSTING_READ(reg);
return 0;
} }
/* Assume fb object is pinned & idle & fenced and just update base pointers */ /* Assume fb object is pinned & idle & fenced and just update base pointers */
...@@ -2518,7 +2514,9 @@ intel_pipe_set_base_atomic(struct drm_crtc *crtc, struct drm_framebuffer *fb, ...@@ -2518,7 +2514,9 @@ intel_pipe_set_base_atomic(struct drm_crtc *crtc, struct drm_framebuffer *fb,
dev_priv->display.disable_fbc(dev); dev_priv->display.disable_fbc(dev);
intel_increase_pllclock(crtc); intel_increase_pllclock(crtc);
return dev_priv->display.update_primary_plane(crtc, fb, x, y); dev_priv->display.update_primary_plane(crtc, fb, x, y);
return 0;
} }
void intel_display_handle_reset(struct drm_device *dev) void intel_display_handle_reset(struct drm_device *dev)
...@@ -2677,14 +2675,7 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, ...@@ -2677,14 +2675,7 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
intel_crtc->config.pipe_src_h = adjusted_mode->crtc_vdisplay; intel_crtc->config.pipe_src_h = adjusted_mode->crtc_vdisplay;
} }
ret = dev_priv->display.update_primary_plane(crtc, fb, x, y); dev_priv->display.update_primary_plane(crtc, fb, x, y);
if (ret) {
mutex_lock(&dev->struct_mutex);
intel_unpin_fb_obj(to_intel_framebuffer(fb)->obj);
mutex_unlock(&dev->struct_mutex);
DRM_ERROR("failed to update base address\n");
return ret;
}
old_fb = crtc->primary->fb; old_fb = crtc->primary->fb;
crtc->primary->fb = fb; crtc->primary->fb = fb;
......
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