aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h
diff options
context:
space:
mode:
authorWayne Lin <Wayne.Lin@amd.com>2021-03-02 13:21:07 +0800
committerAlex Deucher <alexander.deucher@amd.com>2021-03-05 15:12:09 -0500
commit9a65df19310859bbc185a4bb8ed45fe1479bd8f2 (patch)
treee39bd50750182a8841be4c42d368c354266066c3 /drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h
parentdrm/amd/display: Change to set crc window by dmcu fw (diff)
downloadlinux-dev-9a65df19310859bbc185a4bb8ed45fe1479bd8f2.tar.xz
linux-dev-9a65df19310859bbc185a4bb8ed45fe1479bd8f2.zip
drm/amd/display: Use PSP TA to read out crc
[Why & How] To read back crc by sending command READ_ROI_CRC to PSP TA to ask it to read out crc of crc window. Signed-off-by: Wayne Lin <Wayne.Lin@amd.com> Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com> Acked-by: Eryk Brol <eryk.brol@amd.com> Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h')
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h
index b0ba8c3a1e1d..737e701fb0f0 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h
@@ -49,6 +49,16 @@ struct crc_window_parm {
bool activated;
/* Update crc window during vertical blank or not */
bool update_win;
+ /* skip reading/writing for few frames */
+ int skip_frame_cnt;
+};
+
+struct crc_rd_work {
+ struct work_struct notify_ta_work;
+ /* To protect crc_rd_work carried fields*/
+ spinlock_t crc_rd_work_lock;
+ struct drm_crtc *crtc;
+ uint8_t phy_inst;
};
#endif
@@ -80,9 +90,15 @@ void amdgpu_dm_crtc_handle_crc_irq(struct drm_crtc *crtc);
#ifdef CONFIG_DRM_AMD_SECURE_DISPLAY
bool amdgpu_dm_crc_window_is_activated(struct drm_crtc *crtc);
void amdgpu_dm_crtc_handle_crc_window_irq(struct drm_crtc *crtc);
+struct crc_rd_work *amdgpu_dm_crtc_secure_display_create_work(void);
+void amdgpu_dm_crtc_secure_display_resume(struct amdgpu_device *adev);
+void amdgpu_dm_crtc_secure_display_suspend(struct amdgpu_device *adev);
#else
#define amdgpu_dm_crc_window_is_activated(x)
#define amdgpu_dm_crtc_handle_crc_window_irq(x)
+#define amdgpu_dm_crtc_secure_display_create_work()
+#define amdgpu_dm_crtc_secure_display_resume(x)
+#define amdgpu_dm_crtc_secure_display_suspend(x)
#endif
#endif /* AMD_DAL_DEV_AMDGPU_DM_AMDGPU_DM_CRC_H_ */