diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2013-06-03 09:10:41 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-06-10 18:47:32 -0400 |
commit | a5d0f5766f2e9cb04f0f775bf679d41ae1a54d50 (patch) | |
tree | 9d63e60e9999ce3c7f3e4473afd50b483f8f8a70 /drivers/gpu/drm/vmwgfx | |
parent | ad6f5c343364e52a49b6a0a9153bda7f0e101416 (diff) |
drm/vmwgfx: Don't access file_priv in cursor_set when handle==0
We want to disable the cursor by calling ->cursor_set() with handle=0
from places where we don't have a file_priv, so don't try to access it
unless necessary.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index 3e3c7ab33ca2..d4607b2530d6 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | |||
@@ -174,7 +174,6 @@ int vmw_du_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv, | |||
174 | uint32_t handle, uint32_t width, uint32_t height) | 174 | uint32_t handle, uint32_t width, uint32_t height) |
175 | { | 175 | { |
176 | struct vmw_private *dev_priv = vmw_priv(crtc->dev); | 176 | struct vmw_private *dev_priv = vmw_priv(crtc->dev); |
177 | struct ttm_object_file *tfile = vmw_fpriv(file_priv)->tfile; | ||
178 | struct vmw_display_unit *du = vmw_crtc_to_du(crtc); | 177 | struct vmw_display_unit *du = vmw_crtc_to_du(crtc); |
179 | struct vmw_surface *surface = NULL; | 178 | struct vmw_surface *surface = NULL; |
180 | struct vmw_dma_buffer *dmabuf = NULL; | 179 | struct vmw_dma_buffer *dmabuf = NULL; |
@@ -197,6 +196,8 @@ int vmw_du_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv, | |||
197 | } | 196 | } |
198 | 197 | ||
199 | if (handle) { | 198 | if (handle) { |
199 | struct ttm_object_file *tfile = vmw_fpriv(file_priv)->tfile; | ||
200 | |||
200 | ret = vmw_user_lookup_handle(dev_priv, tfile, | 201 | ret = vmw_user_lookup_handle(dev_priv, tfile, |
201 | handle, &surface, &dmabuf); | 202 | handle, &surface, &dmabuf); |
202 | if (ret) { | 203 | if (ret) { |