Skip to content

Commit

Permalink
drm/vkms: add crc sources list
Browse files Browse the repository at this point in the history
Other drivers are able to list crc sources when accessing
/sys/kernel/debug/dri/.../crtc-0/crc/control

Even though VKMS now supports only 'auto' mode, it is more consistent to
have the list available to the userspace.

Signed-off-by: Oleg Vasilev <oleg.vasilev@intel.com>
Reviewed-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190613121802.2193-3-oleg.vasilev@intel.com
  • Loading branch information
Oleg Vasilev authored and Rodrigo Siqueira committed Jun 19, 2019
1 parent b6b3821 commit c936843
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/gpu/drm/vkms/vkms_crc.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,15 @@ void vkms_crc_work_handle(struct work_struct *work)
spin_unlock_irqrestore(&out->state_lock, flags);
}

static const char * const pipe_crc_sources[] = {"auto"};

const char *const *vkms_get_crc_sources(struct drm_crtc *crtc,
size_t *count)
{
*count = ARRAY_SIZE(pipe_crc_sources);
return pipe_crc_sources;
}

static int vkms_crc_parse_source(const char *src_name, bool *enabled)
{
int ret = 0;
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/vkms/vkms_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ static const struct drm_crtc_funcs vkms_crtc_funcs = {
.atomic_destroy_state = vkms_atomic_crtc_destroy_state,
.enable_vblank = vkms_enable_vblank,
.disable_vblank = vkms_disable_vblank,
.get_crc_sources = vkms_get_crc_sources,
.set_crc_source = vkms_set_crc_source,
.verify_crc_source = vkms_verify_crc_source,
};
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/vkms/vkms_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ int vkms_gem_vmap(struct drm_gem_object *obj);
void vkms_gem_vunmap(struct drm_gem_object *obj);

/* CRC Support */
const char *const *vkms_get_crc_sources(struct drm_crtc *crtc,
size_t *count);
int vkms_set_crc_source(struct drm_crtc *crtc, const char *src_name);
int vkms_verify_crc_source(struct drm_crtc *crtc, const char *source_name,
size_t *values_cnt);
Expand Down

0 comments on commit c936843

Please sign in to comment.