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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 2D8EFC27C4F for ; Thu, 13 Jun 2024 07:15:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4/hMElvNkGwuxV1YCf7R2eIDL6Exl3jPKOH3w7/cJJY=; b=w/Yl2bztysYYtrJnb3Bs5Pg34+ TTXo7b7r1m0z+Yd80vJinHdP0vdltgq1S2ZAmVirFy/FnT1gGCHdeTIxB9y89yOih3VCFyP8b+P/X X9HSNUCzAqasNFPTHEG4K6Kq9pluPxCVSH+paWGJHJhmJ7hivcRDdqV2jIkbUUW2kkq6Bd8owW2oj Z3LpqLwsGrhTE3pIAUQ76WleWIzo/sL2qgJqe2Nqkd4vpRWxfRatzM3PshYcCkqkB64wCzAhaZEoc 5di5jytX8q5yyQSSAN27oUneLqxb4XxQcew984lHBrXjOsegfCbZaEh88/lxeFt1i7uGdzWy0LARu OSOkbhag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHegR-0000000FQvW-26Na; Thu, 13 Jun 2024 07:15:43 +0000 Received: from mgamail.intel.com ([192.198.163.10]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHegO-0000000FQun-2Z15 for linux-arm-kernel@lists.infradead.org; Thu, 13 Jun 2024 07:15:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718262940; x=1749798940; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version:content-transfer-encoding; bh=86SiUaK7umXo0q9XlMNvDC0EA+anrmucsKIX31UwYqg=; b=jct1BeQEjsySqgy8mDw9dUIUQaJ5yDv790e9TCJmHUXhuzO5aKUsq9IT cXtNfVlhskKcKn175GYdxJonGTZZ4FOBQtf4hmniuawbYaO0hZjw9bo1E 16oiN1omT4W3/K9rtyGYyg2jW8lqR8vEbVkUuj1KdPaAfuk7wybC3ylpB D51wQAM1aT+OoODp0vsFm1JWrM/H7OLJ4NpUx/XAKVR+mzHSBN1uMRFcg h/RynELHxBismJsr+R73XJvL0w/Z3MYgjvvRY0hT7v70L/V5ZxUSYASdb krouFfMDq9S7oGUVZdptm3VdEm6o3EJjV0K6OfqSjqs7lar+A7FOUZrrr Q==; X-CSE-ConnectionGUID: qkH7oUzHS7ixSG8tzGyzZg== X-CSE-MsgGUID: Ke73y668TiGZsjd0URCmQQ== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="26465960" X-IronPort-AV: E=Sophos;i="6.08,234,1712646000"; d="scan'208";a="26465960" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2024 00:15:28 -0700 X-CSE-ConnectionGUID: P844oO/hQ6eUOKxjKr+nYg== X-CSE-MsgGUID: FY0jzUReTNKGmfdBWQP2PA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,234,1712646000"; d="scan'208";a="71251354" Received: from iklimasz-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.246.112]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2024 00:15:23 -0700 From: Jani Nikula To: Inki Dae Cc: dri-devel@lists.freedesktop.org, Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: Re: [PATCH 04/11] drm/exynos: hdmi: convert to struct drm_edid In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <2fe0b4deb4f2ab255735cd6e1a657a17e0d45784.1715691257.git.jani.nikula@intel.com> Date: Thu, 13 Jun 2024 10:15:20 +0300 Message-ID: <87wmmtia9j.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240613_001540_688116_E3BF4A2E X-CRM114-Status: GOOD ( 20.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 10 Jun 2024, Inki Dae wrote: > Hi, Jani Nikula, > > Thanks for your contribution and sorry for being late. Below are my comme= nts. > > 2024=EB=85=84 5=EC=9B=94 14=EC=9D=BC (=ED=99=94) =EC=98=A4=ED=9B=84 9:57,= Jani Nikula =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: >> >> 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. >> >> Signed-off-by: Jani Nikula >> >> --- >> >> Cc: Inki Dae >> Cc: Seung-Woo Kim >> Cc: Kyungmin Park >> Cc: Krzysztof Kozlowski >> Cc: Alim Akhtar >> Cc: linux-arm-kernel@lists.infradead.org >> Cc: linux-samsung-soc@vger.kernel.org >> --- >> drivers/gpu/drm/exynos/exynos_hdmi.c | 23 +++++++++++++---------- >> 1 file changed, 13 insertions(+), 10 deletions(-) >> >> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exyn= os/exynos_hdmi.c >> index e968824a4c72..9033e8b66816 100644 >> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c >> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c >> @@ -883,27 +883,30 @@ static const struct drm_connector_funcs hdmi_conne= ctor_funcs =3D { >> static int hdmi_get_modes(struct drm_connector *connector) >> { >> struct hdmi_context *hdata =3D connector_to_hdmi(connector); >> - struct edid *edid; >> + const struct drm_display_info *info =3D &connector->display_info; >> + const struct drm_edid *drm_edid; >> int ret; >> >> if (!hdata->ddc_adpt) >> return 0; >> >> - edid =3D drm_get_edid(connector, hdata->ddc_adpt); >> - if (!edid) >> + drm_edid =3D drm_edid_read_ddc(connector, hdata->ddc_adpt); > > drm_edid_read_ddc function can return NULL for an error. Could you add > an exception handling? If it returns NULL, the below code intentionally passes NULL to drm_edid_connector_update() to reset the EDID. After that, cec_notifier_set_phys_addr() also resets the source physical address. And !drm_edid is handled after that. > >> + >> + drm_edid_connector_update(connector, drm_edid); > > Ditto. drm_edid_connector_update function can return a negative value > for an error. Okay.cg > >> + >> + cec_notifier_set_phys_addr(hdata->notifier, info->source_physica= l_address); >> + >> + if (!drm_edid) >> return 0; >> >> - hdata->dvi_mode =3D !connector->display_info.is_hdmi; >> + hdata->dvi_mode =3D !info->is_hdmi; > > Above change wouldn't be related to this patch. Yeah, reuses info which is for info->source_physical_address which would be too long otherwise. Can add another intermediate patch for that. > >> DRM_DEV_DEBUG_KMS(hdata->dev, "%s : width[%d] x height[%d]\n", >> (hdata->dvi_mode ? "dvi monitor" : "hdmi monit= or"), >> - edid->width_cm, edid->height_cm); >> - >> - drm_connector_update_edid_property(connector, edid); >> - cec_notifier_set_phys_addr_from_edid(hdata->notifier, edid); >> + info->width_mm / 10, info->height_mm / 10); > > The purpose of this patch would be to replace edid with drm_edid so > how about updating the above change like below? > drm_edid->edid->width_cm, erm_edid->edid->height_cm); struct drm_edid is an opaque type and drm_edid->edid is not available for drivers to look at. BR, Jani. > > Thanks, > Inki Dae > >> >> - ret =3D drm_add_edid_modes(connector, edid); >> + ret =3D drm_edid_connector_add_modes(connector); >> >> - kfree(edid); >> + drm_edid_free(drm_edid); >> >> return ret; >> } >> -- >> 2.39.2 >> >> --=20 Jani Nikula, Intel