]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
drm/i915/crc: implement get_crc_sources callback
authorMahesh Kumar <mahesh1.kumar@intel.com>
Fri, 13 Jul 2018 13:59:39 +0000 (19:29 +0530)
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Mon, 13 Aug 2018 12:00:20 +0000 (14:00 +0200)
This patch implements get_crc_sources callback, which returns list of
all the valid crc sources supported by driver in current platform.

Changes since V1:
 - Return array of crc sources

Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180713135942.25061-8-mahesh1.kumar@intel.com
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_pipe_crc.c

index b0daa95158dbf58115f5f135081eff1759f9a34f..bd8956f2544d637d9a45a5e56d918bcb52d916ba 100644 (file)
@@ -12866,6 +12866,7 @@ static const struct drm_crtc_funcs intel_crtc_funcs = {
        .atomic_destroy_state = intel_crtc_destroy_state,
        .set_crc_source = intel_crtc_set_crc_source,
        .verify_crc_source = intel_crtc_verify_crc_source,
+       .get_crc_sources = intel_crtc_get_crc_sources,
 };
 
 struct wait_rps_boost {
index fa0d2e1318165c8bd73939aac60661b217516680..27362214b77ba3cca0b5c09d9f5f9f1a89e79fb1 100644 (file)
@@ -2155,11 +2155,14 @@ int intel_crtc_set_crc_source(struct drm_crtc *crtc, const char *source_name,
                              size_t *values_cnt);
 int intel_crtc_verify_crc_source(struct drm_crtc *crtc,
                                 const char *source_name, size_t *values_cnt);
+const char *const *intel_crtc_get_crc_sources(struct drm_crtc *crtc,
+                                             size_t *count);
 void intel_crtc_disable_pipe_crc(struct intel_crtc *crtc);
 void intel_crtc_enable_pipe_crc(struct intel_crtc *crtc);
 #else
 #define intel_crtc_set_crc_source NULL
 #define intel_crtc_verify_crc_source NULL
+#define intel_crtc_get_crc_sources NULL
 static inline void intel_crtc_disable_pipe_crc(struct intel_crtc *crtc)
 {
 }
index a37521380f9434650799a2b392a7b7cfd26845e3..1dffc346f1bc1682fe4099e793ef65aeca06ee7e 100644 (file)
@@ -1001,6 +1001,13 @@ intel_is_valid_crc_source(struct drm_i915_private *dev_priv,
                return ivb_crc_source_valid(dev_priv, source);
 }
 
+const char *const *intel_crtc_get_crc_sources(struct drm_crtc *crtc,
+                                             size_t *count)
+{
+       *count = ARRAY_SIZE(pipe_crc_sources);
+       return pipe_crc_sources;
+}
+
 int intel_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name,
                                 size_t *values_cnt)
 {