Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/armada: drop struct_mutex from cursor paths

The kms state itself is already protected by the modeset locks
acquired by the drm core. The only thing left is gem bo state, and
since the cursor code expects small objects which are statically
mapped at create time and then invariant over the lifetime of the gem
bo there's nothing to protect.

See armada_gem_dumb_create -> armada_gem_linear_back which assigns
obj->addr which is the only thing used by the cursor code.

Only tricky bit is to switch to the _unlocked unreference function.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Daniel Vetter and committed by
Russell King
4bd3fd44 39146d6f

+1 -6
+1 -6
drivers/gpu/drm/armada/armada_crtc.c
··· 928 928 } 929 929 } 930 930 931 - mutex_lock(&dev->struct_mutex); 932 931 if (dcrtc->cursor_obj) { 933 932 dcrtc->cursor_obj->update = NULL; 934 933 dcrtc->cursor_obj->update_data = NULL; 935 - drm_gem_object_unreference(&dcrtc->cursor_obj->obj); 934 + drm_gem_object_unreference_unlocked(&dcrtc->cursor_obj->obj); 936 935 } 937 936 dcrtc->cursor_obj = obj; 938 937 dcrtc->cursor_w = w; ··· 941 942 obj->update_data = dcrtc; 942 943 obj->update = cursor_update; 943 944 } 944 - mutex_unlock(&dev->struct_mutex); 945 945 946 946 return ret; 947 947 } 948 948 949 949 static int armada_drm_crtc_cursor_move(struct drm_crtc *crtc, int x, int y) 950 950 { 951 - struct drm_device *dev = crtc->dev; 952 951 struct armada_crtc *dcrtc = drm_to_armada_crtc(crtc); 953 952 int ret; 954 953 ··· 954 957 if (!dcrtc->variant->has_spu_adv_reg) 955 958 return -EFAULT; 956 959 957 - mutex_lock(&dev->struct_mutex); 958 960 dcrtc->cursor_x = x; 959 961 dcrtc->cursor_y = y; 960 962 ret = armada_drm_crtc_cursor_update(dcrtc, false); 961 - mutex_unlock(&dev->struct_mutex); 962 963 963 964 return ret; 964 965 }