From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF3D584D0F for ; Thu, 26 Dec 2024 12:46:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735217179; cv=none; b=M51K9sYlWWxAdZjn9aJe8PFVHuM7HM4LFcC7OVpcYCn4ZcO2PRdKVuj3ldisvqQOVNz6L4nAFSJ8oW9kUdHLRN3vuQPSRBgfRzfWA7Z8UJsdCufQT7y6l08nDHoe51WkPhDObO59vt0ExQJPzZN5sfnKRZXEt7B3D6zwXYgtLvI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735217179; c=relaxed/simple; bh=G3hUxADeUhWD6vBq6ggpg1KhvijnCggWuXdOn1Uf7ag=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RajbYq7wVMsZBwWi+pbMcA6jAbYqSLZUvSO4eA1W6NpsHMVnrL5VzGhiIpeozlVTKqopSVIbt4EGGI2Ni2H/IsBbnXgJ4wFthKfTbs5TNE5nt+TN8IS4duCPNqD5nWzYUnXiANjL8couKr53MXyYJCEV8ZiL7IJ/36ny6emXlBs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=aamVeHkM; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="aamVeHkM" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-43675b1155bso45754365e9.2 for ; Thu, 26 Dec 2024 04:46:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735217176; x=1735821976; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=UCdNvS5Djx3r+ijh8xS7MexSd/I3n9CUOOYzp0CujaU=; b=aamVeHkMGWcaLuFVGiZGAy2elUcUCgaORvnGLH2SeN+7a+wVSltAXiBFE3IFh/8oek uXG7kP31nzUnlfF6opcgieZfpZ4dF96ApwgR0lA+fhNhiyZOvftJn4HOPmh01FVka9nr C2XjxMzTGwTfxaKQRCtKuBUvoA2bz4Ed0jFEEtqDOn24GyZpoA6kyQYe26Zb1N8SZZ42 E+884Aie0zo9OvkQM2Y+gk9JRvSZudR3tt/wmXwDxw2UQOzR/B9p6QIs8qS8eVfekwZM xF2/juPF/yY+gBARehbmUwFNrkiRaA/YsqTnfqLrNvQZ3yVKwo76dXnNXX7CN4TjE7Q4 Xfdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735217176; x=1735821976; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=UCdNvS5Djx3r+ijh8xS7MexSd/I3n9CUOOYzp0CujaU=; b=i9S1oZQGvEQ2jrXpRkr3Bcc49nbHU4W0rqwz6VN9/NJJvVm4fQOJCwa2ItEKOTFlrJ H0d7UVWGAm0LOXdCQl8SQ2qT4OV790hm/bf2UDLGWg7vv6sj1hJbJ3qvo4E+w4xMNW3a cY/cZdcAQfUCYu4hHJvCZlkd2suC/hU0EiSd1Ub6pU044MG+kUZuBwo6fo11hG51k7eN a94Rxw0PIV49yCN9zIcmUAPb0DVW126rhUWG/cKkfDadvij1lE0EjjfNVY1kc5PXMBCY FqXAyGN9yMmp0vxZtt0SKDrrPHvugugqAbldPXhHygQRcn5rGu25h7Ci6Ivn3uQMRf0k yiUQ== X-Forwarded-Encrypted: i=1; AJvYcCXG+RdwFxEQsiJ1Wtm8/Xf14dSklzcDX7+eQbtfoGM9X0/eSkqk33q3jQBY1ojPg+96ddwBrYc01Dc66Eo=@vger.kernel.org X-Gm-Message-State: AOJu0YyfPE5FEH62IUUgMWw/Asevu8zx+kkovuPJQ9dkTF031GWrHp8G xUsWWrPplMgHcFjZU+KlzEk3su1AVJz2l50qU87cD7+pdxLoN4RsdcdCA5S3/J8= X-Gm-Gg: ASbGncsHj8GouT2pLPOcIekLwwm9drkAgLoJQ2ch8UL456+L9Xsiq/tXdfBocdeweut 1NRM2EuGp/eFSag+0Jno0q9RHp2tqaBkjhygx+Qb0/q4eh4ENTohTqi7ugiaboil2dRnyBVIncC ZZaUu45ggt1uoB1FWMRr4wyw3TZA3hqE5y0Tusv0Sc2Qw+4KPo4NmVlA4nRzxRKY80lDiyB6GgM YzS3UGBTfMptedz313zRL3lnegvZ87yqmELNAzouSetWWmaFlsL20k= X-Google-Smtp-Source: AGHT+IFdoO/zxiQ3FIpGhucTVIgGS2pedJeFOAxfk444aPe9ZZVT8fXnThIsGtTdQljhl+HRLuLbag== X-Received: by 2002:a05:600c:1c1a:b0:436:1b81:b65c with SMTP id 5b1f17b1804b1-43668646aebmr214219565e9.15.1735217176112; Thu, 26 Dec 2024 04:46:16 -0800 (PST) Received: from linaro.org ([82.76.168.176]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436611ea40csm231612665e9.1.2024.12.26.04.46.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Dec 2024 04:46:14 -0800 (PST) Date: Thu, 26 Dec 2024 14:46:12 +0200 From: Abel Vesa To: Johan Hovold Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Karol Herbst , Lyude Paul , Danilo Krummrich , Jani Nikula , Rodrigo Vivi , Joonas Lahtinen , Tvrtko Ursulin , Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , Bjorn Andersson , Konrad Dybcio , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, nouveau@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: Re: [PATCH v2 4/4] drm/msm/dp: Add support for LTTPR handling Message-ID: References: <20241211-drm-dp-msm-add-lttpr-transparent-mode-set-v2-0-d5906ed38b28@linaro.org> <20241211-drm-dp-msm-add-lttpr-transparent-mode-set-v2-4-d5906ed38b28@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On 24-12-11 15:56:53, Johan Hovold wrote: > On Wed, Dec 11, 2024 at 03:04:15PM +0200, Abel Vesa wrote: > > > +static void msm_dp_display_lttpr_init(struct msm_dp_display_private *dp) > > +{ > > + int lttpr_count; > > + > > + if (drm_dp_read_lttpr_common_caps(dp->aux, dp->panel->dpcd, > > + dp->lttpr_caps)) > > + return; > > + > > + lttpr_count = drm_dp_lttpr_count(dp->lttpr_caps); > > I was gonna say shouldn't you handle errors here, but that explains the > non-negative check I commented on the first patch in the series. So lttpr_count is a bit weird. It's either between 0 and 8, or -ERANGE if more than 8 LTTPRs are found, or -EINVAL if for some reason the DP_PHY_REPEATER_CNT register contains an invalid value. (see drm_dp_lttpr_count()) Now, I think I should just drop the lttr_count local variable here entirely. > > This looks error prone, but I think you should at least update the > kernel doc comment to drm_dp_lttpr_init() in the first patch so that > it's clear that you pass in the number of LTTPRs *or* an errno. Yes, I'll do that. Will mention all possible values and what they mean. And will probably point to the drm_dp_lttpr_count() as well, just to be safe. > > > + > > + drm_dp_lttpr_init(dp->aux, lttpr_count); > > +} > > + > > static int msm_dp_display_process_hpd_high(struct msm_dp_display_private *dp) > > { > > struct drm_connector *connector = dp->msm_dp_display.connector; > > const struct drm_display_info *info = &connector->display_info; > > int rc = 0; > > > > + msm_dp_display_lttpr_init(dp); > > It looks like you ignore errors on purpose so I guess that's fine. Maybe I should at least throw an error, just like the i915 does. Will do that. > > > + > > rc = msm_dp_panel_read_sink_caps(dp->panel, connector); > > if (rc) > > goto end; > > Either way, this is needed for external display on my x1e80100 machines, > while not breaking the X13s: > > Tested-by: Johan Hovold > > Johan Thanks for reviewing and testing, Abel