Skip to content

Commit

Permalink
Merge tag 'drm-misc-next-fixes-2022-03-24-1' of git://anongit.freedes…
Browse files Browse the repository at this point in the history
…ktop.org/drm/drm-misc into drm-next

drm-misc-next-fixes for v5.18-rc1:
- Make audio and color plane support checking only happen
  when a CEA extension block is found.
- Fix a small regression from ttm_resource_fini()
- Small selftest fix.

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/fafe7517-fb98-4992-e059-88429ac488bc@linux.intel.com
  • Loading branch information
Dave Airlie committed Mar 24, 2022
2 parents 21050a3 + 7344bad commit c73c357
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
15 changes: 10 additions & 5 deletions drivers/gpu/drm/drm_edid.c
Original file line number Diff line number Diff line change
Expand Up @@ -4859,7 +4859,8 @@ bool drm_detect_monitor_audio(struct edid *edid)
if (!edid_ext)
goto end;

has_audio = ((edid_ext[3] & EDID_BASIC_AUDIO) != 0);
has_audio = (edid_ext[0] == CEA_EXT &&
(edid_ext[3] & EDID_BASIC_AUDIO) != 0);

if (has_audio) {
DRM_DEBUG_KMS("Monitor has basic audio support\n");
Expand Down Expand Up @@ -5187,10 +5188,14 @@ static void drm_parse_cea_ext(struct drm_connector *connector,

/* The existence of a CEA block should imply RGB support */
info->color_formats = DRM_COLOR_FORMAT_RGB444;
if (edid_ext[3] & EDID_CEA_YCRCB444)
info->color_formats |= DRM_COLOR_FORMAT_YCBCR444;
if (edid_ext[3] & EDID_CEA_YCRCB422)
info->color_formats |= DRM_COLOR_FORMAT_YCBCR422;

/* CTA DisplayID Data Block does not have byte #3 */
if (edid_ext[0] == CEA_EXT) {
if (edid_ext[3] & EDID_CEA_YCRCB444)
info->color_formats |= DRM_COLOR_FORMAT_YCBCR444;
if (edid_ext[3] & EDID_CEA_YCRCB422)
info->color_formats |= DRM_COLOR_FORMAT_YCBCR422;
}

if (cea_db_offsets(edid_ext, &start, &end))
return;
Expand Down
8 changes: 4 additions & 4 deletions drivers/gpu/drm/selftests/test-drm_plane_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ int igt_check_plane_state(void *ignored)
{
int ret;

const struct drm_crtc_state crtc_state = {
static const struct drm_crtc_state crtc_state = {
.crtc = ZERO_SIZE_PTR,
.enable = true,
.active = true,
Expand All @@ -87,14 +87,14 @@ int igt_check_plane_state(void *ignored)
DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC)
},
};
struct drm_plane plane = {
static struct drm_plane plane = {
.dev = NULL
};
struct drm_framebuffer fb = {
static struct drm_framebuffer fb = {
.width = 2048,
.height = 2048
};
struct drm_plane_state plane_state = {
static struct drm_plane_state plane_state = {
.plane = &plane,
.crtc = ZERO_SIZE_PTR,
.fb = &fb,
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/ttm/ttm_range_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static int ttm_range_man_alloc(struct ttm_resource_manager *man,
spin_unlock(&rman->lock);

if (unlikely(ret)) {
ttm_resource_fini(man, *res);
ttm_resource_fini(man, &node->base);
kfree(node);
return ret;
}
Expand Down

0 comments on commit c73c357

Please sign in to comment.