Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp866448ybc; Tue, 12 Nov 2019 10:23:22 -0800 (PST) X-Google-Smtp-Source: APXvYqyXYwvpewyEFsjCPwKOmqOT7ZnGMaT3knM6dbvGowYQrJrlFqL4iWPnWHFD2Yph6UB2d0T9 X-Received: by 2002:a17:906:1c59:: with SMTP id l25mr29296023ejg.98.1573583002013; Tue, 12 Nov 2019 10:23:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573583002; cv=none; d=google.com; s=arc-20160816; b=NK8Em1Y3ZiJzIfaoQCpSt0OiC7K9nlkwBMK8G8Gu/XI+lbWPe8tYFNBCzvy2NlOULZ NWIEgtgRFyb618GtlxXL2uRnvpp5YB421JCSECMUH7xVRWkBddcRLxsAAoPfZ/QobEcz 0ADvGRLWy3/dDVcpDp2a5fRQlqW3w2wi6YEsQePNZdHzAcNHjTOUdby6RYPT1jQh0gqB nCgPITkc2BQuR5ziBSrCLf3jhCsbkGaJBxi+RieWuAsPamypFneWc3C8K7ZR/X7RrKgr 5mTvn+Xsl6oKpQjXwcRXRjZnBVYwvaVXdibUAYaCTSVOWhlSY5cUq7DUl3Qs+DcZY9u3 TWIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=1zuYDebMJ/okDBHwgQg9Ko+/yuHAItkCB5r+xtn/gVU=; b=rGEc19S+hc63z0/aAVJoCckxk2x9yVMjFi6PckKqTmui+QPDf5RqypROIJ4u08NfTi P3d1nE1Or+fKaTSjO/sstKqYfSJvF5rXeujWQLI8ImEpevFxiHKMbZHxMBUY+UuSuTVR UQOIW/n2Gt4gWijMeFifM/STJkCbLV3emtJY7QNksN3vWYo8fAHqnfr5OzeSntPYCC2g zRREfDuy0CiYonsK2J3+BrbBHBY3cQAd7cdj2oXIgKHeZ/34r6vrLg9xlBHdCI6A0jzb 9vpzok9NKOW9PmjM4E/RbS3jOPPVwhIH7BY6F3Md1jNARnoKH/UU7fi19Z8ZliimORBi h6xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=HaUYgNK5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t8si500094ejj.328.2019.11.12.10.22.58; Tue, 12 Nov 2019 10:23:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=HaUYgNK5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727133AbfKLSWR (ORCPT + 99 others); Tue, 12 Nov 2019 13:22:17 -0500 Received: from mail-oi1-f193.google.com ([209.85.167.193]:42490 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727002AbfKLSWQ (ORCPT ); Tue, 12 Nov 2019 13:22:16 -0500 Received: by mail-oi1-f193.google.com with SMTP id i185so15700844oif.9 for ; Tue, 12 Nov 2019 10:22:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1zuYDebMJ/okDBHwgQg9Ko+/yuHAItkCB5r+xtn/gVU=; b=HaUYgNK5z9hM0u3S5tvMsLOyHp+WxD02EoIo6ZwYeUW263957WAxFCCsBoFlM9UhzK +buTc7LtUro3bpc0TqG0u6Z6VeA/LlU1zEzpQukJQXqBNlaxMssvSwsGZW1czxmeFtIY S0A/fo2QfFxG79cDQoAviXaOQt8kwPVegBvWo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1zuYDebMJ/okDBHwgQg9Ko+/yuHAItkCB5r+xtn/gVU=; b=kiiXnTL0Ch4DMXMfc4PXzmBn+ixNPSIRle4Ltg+l9ZN1Pbhi3XYiu3YK4VDY9y+TKd BJignIY4zSaB5vUR6JSFvAxoXOk91dzbdHiGpcjzexepgJoZO8hQrPS/M4T22We8xETP KFtVMuDyz3kMMWafYhSFoQsDtuUaDvt06OhSVQx6lhs1SdcC+id2rutr3cJ5UDKh4Umx ARyguloaiUGJ09bN8d3Fy5i3EPLymyQXEnUkfLcqZFlY6ZzGr1XjGh6ZAmkddkdalejS VNbtRo0mPeWIQPilaZtlIGy3czJnb2nkIulHG4+8VC7eY2LMsuFn+KWsjdyYuK04IFBf 61iA== X-Gm-Message-State: APjAAAUmXaJpFb//kgdi3piTGY2dlK6zUlewQ+7GsJV5BV9VH1U+iyhR m1Qp0d6X9Wer6MW4U/g5k9Lh+mxMsKN0ngz7+WsD1Q== X-Received: by 2002:aca:ead7:: with SMTP id i206mr292992oih.128.1573582935361; Tue, 12 Nov 2019 10:22:15 -0800 (PST) MIME-Version: 1.0 References: <20191112175940.GA13539@lst.de> In-Reply-To: <20191112175940.GA13539@lst.de> From: Daniel Vetter Date: Tue, 12 Nov 2019 19:22:01 +0100 Message-ID: Subject: Re: [PATCH] drm/bridge: fix anx6345 compilation for v5.5 To: Torsten Duwe Cc: Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Rutland , Thierry Reding , David Airlie , Andrzej Hajda , Laurent Pinchart , Icenowy Zheng , Sean Paul , Vasily Khoruzhick , Harald Geyer , Greg Kroah-Hartman , Thomas Gleixner , dri-devel , devicetree , Linux ARM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 12, 2019 at 6:59 PM Torsten Duwe wrote: > > > The anx6345 driver originally was copied from anx78xx.c, which has meanwhile > seen a few changes. In particular, the removal of drm_dp_link helpers and the > discontinuation to include drm_bridge.h from drm_crtc.h breaks compilation > in linux-5.5. Apply equivalents of these changes to anx6345.c. > > Signed-off-by: Torsten Duwe Wait ... Maxime pushed this and it never compiled? What's going on here? -Daniel > > --- > > The commits in question are ff1e8fb68ea06 and ee68c743f8d07, but I guess the > next rebase will change these. next-20191112 plus the anx6345-v5a series plus > this patch compile cleanly on arm64. > > --- a/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c > +++ b/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c > @@ -19,6 +19,7 @@ > #include > > #include > +#include > #include > #include > #include > @@ -49,7 +50,6 @@ struct anx6345 { > struct i2c_client *client; > struct edid *edid; > struct drm_connector connector; > - struct drm_dp_link link; > struct drm_panel *panel; > struct regulator *dvdd12; > struct regulator *dvdd25; > @@ -96,7 +96,7 @@ static ssize_t anx6345_aux_transfer(stru > static int anx6345_dp_link_training(struct anx6345 *anx6345) > { > unsigned int value; > - u8 dp_bw; > + u8 dp_bw, dpcd[2]; > int err; > > err = anx6345_clear_bits(anx6345->map[I2C_IDX_TXCOM], > @@ -144,18 +143,34 @@ static int anx6345_dp_link_training(stru > if (err) > return err; > > - /* Check link capabilities */ > - err = drm_dp_link_probe(&anx6345->aux, &anx6345->link); > - if (err < 0) { > - DRM_ERROR("Failed to probe link capabilities: %d\n", err); > - return err; > - } > + /* > + * Power up the sink (DP_SET_POWER register is only available on DPCD > + * v1.1 and later). > + */ > + if (anx6345->dpcd[DP_DPCD_REV] >= 0x11) { > + err = drm_dp_dpcd_readb(&anx6345->aux, DP_SET_POWER, &dpcd[0]); > + if (err < 0) { > + DRM_ERROR("Failed to read DP_SET_POWER register: %d\n", > + err); > + return err; > + } > + > + dpcd[0] &= ~DP_SET_POWER_MASK; > + dpcd[0] |= DP_SET_POWER_D0; > + > + err = drm_dp_dpcd_writeb(&anx6345->aux, DP_SET_POWER, dpcd[0]); > + if (err < 0) { > + DRM_ERROR("Failed to power up DisplayPort link: %d\n", > + err); > + return err; > + } > > - /* Power up the sink */ > - err = drm_dp_link_power_up(&anx6345->aux, &anx6345->link); > - if (err < 0) { > - DRM_ERROR("Failed to power up DisplayPort link: %d\n", err); > - return err; > + /* > + * According to the DP 1.1 specification, a "Sink Device must > + * exit the power saving state within 1 ms" (Section 2.5.3.1, > + * Table 5-52, "Sink Control Field" (register 0x600). > + */ > + usleep_range(1000, 2000); > } > > /* Possibly enable downspread on the sink */ > @@ -194,20 +209,28 @@ static int anx6345_dp_link_training(stru > if (err) > return err; > > - value = drm_dp_link_rate_to_bw_code(anx6345->link.rate); > + dpcd[0] = drm_dp_max_link_rate(anx6345->dpcd); > + dpcd[0] = drm_dp_link_rate_to_bw_code(dpcd[0]); > err = regmap_write(anx6345->map[I2C_IDX_DPTX], > - SP_DP_MAIN_LINK_BW_SET_REG, value); > + SP_DP_MAIN_LINK_BW_SET_REG, dpcd[0]); > if (err) > return err; > > + dpcd[1] = drm_dp_max_lane_count(anx6345->dpcd); > + > err = regmap_write(anx6345->map[I2C_IDX_DPTX], > - SP_DP_LANE_COUNT_SET_REG, anx6345->link.num_lanes); > + SP_DP_LANE_COUNT_SET_REG, dpcd[1]); > if (err) > return err; > > - err = drm_dp_link_configure(&anx6345->aux, &anx6345->link); > + if (drm_dp_enhanced_frame_cap(anx6345->dpcd)) > + dpcd[1] |= DP_LANE_COUNT_ENHANCED_FRAME_EN; > + > + err = drm_dp_dpcd_write(&anx6345->aux, DP_LINK_BW_SET, dpcd, > + sizeof(dpcd)); > + > if (err < 0) { > - DRM_ERROR("Failed to configure DisplayPort link: %d\n", err); > + DRM_ERROR("Failed to configure link: %d\n", err); > return err; > } > -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch