drm/rockchip: direct_show: fix some parameters

Signed-off-by: Jianwei Fan <jianwei.fan@rock-chips.com>
Change-Id: I5c018d13c52e6946add366ebc46242c9ca78f7ff
This commit is contained in:
Jianwei Fan
2022-08-02 11:37:42 +00:00
committed by Tao Huang
parent ebf405e9ac
commit 4e4348fed0
3 changed files with 16 additions and 8 deletions

View File

@@ -172,7 +172,7 @@ void rockchip_drm_direct_show_free_buffer(struct drm_device *drm,
drm_gem_object_put(obj);
}
struct drm_plane *rockchip_drm_direct_show_get_plane(struct drm_device *drm, char *name)
struct drm_plane *rockchip_drm_direct_show_get_plane(struct drm_device *drm, const char *name)
{
struct drm_plane *plane;
@@ -190,15 +190,23 @@ struct drm_plane *rockchip_drm_direct_show_get_plane(struct drm_device *drm, cha
return plane;
}
struct drm_crtc *rockchip_drm_direct_show_get_crtc(struct drm_device *drm)
struct drm_crtc *rockchip_drm_direct_show_get_crtc(struct drm_device *drm, const char *name)
{
struct drm_crtc *crtc = NULL;
bool crtc_active = false;
drm_for_each_crtc(crtc, drm) {
if (crtc->state && crtc->state->active) {
crtc_active = true;
break;
if (name == NULL) {
if (crtc->state && crtc->state->active) {
crtc_active = true;
break;
}
} else {
if (crtc->state && crtc->state->active &&
!strncmp(crtc->name, name, DRM_PROP_NAME_LEN)) {
crtc_active = true;
break;
}
}
}

View File

@@ -56,8 +56,8 @@ int rockchip_drm_direct_show_alloc_buffer(struct drm_device *drm,
struct rockchip_drm_direct_show_buffer *buffer);
void rockchip_drm_direct_show_free_buffer(struct drm_device *drm,
struct rockchip_drm_direct_show_buffer *buffer);
struct drm_crtc *rockchip_drm_direct_show_get_crtc(struct drm_device *drm);
struct drm_plane *rockchip_drm_direct_show_get_plane(struct drm_device *drm, char *name);
struct drm_crtc *rockchip_drm_direct_show_get_crtc(struct drm_device *drm, const char *name);
struct drm_plane *rockchip_drm_direct_show_get_plane(struct drm_device *drm, const char *name);
int rockchip_drm_direct_show_commit(struct drm_device *drm,
struct rockchip_drm_direct_show_commit_info *commit_info);
int rockchip_drm_direct_show_disable_plane(struct drm_device *drm, struct drm_plane *plane);

View File

@@ -145,7 +145,7 @@ static void rockchip_drm_self_test_commit(struct work_struct *work)
rockchip_drm_draw_color_bar(self_test->drm_buffer[1]);
/* get crtc and plane */
self_test->crtc = rockchip_drm_direct_show_get_crtc(self_test->dev);
self_test->crtc = rockchip_drm_direct_show_get_crtc(self_test->dev, NULL);
if (self_test->crtc == NULL) {
pr_info("error: failed to get crtc\n");
goto free_buffer;