From patchwork Thu Aug 22 17:42:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13774030 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 055FFC3DA4A for ; Thu, 22 Aug 2024 17:43:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7DF4210EBA9; Thu, 22 Aug 2024 17:43:20 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="dSTCbzSX"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id C012510EBA4 for ; Thu, 22 Aug 2024 17:43:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724348597; x=1755884597; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=i3Og4DSzhtrQSTxfLP39BkArlK7UgB3WLEV/i5NW4xA=; b=dSTCbzSX6mAjZV9SVnc7/mrLo2C1INhCWw+enLQMXiV+MAoEMiT+7g5Y QmHq4lwsFeWxujq4TJmKfVS5yHpoXWc+6Y2XrGYvTCEKR2fEG6L9f0FL/ ZQNEcESzlePxSckAIZeejJLqglzu2rE7ILmHktjn8lRRQSUjRU9W5zdwZ T3+l2Eg8Kll/BMpVv2+dVwMR4rtsx8gNqoslfhctu7uUZnyXh85qSdBuZ 5/jCLvRlFFuOuLgWIG5m19W/espHc6OCqZaUHlFtZK/0zxgC/PZryqiZU LUENvZwH4RTpjsqXHJwexL+gb4m9p05D3PWfz4FZO8/9UO67pWQEe5cze g==; X-CSE-ConnectionGUID: 4h+nI8IYSTeC/MK7AF7cew== X-CSE-MsgGUID: 6DMpF2jzQXyWeM/GXaQgaw== X-IronPort-AV: E=McAfee;i="6700,10204,11172"; a="22955324" X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="22955324" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2024 10:43:08 -0700 X-CSE-ConnectionGUID: Dzay0dAJQLWVrLfl1k5fvg== X-CSE-MsgGUID: 0sKsIyrITyKVb5BbPtMoGQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="65862318" Received: from cpetruta-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.246.121]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2024 10:43:05 -0700 From: Jani Nikula To: dri-devel@lists.freedesktop.org Cc: jani.nikula@intel.com, Daniel Vetter , Alain Volmat , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Subject: [PATCH 1/6] drm/sti/sti_hdmi: convert to struct drm_edid Date: Thu, 22 Aug 2024 20:42:47 +0300 Message-Id: <25879a0183e30792bf0d63bdf56a03f11018e4a3.1724348429.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Prefer the struct drm_edid based functions for reading the EDID and updating the connector. The functional change is that the CEC physical address gets invalidated when the EDID could not be read. v2: Use drm_edid_read() instead of drm_edid_read_ddc() (Sima) Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula --- Cc: Alain Volmat Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann --- drivers/gpu/drm/sti/sti_hdmi.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c index b0d84440a87b..847470f747c0 100644 --- a/drivers/gpu/drm/sti/sti_hdmi.c +++ b/drivers/gpu/drm/sti/sti_hdmi.c @@ -974,28 +974,32 @@ static const struct drm_bridge_funcs sti_hdmi_bridge_funcs = { static int sti_hdmi_connector_get_modes(struct drm_connector *connector) { + const struct drm_display_info *info = &connector->display_info; struct sti_hdmi_connector *hdmi_connector = to_sti_hdmi_connector(connector); struct sti_hdmi *hdmi = hdmi_connector->hdmi; - struct edid *edid; + const struct drm_edid *drm_edid; int count; DRM_DEBUG_DRIVER("\n"); - edid = drm_get_edid(connector, hdmi->ddc_adapt); - if (!edid) - goto fail; + drm_edid = drm_edid_read(connector); + + drm_edid_connector_update(connector, drm_edid); - cec_notifier_set_phys_addr_from_edid(hdmi->notifier, edid); + cec_notifier_set_phys_addr(hdmi->notifier, + connector->display_info.source_physical_address); + + if (!drm_edid) + goto fail; - count = drm_add_edid_modes(connector, edid); - drm_connector_update_edid_property(connector, edid); + count = drm_edid_connector_add_modes(connector); DRM_DEBUG_KMS("%s : %dx%d cm\n", - (connector->display_info.is_hdmi ? "hdmi monitor" : "dvi monitor"), - edid->width_cm, edid->height_cm); + info->is_hdmi ? "hdmi monitor" : "dvi monitor", + info->width_mm / 10, info->height_mm / 10); - kfree(edid); + drm_edid_free(drm_edid); return count; fail: