From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Jackson Subject: Re: [PATCH] drm: parse color format support for digital displays Date: Fri, 15 Apr 2011 15:13:02 -0400 Message-ID: <4DA898BE.90506@redhat.com> References: <1302892813-4529-1-git-send-email-jbarnes@virtuousgeek.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTP id 822CE9E758 for ; Fri, 15 Apr 2011 12:13:05 -0700 (PDT) In-Reply-To: <1302892813-4529-1-git-send-email-jbarnes@virtuousgeek.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Jesse Barnes Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On 4/15/11 2:40 PM, Jesse Barnes wrote: > @@ -1461,6 +1462,15 @@ static void drm_add_display_info(struct edid *edid, > info->bpp = 0; > break; > } > + > + if (edid->features & DRM_EDID_FEATURE_RGB) > + info->color_formats = DRM_COLOR_FORMAT_RGB444; > + else if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB444) > + info->color_formats = DRM_COLOR_FORMAT_RGB444 | > + DRM_COLOR_FORMAT_YCRCB444; > + else if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB) > + info->color_formats = DRM_COLOR_FORMAT_RGB444 | > + DRM_COLOR_FORMAT_YCRCB444 | DRM_COLOR_FORMAT_YCRCB422; Overcomplicated (RGB is numerically 0, YCRCB is just two other values or'd together) and wrong (doesn't handle YCbCr 4:2:2 alone). You want: info->color_formats = DRM_COLOR_FORMAT_RGB444; if (edid->features & DRM_EDID_FEATURE_YCRCB444) info->color_formats |= DRM_COLOR_FORMAT_YCBCR444; if (edid->features & DRM_EDID_FEATURE_YCRCB422) info->color_formats |= DRM_COLOR_FORMAT_YCBCR422; ... which is corrected to not include RGB uselessly in the DRM_EDID_FEATURE_* tokens. I should have noticed that in your first patch, whoops. - ajax