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 6E186C07E9D for ; Mon, 26 Sep 2022 11:35:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 10C7210E2C2; Mon, 26 Sep 2022 11:35:50 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5445A10E2C2 for ; Mon, 26 Sep 2022 11:35:46 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6500,9779,10481"; a="301903778" X-IronPort-AV: E=Sophos;i="5.93,345,1654585200"; d="scan'208";a="301903778" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2022 04:35:45 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10481"; a="866090941" X-IronPort-AV: E=Sophos;i="5.93,345,1654585200"; d="scan'208";a="866090941" Received: from lsabisze-mobl.ger.corp.intel.com (HELO localhost) ([10.252.59.243]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2022 04:35:44 -0700 Resent-Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Resent-To: intel-gfx@lists.freedesktop.org Resent-From: Jani Nikula Resent-Date: Mon, 26 Sep 2022 14:35:24 +0300 Resent-Message-ID: <87illa2wsj.fsf@intel.com> Received: from linux.intel.com [10.54.29.200] by jnikula-mobl4.ger.corp.intel.com with IMAP (fetchmail-6.4.29) for (single-drop); Mon, 26 Sep 2022 13:45:13 +0300 (EEST) Received: from orsmga003.jf.intel.com (orsmga003.jf.intel.com [10.7.209.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id 85CF5580BE1; Mon, 26 Sep 2022 03:40:31 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6500,9779,10481"; a="572162502" X-IronPort-AV: E=Sophos;i="5.93,345,1654585200"; d="scan'208";a="572162502" Received: from fmsmga103.fm.intel.com ([10.1.193.90]) by orsmga003-1.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2022 03:40:31 -0700 X-IPAS-Result: =?us-ascii?q?A0GQAACigDFjmLHS/INQChsBAQEBAQEBAQUBAQESAQEBA?= =?us-ascii?q?wMBAQFAgU+BUmsBZ1iBAI1NhXGCJRl9kFWMajMUAQEBAQEBAQEBCSwLCAECB?= =?us-ascii?q?AEBAwSBTIghJzgTAQIEAQEBAQMCAQIBAQEBAQEDAQEBAgIBAQECAQEGAgEBA?= =?us-ascii?q?QECEAEBAQEBAQEBFAkZBRAOBSKFLzkNgjUFAgMfAQZuSj4BAQEBAQEBAQEBA?= =?us-ascii?q?QEBAQEBAQEBAQEBAQEBAQ8CCFJMAQEhAQMBATcMCikDAwECBgJEBAgDAVoSB?= =?us-ascii?q?YJ4AYMgAwEEC6l+gTSBAYNQAYRMgV8GgT2MAYRPEIFVRHobgnN1gmIDgTKGa?= =?us-ascii?q?QSZHjgDCQMHBSwdQQMLHw0WNQMVAxQDBSQHAxkPIw0NBB0MAwMFJQMCAhsHA?= =?us-ascii?q?gIDAgYTBQICNRg2CAQIBCskDwUCBy8FBC8CHgQFBhEIAhYCBgQEBAQVAhAIA?= =?us-ascii?q?ggmFwcTECMZAQUyJxAJIRwoDQUGEwMgbwUHPQ8oMWsrHRsKgQwqKBUDBAQDA?= =?us-ascii?q?gYTAwMiAhAqMRQEKRMS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zG5UonnHAqjBFYkLtp133Aq2lEZdPWaSL3sqy nIpoVh6faUskdoZJhOo7C90cO7LE/02JJx4ZYcJqfnUQH6tAKTQ72K07GStwEIdxeOldK0O8 9bAtlD4POZNykIsS/R2njGLz4YqOP3gJxBb4/lvgVQpHhRGt9dBmRCe3+m+y9NNW177EoCZf 2hD5F81kadkB0sB6zRahdlYwHtnay9qHuMW29iO/dI0njtsdtogISKaSRwpi1uNQ+mTt8ZgB X4emHCjJmejw== X-IronPort-Anti-Spam-Filtered: true X-IronPort-AV: E=McAfee;i="6500,9779,10481"; a="300975353" X-IronPort-AV: E=Sophos;i="5.93,345,1654585200"; d="scan'208";a="300975353" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from gabe.freedesktop.org ([131.252.210.177]) by mtab.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2022 03:40:30 -0700 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 15E6410E2C9; Mon, 26 Sep 2022 10:40:26 +0000 (UTC) Received: from smtp2.uni-freiburg.de (smtp2.uni-freiburg.de [IPv6:2001:7c0:2500:4::25:2]) by gabe.freedesktop.org (Postfix) with ESMTPS id 273E510E2CE for ; Mon, 26 Sep 2022 10:40:20 +0000 (UTC) Delivery-date: Mon, 26 Sep 2022 12:40:20 +0200 Received: from fe2.uni-freiburg.de ([132.230.2.222] helo=uni-freiburg.de) port 45042 by smtp2.uni-freiburg.de with esmtp ( Exim ) id 1oclX9-0003QU-0L for dri-devel@lists.freedesktop.org; Mon, 26 Sep 2022 12:40:18 +0200 Received: from [132.230.8.113] (account simon.rettberg@rz.uni-freiburg.de HELO computer) by mail.uni-freiburg.de (CommuniGate Pro SMTP 6.3.14) with ESMTPSA id 96347721; Mon, 26 Sep 2022 12:40:18 +0200 Date: Mon, 26 Sep 2022 12:40:17 +0200 From: Simon Rettberg To: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Message-ID: <20220926124017.529806df@computer> Organization: Rechenzentrum Uni Freiburg X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list Subject: [Intel-gfx] [PATCH RESEND] drm/display: Don't assume dual mode adaptors support i2c sub-addressing X-BeenThere: intel-gfx@lists.freedesktop.org List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , Thomas Zimmermann Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Current dual mode adaptor ("DP++") detection code assumes that all adaptors support i2c sub-addressing for read operations from the DP-HDMI adaptor ID buffer. It has been observed that multiple adaptors do not in fact support this, and always return data starting at register 0. On affected adaptors, the code failed to read the proper registers that would identify the device as a type 2 adaptor, and handled those as type 1, limiting the TMDS clock to 165MHz. Fix this by always reading the ID buffer starting from offset 0, and discarding any bytes before the actual offset of interest. Signed-off-by: Simon Rettberg Reviewed-by: Rafael Gieschke --- (Resend because of no response, probably my fault since I ran get_maintainers on a shallow clone and missed a bunch of people) We had problems with multiple different "4k ready" DP++ adaptors only resulting in 1080p resolution on Linux. While one of them turned out to actually just be a type1 adaptor, the others, according to the data retreived via i2cdump, were in fact proper type2 adaptors, advertising a TMDS clock of 300MHz. As it turned out, none of them supported sub-addressing when reading from the DP-HDMI adaptor ID buffer via i2c. The existing code suggested that this is known to happen with "broken" type1 adaptors, but evidently, type2 adaptors are also affected. We tried finding authoritative documentation on whether or not this is allowed behavior, but since all the official VESA docs are paywalled, the best we could come up with was the spec sheet for Texas Instruments' SNx5DP149 chip family.[1] It explicitly mentions that sub-adressing is supported for register writes, but *not* for reads (See NOTE in section 8.5.3). Unless TI blatantly and openly decided to violate the VESA spec, one could take that as a strong hint that sub-addressing is in fact not mandated by VESA. [1] https://www.ti.com/lit/ds/symlink/sn75dp149.pdf .../gpu/drm/display/drm_dp_dual_mode_helper.c | 52 ++++++++++--------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/display/drm_dp_dual_mode_helper.c b/drivers/gpu/drm/display/drm_dp_dual_mode_helper.c index 3ea53bb67..6147da983 100644 --- a/drivers/gpu/drm/display/drm_dp_dual_mode_helper.c +++ b/drivers/gpu/drm/display/drm_dp_dual_mode_helper.c @@ -63,23 +63,42 @@ ssize_t drm_dp_dual_mode_read(struct i2c_adapter *adapter, u8 offset, void *buffer, size_t size) { + int ret; + u8 zero = 0; + char *tmpbuf; + /* + * As sub-addressing is not supported by all adaptors, + * always explicitly read from the start and discard + * any bytes that come before the requested offset. + * This way, no matter whether the adaptor supports it + * or not, we'll end up reading the proper data. + */ struct i2c_msg msgs[] = { { .addr = DP_DUAL_MODE_SLAVE_ADDRESS, .flags = 0, .len = 1, - .buf = &offset, + .buf = &zero, }, { .addr = DP_DUAL_MODE_SLAVE_ADDRESS, .flags = I2C_M_RD, - .len = size, - .buf = buffer, + .len = size + offset, + .buf = NULL, }, }; - int ret; + tmpbuf = kmalloc(size + offset, GFP_KERNEL); + if (!tmpbuf) + return -ENOMEM; + + msgs[1].buf = tmpbuf; ret = i2c_transfer(adapter, msgs, ARRAY_SIZE(msgs)); + if (ret == ARRAY_SIZE(msgs)) + memcpy(buffer, tmpbuf + offset, size); + + kfree(tmpbuf); + if (ret < 0) return ret; if (ret != ARRAY_SIZE(msgs)) @@ -208,18 +227,6 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(const struct drm_device *dev, if (ret) return DRM_DP_DUAL_MODE_UNKNOWN; - /* - * Sigh. Some (maybe all?) type 1 adaptors are broken and ack - * the offset but ignore it, and instead they just always return - * data from the start of the HDMI ID buffer. So for a broken - * type 1 HDMI adaptor a single byte read will always give us - * 0x44, and for a type 1 DVI adaptor it should give 0x00 - * (assuming it implements any registers). Fortunately neither - * of those values will match the type 2 signature of the - * DP_DUAL_MODE_ADAPTOR_ID register so we can proceed with - * the type 2 adaptor detection safely even in the presence - * of broken type 1 adaptors. - */ ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_ADAPTOR_ID, &adaptor_id, sizeof(adaptor_id)); drm_dbg_kms(dev, "DP dual mode adaptor ID: %02x (err %zd)\n", adaptor_id, ret); @@ -233,11 +240,10 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(const struct drm_device *dev, return DRM_DP_DUAL_MODE_TYPE2_DVI; } /* - * If neither a proper type 1 ID nor a broken type 1 adaptor - * as described above, assume type 1, but let the user know - * that we may have misdetected the type. + * If not a proper type 1 ID, still assume type 1, but let + * the user know that we may have misdetected the type. */ - if (!is_type1_adaptor(adaptor_id) && adaptor_id != hdmi_id[0]) + if (!is_type1_adaptor(adaptor_id)) drm_err(dev, "Unexpected DP dual mode adaptor ID %02x\n", adaptor_id); } @@ -343,10 +349,8 @@ EXPORT_SYMBOL(drm_dp_dual_mode_get_tmds_output); * @enable: enable (as opposed to disable) the TMDS output buffers * * Set the state of the TMDS output buffers in the adaptor. For - * type2 this is set via the DP_DUAL_MODE_TMDS_OEN register. As - * some type 1 adaptors have problems with registers (see comments - * in drm_dp_dual_mode_detect()) we avoid touching the register, - * making this function a no-op on type 1 adaptors. + * type2 this is set via the DP_DUAL_MODE_TMDS_OEN register. + * Type1 adaptors do not support any register writes. * * Returns: * 0 on success, negative error code on failure -- 2.35.1