From patchwork Thu Sep 7 09:28:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13376310 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 1D664EE14D3 for ; Thu, 7 Sep 2023 09:28:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 96C1D10E602; Thu, 7 Sep 2023 09:28:34 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id BDEC810E7A5; Thu, 7 Sep 2023 09:28:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694078911; x=1725614911; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=VR8ecihM1JOlQ241fsn2DNPwPweNXHAdsPsF4oEUxvE=; b=Fuz9A6Es4Te5ITYjxz+q3SGuXLyfOzHRQYqYLEr2/cUHY1lrPWazcN6R Q+Sdsuuv1E9G0GAB8cFQgBTlFimNoK2JEG0LDExSSnzKVC69Bq4IT2Zb/ 6M7GizHpCJ/upVPmsOUeL3lR12Ijjtr2a4k3+/qv4Qy5rwPNmbP32BJj/ xzHMFM6BrYB0TT2QFty+bc/MVE1MDk3gq7j52mhZSFG9kmB4snWx+pg+o pD1KNa5SY/+B9MrRruUf+Wc6jr+8IQLpwra09ef4F1fgjqyYXOWJJKPnJ 0pdGZ+WeqUWZ4Wt0q7fwOCG2GqNCHSB8xQpel9f2o25OAb7LydXZ8dBa0 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10825"; a="443690208" X-IronPort-AV: E=Sophos;i="6.02,234,1688454000"; d="scan'208";a="443690208" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2023 02:28:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10825"; a="741958623" X-IronPort-AV: E=Sophos;i="6.02,234,1688454000"; d="scan'208";a="741958623" Received: from iraduica-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.61.21]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2023 02:28:29 -0700 From: Jani Nikula To: dri-devel@lists.freedesktop.org Date: Thu, 7 Sep 2023 12:28:18 +0300 Message-Id: X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Subject: [Intel-gfx] [PATCH 0/6] drm/edid: split out drm_eld.[ch], add some SAD helpers 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: jani.nikula@intel.com, intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Split out drm_eld.[ch] from drm_edid.h, add some helpers to convert and modify SADs. This should make it easier and more robust to implement things like [1], with ELD parsing details hidden in drm_eld.[ch]. for (i = 0; i < drm_eld_sad_count(eld); i++) { struct cea_sad sad; drm_eld_sad_get(eld, i, &sad); /* do stuff with sad */ drm_eld_sad_set(eld, i, &sad); } struct cea_sad provides an easier way to manipulate CTA SADs. ** UNTESTED *** Cc: Mitul Golani [1] https://patchwork.freedesktop.org/patch/msgid/20230821160004.2821445-4-mitulkumar.ajitkumar.golani@intel.com Jani Nikula (6): drm/edid: split out drm_eld.h from drm_edid.h drm/eld: replace uint8_t with u8 drm/edid: include drm_eld.h only where required drm/edid: use a temp variable for sads to drop one level of dereferences drm/edid: add helpers to get/set struct cea_sad from/to 3-byte sad drm/eld: add helpers to modify the SADs of an ELD Documentation/gpu/drm-kms-helpers.rst | 6 + drivers/gpu/drm/Makefile | 1 + .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 + drivers/gpu/drm/drm_edid.c | 42 +++-- drivers/gpu/drm/drm_eld.c | 55 ++++++ drivers/gpu/drm/drm_internal.h | 6 + drivers/gpu/drm/i915/display/intel_audio.c | 1 + .../drm/i915/display/intel_crtc_state_dump.c | 1 + drivers/gpu/drm/i915/display/intel_sdvo.c | 1 + drivers/gpu/drm/nouveau/dispnv50/disp.c | 1 + drivers/gpu/drm/radeon/radeon_audio.c | 1 + drivers/gpu/drm/tegra/hdmi.c | 1 + drivers/gpu/drm/tegra/sor.c | 1 + include/drm/drm_edid.h | 148 ---------------- include/drm/drm_eld.h | 164 ++++++++++++++++++ sound/core/pcm_drm_eld.c | 1 + sound/soc/codecs/hdac_hdmi.c | 1 + sound/soc/codecs/hdmi-codec.c | 1 + sound/x86/intel_hdmi_audio.c | 1 + 19 files changed, 274 insertions(+), 160 deletions(-) create mode 100644 drivers/gpu/drm/drm_eld.c create mode 100644 include/drm/drm_eld.h