From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AB948C004D4 for ; Thu, 19 Jan 2023 09:44:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2540C10E8F9; Thu, 19 Jan 2023 09:44:52 +0000 (UTC) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 85E9910E8F9; Thu, 19 Jan 2023 09:44:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674121490; x=1705657490; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version:content-transfer-encoding; bh=U3EqrDiAkrpvGPp19lKpBXSBAnqRZO17cVfx+J/OnfI=; b=PGffCXOadDgV7uhowGYdL4QdqEdqkVckLZaNJrtAjK82yPk/MgoMUKjP Dy6PKbRtCszg2WLf8w2fHN1/9rBoNar7GACnWoRgkMPYN6c7xOCPl7Rzv fWRTf3+hr+Xk/8uHP+TfQv6FX4yMA9m97XyD5d/xZdB7IuQajoyHEkVwV YZx89yh4LPqS06FHIaPIgB26v0ks8UxNabEKZt6eie8u+o3+VbiB6Qdse mJUwGUj8Zdf5TaSRBuXSCmEMeojG2qpCNwjBPhOpipDOLPg9gBKJNanLj OF6zI659p2sjLNr6UBFzLfCOVQMs+Ja7YLusn4HTi2ov/RMXBFPqXiJoS g==; X-IronPort-AV: E=McAfee;i="6500,9779,10594"; a="304926344" X-IronPort-AV: E=Sophos;i="5.97,228,1669104000"; d="scan'208";a="304926344" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2023 01:44:50 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10594"; a="653299927" X-IronPort-AV: E=Sophos;i="5.97,228,1669104000"; d="scan'208";a="653299927" Received: from sarahgar-mobl.ger.corp.intel.com (HELO localhost) ([10.252.15.69]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2023 01:44:48 -0800 From: Jani Nikula To: Ville =?utf-8?B?U3lyasOkbMOk?= In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: Date: Thu, 19 Jan 2023 11:44:45 +0200 Message-ID: <875yd2dfjm.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Intel-gfx] [PATCH v7 10/22] drm/edid: add helper for HDMI VSDB audio latency field length X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Wed, 18 Jan 2023, Ville Syrj=C3=A4l=C3=A4 wrote: > On Wed, Jan 04, 2023 at 12:05:25PM +0200, Jani Nikula wrote: >> Add a helper for skipping the HDMI VSDB audio latency fields. >>=20 >> There's a functional change for HDMI VSDB blocks that do not respect the >> spec: "I_Latency_Fields_Present shall be zero if Latency_Fields_Present >> is zero". We assume this to hold when skipping the latency fields, and >> ignore non-zero I_Latency_Fields_Present if Latency_Fields_Present is >> zero. >>=20 >> Cc: Ville Syrj=C3=A4l=C3=A4 >> Signed-off-by: Jani Nikula > > Reviewed-by: Ville Syrj=C3=A4l=C3=A4 Thanks for the reviews so far, pushed up to and including this patch to drm-misc-next. BR, Jani. > >> --- >> drivers/gpu/drm/drm_edid.c | 18 +++++++++++------- >> 1 file changed, 11 insertions(+), 7 deletions(-) >>=20 >> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c >> index 847076b29594..93067b8dd9f6 100644 >> --- a/drivers/gpu/drm/drm_edid.c >> +++ b/drivers/gpu/drm/drm_edid.c >> @@ -4695,6 +4695,16 @@ static bool hdmi_vsdb_i_latency_present(const u8 = *db) >> return hdmi_vsdb_latency_present(db) && db[8] & BIT(6); >> } >>=20=20 >> +static int hdmi_vsdb_latency_length(const u8 *db) >> +{ >> + if (hdmi_vsdb_i_latency_present(db)) >> + return 4; >> + else if (hdmi_vsdb_latency_present(db)) >> + return 2; >> + else >> + return 0; >> +} >> + >> /* >> * do_hdmi_vsdb_modes - Parse the HDMI Vendor Specific data block >> * @connector: connector corresponding to the HDMI sink >> @@ -4720,13 +4730,7 @@ do_hdmi_vsdb_modes(struct drm_connector *connecto= r, const u8 *db, u8 len) >> if (!(db[8] & (1 << 5))) >> goto out; >>=20=20 >> - /* Latency_Fields_Present */ >> - if (db[8] & (1 << 7)) >> - offset +=3D 2; >> - >> - /* I_Latency_Fields_Present */ >> - if (db[8] & (1 << 6)) >> - offset +=3D 2; >> + offset +=3D hdmi_vsdb_latency_length(db); >>=20=20 >> /* the declared length is not long enough for the 2 first bytes >> * of additional video format capabilities */ >> --=20 >> 2.34.1 --=20 Jani Nikula, Intel Open Source Graphics Center