drm/i915: kill intel_crtc_update_sarea_pos
Subsystems (2)
PATCH 1/3 drm/i915: kill intel_crtc_update_sarea_pos
We assign the sarea_priv pointer only in the dma ioctl, which is disallowed when kernel modesetting is enabled. So this is dead code.
Cc Stéphane Marchesin <[email protected]>
Signed-off-by Daniel Vetter <[email protected]>
--- drivers/gpu/drm/i915/intel_display.c | 29 ----------------------------- 1 file changed, 29 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -29
@@ -2321,33 +2321,6 @@ intel_finish_fb(struct drm_framebuffer *old_fb)return ret; } -static void intel_crtc_update_sarea_pos (struct drm_crtc *crtc,int x,int y) -{ -struct drm_device *dev = crtc->dev; -struct drm_i915_master_private *master_priv; -struct intel_crtc *intel_crtc =to_intel_crtc (crtc); - -if (!dev->primary->master) -return ; - - master_priv = dev->primary->master->driver_priv; -if (!master_priv->sarea_priv) -return ; - -switch (intel_crtc->pipe) { -case 0 : - master_priv->sarea_priv->pipeA_x = x; - master_priv->sarea_priv->pipeA_y = y; -break ; -case 1 : - master_priv->sarea_priv->pipeB_x = x; - master_priv->sarea_priv->pipeB_y = y; -break ; -default : -break ; - } -} -static int intel_pipe_set_base (struct drm_crtc *crtc,int x,int y,struct drm_framebuffer *fb)
@@ -2435,8 +2408,6 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,intel_edp_psr_update (dev);mutex_unlock (&dev->struct_mutex); -intel_crtc_update_sarea_pos (crtc, x, y); -return 0 ; }
Signature · 6 lines
1.8.5.2 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/3 drm/i915: protect ringbuffer sarea update behind !MODESET
Avoids surprises when userspace races open/closes against this.
Cc Stéphane Marchesin <[email protected]>
Signed-off-by Daniel Vetter <[email protected]>
--- drivers/gpu/drm/i915/intel_ringbuffer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_ringbuffer.c +2 -1
@@ -1513,7 +1513,8 @@ static int ring_wait_for_space(struct intel_ring_buffer *ring, int n)return 0 ; } -if (dev->primary->master) { +if (!drm_core_check_feature (dev,DRIVER_MODESET ) && + dev->primary->master) {struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv;if (master_priv->sarea_priv) master_priv->sarea_priv->perf_boxes |=I915_BOX_WAIT ;
Signature · 6 lines
1.8.5.2 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/3 drm/i915: delay master/sarea deref for legacy ioctls
In reply to Daniel Vetter... past the check for DRIVER_MODESET. Avoids races with userspace opening a master and our sarea setup.
Cc Signed-off-by: Stéphane Marchesin <[email protected]>
Signed-off-by Daniel Vetter <[email protected]>
--- drivers/gpu/drm/i915/i915_dma.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_dma.c +10 -6
@@ -626,9 +626,8 @@ static int i915_batchbuffer(struct drm_device *dev, void *data, struct drm_file *file_priv) {drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; -struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv; -drm_i915_sarea_t *sarea_priv = (drm_i915_sarea_t *) - master_priv->sarea_priv; +struct drm_i915_master_private *master_priv; +drm_i915_sarea_t *sarea_priv;drm_i915_batchbuffer_t *batch = data;int ret;struct drm_clip_rect *cliprects =NULL ;
@@ -636,6 +635,9 @@ static int i915_batchbuffer(struct drm_device *dev, void *data,if (drm_core_check_feature (dev,DRIVER_MODESET ))return -ENODEV ; + master_priv = dev->primary->master->driver_priv; + sarea_priv = (drm_i915_sarea_t *) master_priv->sarea_priv; +if (!dev_priv->dri1.allow_batchbuffer) {DRM_ERROR ("Batchbuffer ioctl disabled\n" );return -EINVAL ;
@@ -682,9 +684,8 @@ static int i915_cmdbuffer(struct drm_device *dev, void *data, struct drm_file *file_priv) {drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; -struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv; -drm_i915_sarea_t *sarea_priv = (drm_i915_sarea_t *) - master_priv->sarea_priv; +struct drm_i915_master_private *master_priv; +drm_i915_sarea_t *sarea_priv;drm_i915_cmdbuffer_t *cmdbuf = data;struct drm_clip_rect *cliprects =NULL ;void *batch_data;
@@ -696,6 +697,9 @@ static int i915_cmdbuffer(struct drm_device *dev, void *data,if (drm_core_check_feature (dev,DRIVER_MODESET ))return -ENODEV ; + master_priv = dev->primary->master->driver_priv; + sarea_priv = (drm_i915_sarea_t *) master_priv->sarea_priv; +RING_LOCK_TEST_WITH_RETURN (dev, file_priv);if (cmdbuf->num_cliprects <0 )
Signature · 6 lines
1.8.5.2 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx