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

Configure Feed

Select the types of activity you want to include in your feed.

drm/msm/dpu: Remove suspend state tracking from crtc

Since drm core's modeset locks serialize atomic commits, we don't need to
track whether or not we're in a suspended state from inside the crtc for
dpu_crtc_enable/disable. This patch removes the suspend logic from the crtc and
removes the relevant tracing from dpu_trace. Since we removed all calls
to dpu_kms_is_suspend_state, we can remove that function and the
suspend_state field of dpu_kms as well.

v2: added patch to patchset
v3: reworded commit body and moved deletion of dpu_kms_is_suspend_state and
suspend_state to this patch

Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Bruce Wang <bzwang@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>

authored by

Bruce Wang and committed by
Rob Clark
7a007a12 3750e78c

+6 -75
+4 -44
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
··· 816 816 } 817 817 818 818 /** 819 - * _dpu_crtc_set_suspend - notify crtc of suspend enable/disable 820 - * @crtc: Pointer to drm crtc object 821 - * @enable: true to enable suspend, false to indicate resume 822 - */ 823 - static void _dpu_crtc_set_suspend(struct drm_crtc *crtc, bool enable) 824 - { 825 - struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc); 826 - 827 - DRM_DEBUG_KMS("crtc%d suspend = %d\n", crtc->base.id, enable); 828 - 829 - mutex_lock(&dpu_crtc->crtc_lock); 830 - 831 - /* 832 - * If the vblank is enabled, release a power reference on suspend 833 - * and take it back during resume (if it is still enabled). 834 - */ 835 - trace_dpu_crtc_set_suspend(DRMID(&dpu_crtc->base), enable, dpu_crtc); 836 - if (dpu_crtc->suspend == enable) 837 - DPU_DEBUG("crtc%d suspend already set to %d, ignoring update\n", 838 - crtc->base.id, enable); 839 - else if (dpu_crtc->enabled && dpu_crtc->vblank_requested) { 840 - _dpu_crtc_vblank_enable_no_lock(dpu_crtc, !enable); 841 - } 842 - 843 - dpu_crtc->suspend = enable; 844 - mutex_unlock(&dpu_crtc->crtc_lock); 845 - } 846 - 847 - /** 848 819 * dpu_crtc_duplicate_state - state duplicate hook 849 820 * @crtc: Pointer to drm crtc structure 850 821 * @Returns: Pointer to new drm_crtc_state structure ··· 922 951 923 952 DRM_DEBUG_KMS("crtc%d\n", crtc->base.id); 924 953 925 - if (dpu_kms_is_suspend_state(crtc->dev)) 926 - _dpu_crtc_set_suspend(crtc, true); 927 - 928 954 /* Disable/save vblank irq handling */ 929 955 drm_crtc_vblank_off(crtc); 930 956 ··· 934 966 atomic_read(&dpu_crtc->frame_pending)); 935 967 936 968 trace_dpu_crtc_disable(DRMID(crtc), false, dpu_crtc); 937 - if (dpu_crtc->enabled && !dpu_crtc->suspend && 938 - dpu_crtc->vblank_requested) { 969 + if (dpu_crtc->enabled && dpu_crtc->vblank_requested) { 939 970 _dpu_crtc_vblank_enable_no_lock(dpu_crtc, false); 940 971 } 941 972 dpu_crtc->enabled = false; ··· 1000 1033 1001 1034 mutex_lock(&dpu_crtc->crtc_lock); 1002 1035 trace_dpu_crtc_enable(DRMID(crtc), true, dpu_crtc); 1003 - if (!dpu_crtc->enabled && !dpu_crtc->suspend && 1004 - dpu_crtc->vblank_requested) { 1036 + if (!dpu_crtc->enabled && dpu_crtc->vblank_requested) { 1005 1037 _dpu_crtc_vblank_enable_no_lock(dpu_crtc, true); 1006 1038 } 1007 1039 dpu_crtc->enabled = true; ··· 1255 1289 1256 1290 int dpu_crtc_vblank(struct drm_crtc *crtc, bool en) 1257 1291 { 1258 - struct dpu_crtc *dpu_crtc; 1259 - 1260 - if (!crtc) { 1261 - DPU_ERROR("invalid crtc\n"); 1262 - return -EINVAL; 1263 - } 1264 - dpu_crtc = to_dpu_crtc(crtc); 1292 + struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc); 1265 1293 1266 1294 mutex_lock(&dpu_crtc->crtc_lock); 1267 1295 trace_dpu_crtc_vblank(DRMID(&dpu_crtc->base), en, dpu_crtc); 1268 - if (dpu_crtc->enabled && !dpu_crtc->suspend) { 1296 + if (dpu_crtc->enabled) { 1269 1297 _dpu_crtc_vblank_enable_no_lock(dpu_crtc, en); 1270 1298 } 1271 1299 dpu_crtc->vblank_requested = en;
-2
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
··· 133 133 * @play_count : frame count between crtc enable and disable 134 134 * @vblank_cb_time : ktime at vblank count reset 135 135 * @vblank_requested : whether the user has requested vblank events 136 - * @suspend : whether or not a suspend operation is in progress 137 136 * @enabled : whether the DPU CRTC is currently enabled. updated in the 138 137 * commit-thread, not state-swap time which is earlier, so 139 138 * safe to make decisions on during VBLANK on/off work ··· 168 169 u64 play_count; 169 170 ktime_t vblank_cb_time; 170 171 bool vblank_requested; 171 - bool suspend; 172 172 bool enabled; 173 173 174 174 struct list_head feature_list;
-16
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
··· 135 135 136 136 struct dpu_core_perf perf; 137 137 138 - /* saved atomic state during system suspend */ 139 - struct drm_atomic_state *suspend_state; 140 - 141 138 struct dpu_rm rm; 142 139 bool rm_init; 143 140 ··· 158 161 /* get struct msm_kms * from drm_device * */ 159 162 #define ddev_to_msm_kms(D) ((D) && (D)->dev_private ? \ 160 163 ((struct msm_drm_private *)((D)->dev_private))->kms : NULL) 161 - 162 - /** 163 - * dpu_kms_is_suspend_state - whether or not the system is pm suspended 164 - * @dev: Pointer to drm device 165 - * Return: Suspend status 166 - */ 167 - static inline bool dpu_kms_is_suspend_state(struct drm_device *dev) 168 - { 169 - if (!ddev_to_msm_kms(dev)) 170 - return false; 171 - 172 - return to_dpu_kms(ddev_to_msm_kms(dev))->suspend_state != NULL; 173 - } 174 164 175 165 /** 176 166 * Debugfs functions - extra helper functions for debugfs support
+2 -13
drivers/gpu/drm/msm/disp/dpu1/dpu_trace.h
··· 749 749 __field( uint32_t, enc_id ) 750 750 __field( bool, enable ) 751 751 __field( bool, enabled ) 752 - __field( bool, suspend ) 753 752 __field( bool, vblank_requested ) 754 753 ), 755 754 TP_fast_assign( ··· 756 757 __entry->enc_id = enc_id; 757 758 __entry->enable = enable; 758 759 __entry->enabled = crtc->enabled; 759 - __entry->suspend = crtc->suspend; 760 760 __entry->vblank_requested = crtc->vblank_requested; 761 761 ), 762 - TP_printk("id:%u encoder:%u enable:%s state{enabled:%s suspend:%s " 763 - "vblank_req:%s}", 762 + TP_printk("id:%u encoder:%u enable:%s state{enabled:%s vblank_req:%s}", 764 763 __entry->drm_id, __entry->enc_id, 765 764 __entry->enable ? "true" : "false", 766 765 __entry->enabled ? "true" : "false", 767 - __entry->suspend ? "true" : "false", 768 766 __entry->vblank_requested ? "true" : "false") 769 767 ); 770 768 ··· 772 776 __field( uint32_t, drm_id ) 773 777 __field( bool, enable ) 774 778 __field( bool, enabled ) 775 - __field( bool, suspend ) 776 779 __field( bool, vblank_requested ) 777 780 ), 778 781 TP_fast_assign( 779 782 __entry->drm_id = drm_id; 780 783 __entry->enable = enable; 781 784 __entry->enabled = crtc->enabled; 782 - __entry->suspend = crtc->suspend; 783 785 __entry->vblank_requested = crtc->vblank_requested; 784 786 ), 785 - TP_printk("id:%u enable:%s state{enabled:%s suspend:%s vblank_req:%s}", 787 + TP_printk("id:%u enable:%s state{enabled:%s vblank_req:%s}", 786 788 __entry->drm_id, __entry->enable ? "true" : "false", 787 789 __entry->enabled ? "true" : "false", 788 - __entry->suspend ? "true" : "false", 789 790 __entry->vblank_requested ? "true" : "false") 790 - ); 791 - DEFINE_EVENT(dpu_crtc_enable_template, dpu_crtc_set_suspend, 792 - TP_PROTO(uint32_t drm_id, bool enable, struct dpu_crtc *crtc), 793 - TP_ARGS(drm_id, enable, crtc) 794 791 ); 795 792 DEFINE_EVENT(dpu_crtc_enable_template, dpu_crtc_enable, 796 793 TP_PROTO(uint32_t drm_id, bool enable, struct dpu_crtc *crtc),