From patchwork Fri Sep 1 14:20:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13372653 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 4D242CA0FE1 for ; Fri, 1 Sep 2023 14:20:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8D0E210E7E6; Fri, 1 Sep 2023 14:20:48 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3061310E7E3; Fri, 1 Sep 2023 14:20:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693578045; x=1725114045; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=NcNTJoWBCz4pcOJ5OZrcNHVcXIXMXaCUJdWopodVHnw=; b=T0caLAP/bQjo3v74BbM3ddezee3gr7YPdmZDaYme4Oas+mRjxgRQuADT IMGM8DUYqn6tRnJODnXtwI+d4LCa3KU78AfFDfluUEfgEaYNkINwvWxKj VcS4PyGgxAhMUf4fz6rWmAwhQ+PKSQkKwSHxyJu3WzIz193kZsxe0fya3 lSCTXr4dYYwPSRkOzcntYQtDFQMnPCE66mmnKYwFz0Z09OZybOpcktN8b EReHr7LzDsgJhjCiN9DcPQThza0n95DI6pv6zCR+udzfsGLI1EhqYec9m Yxn7ISrnXxPbnms6p9Bh3oUtz/ESpAFq7w/36vUOJXPpjOVQ3mrJ8Gl6Y Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10819"; a="442623862" X-IronPort-AV: E=Sophos;i="6.02,219,1688454000"; d="scan'208";a="442623862" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2023 07:20:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10819"; a="883198379" X-IronPort-AV: E=Sophos;i="6.02,219,1688454000"; d="scan'208";a="883198379" Received: from epronina-mobl.ccr.corp.intel.com (HELO localhost) ([10.252.34.21]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2023 07:20:43 -0700 From: Jani Nikula To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/msm/dp: skip validity check for DP CTS EDID checksum Date: Fri, 1 Sep 2023 17:20:34 +0300 Message-Id: <20230901142034.580802-1-jani.nikula@intel.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: freedreno@lists.freedesktop.org, jani.nikula@intel.com, linux-arm-msm@vger.kernel.org, Abhinav Kumar , Stephen Boyd , Kuogee Hsieh , Dmitry Baryshkov , Marijn Suijten , Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The DP CTS test for EDID last block checksum expects the checksum for the last block, invalid or not. Skip the validity check. For the most part (*), the EDIDs returned by drm_get_edid() will be valid anyway, and there's the CTS workaround to get the checksum for completely invalid EDIDs. See commit 7948fe12d47a ("drm/msm/dp: return correct edid checksum after corrupted edid checksum read"). This lets us remove one user of drm_edid_block_valid() with hopes the function can be removed altogether in the future. (*) drm_get_edid() ignores checksum errors on CTA extensions. Cc: Abhinav Kumar Cc: Dmitry Baryshkov Cc: Kuogee Hsieh Cc: Marijn Suijten Cc: Rob Clark Cc: Sean Paul Cc: Stephen Boyd Cc: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org Signed-off-by: Jani Nikula Reviewed-by: Stephen Boyd Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/dp/dp_panel.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_panel.c b/drivers/gpu/drm/msm/dp/dp_panel.c index 42d52510ffd4..86a8e06c7a60 100644 --- a/drivers/gpu/drm/msm/dp/dp_panel.c +++ b/drivers/gpu/drm/msm/dp/dp_panel.c @@ -289,26 +289,9 @@ int dp_panel_get_modes(struct dp_panel *dp_panel, static u8 dp_panel_get_edid_checksum(struct edid *edid) { - struct edid *last_block; - u8 *raw_edid; - bool is_edid_corrupt = false; + edid += edid->extensions; - if (!edid) { - DRM_ERROR("invalid edid input\n"); - return 0; - } - - raw_edid = (u8 *)edid; - raw_edid += (edid->extensions * EDID_LENGTH); - last_block = (struct edid *)raw_edid; - - /* block type extension */ - drm_edid_block_valid(raw_edid, 1, false, &is_edid_corrupt); - if (!is_edid_corrupt) - return last_block->checksum; - - DRM_ERROR("Invalid block, no checksum\n"); - return 0; + return edid->checksum; } void dp_panel_handle_sink_request(struct dp_panel *dp_panel)