drm/amd/display: add functionality to get pipe CRC source.
authorDingchen Zhang <dingchen.zhang@amd.com>
Wed, 29 May 2019 22:52:52 +0000 (18:52 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 18 Jul 2019 19:18:09 +0000 (14:18 -0500)
[Why]
We need to check the pipe crc source through debugfs for bypass mode test.

[How]
add implementation of amdgpu_dm_crtc_get_crc_sources and hook into drm_crtc
callback get_crc_sources.

Signed-off-by: Dingchen Zhang <dingchen.zhang@amd.com>
Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h

index d0d52c38bba390c03b49342195170e3f21fb447c..13463fa31c3f2cea2ef448965eeedda825ccf4c7 100644 (file)
@@ -3735,6 +3735,7 @@ static const struct drm_crtc_funcs amdgpu_dm_crtc_funcs = {
        .atomic_destroy_state = dm_crtc_destroy_state,
        .set_crc_source = amdgpu_dm_crtc_set_crc_source,
        .verify_crc_source = amdgpu_dm_crtc_verify_crc_source,
+       .get_crc_sources = amdgpu_dm_crtc_get_crc_sources,
        .enable_vblank = dm_enable_vblank,
        .disable_vblank = dm_disable_vblank,
 };
index 9af270161a0e91c05ae91c3509cc16fe9fa3cc78..b966e141048440b39e74dc8a2a9e45bd662e60e1 100644 (file)
 #include "amdgpu_dm.h"
 #include "dc.h"
 
+static const char *const pipe_crc_sources[] = {
+       "none",
+       "crtc",
+       "dprx",
+       "auto",
+};
+
 static enum amdgpu_dm_pipe_crc_source dm_parse_crc_source(const char *source)
 {
        if (!source || !strcmp(source, "none"))
@@ -42,6 +49,13 @@ static enum amdgpu_dm_pipe_crc_source dm_parse_crc_source(const char *source)
        return AMDGPU_DM_PIPE_CRC_SOURCE_INVALID;
 }
 
+const char *const *amdgpu_dm_crtc_get_crc_sources(struct drm_crtc *crtc,
+                                                 size_t *count)
+{
+       *count = ARRAY_SIZE(pipe_crc_sources);
+       return pipe_crc_sources;
+}
+
 int
 amdgpu_dm_crtc_verify_crc_source(struct drm_crtc *crtc, const char *src_name,
                                 size_t *values_cnt)
index 3793dc8724367e51068385c16578c9eee27a78e0..b63a9011f5112a01132a47283474d53e1dae54a5 100644 (file)
@@ -46,10 +46,13 @@ int amdgpu_dm_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name);
 int amdgpu_dm_crtc_verify_crc_source(struct drm_crtc *crtc,
                                     const char *src_name,
                                     size_t *values_cnt);
+const char *const *amdgpu_dm_crtc_get_crc_sources(struct drm_crtc *crtc,
+                                                 size_t *count);
 void amdgpu_dm_crtc_handle_crc_irq(struct drm_crtc *crtc);
 #else
 #define amdgpu_dm_crtc_set_crc_source NULL
 #define amdgpu_dm_crtc_verify_crc_source NULL
+#define amdgpu_dm_crtc_get_crc_sources NULL
 #define amdgpu_dm_crtc_handle_crc_irq(x)
 #endif