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 X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31669C433E0 for ; Tue, 26 May 2020 12:29:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 03B692084C for ; Tue, 26 May 2020 12:29:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="hqfyLgQ0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389021AbgEZM3t (ORCPT ); Tue, 26 May 2020 08:29:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389019AbgEZM3s (ORCPT ); Tue, 26 May 2020 08:29:48 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3FEAC03E96D for ; Tue, 26 May 2020 05:29:48 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id h4so2942742wmb.4 for ; Tue, 26 May 2020 05:29:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:autocrypt:organization:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Y230r+Ddol1M9ve3nhIsJQdcvD+QKUWtZpGQcDpUxIc=; b=hqfyLgQ0k/zA+nbpg7eGkkX03cxHD4KhcS3G+KJjWPA9igiZOQ3Wprv6IQTuqeexLO O7SKDSIsgp7ituAuHwJZkF40zbG0lkhWMUW3EfhJCvAzqVfbLVHz/der0L/2A3xUn6+G eBGXBFca5GEuWVEJcPgibRm6Ez/wqa7PGDfJnMkzT3A311sXQMMD/A3gs25+bUTCrKTr rxUiKkqyoFle8v7m9ZGmxC9Et7PSsNdMBKHYB1FtGifwPMOIjD8oyL/kbE2mPJyPj62Q j2ObJcd5YSOCwSvDqxfFYRIk3HqxXWiTfk1vLOmcUG5QBbpwFKesYIPFg1MKup2ctILL 3ISQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :organization:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Y230r+Ddol1M9ve3nhIsJQdcvD+QKUWtZpGQcDpUxIc=; b=dW1FoKNt0kPkUYS3GzxjBBcnPLVhIUjZ/dozkFslWx1rZnbJ1sUeJDoUbJzfKU3wBx VRgeavAPOVLvkQhSdPOk0RerJLNKz+riTiGHbvAwz/7dtmWoNUhcSWcFxyt9lLDPrZfy 8BBnfF355FG8uh46NLU6J5Mz8pqI56AedIjh7T32Ma+NL6JDut7yAbYZcrJKZv8vyozV iPc17wYNjdhyMPtijDIS0elYghq8HJ0V/S5ug3hWVyumokBBU/J1cmkrUTIFNqQRntjV oIHNWh3gObrPk8nneB8GA7eKFhIanEcfmOrsApCCgzndqRchObwHtZhilRRGtr6sJdQn 1yUg== X-Gm-Message-State: AOAM532hq0jSk6auwJiSdSOgdWRWooRR3bInxY2O7ExSAm3DyPg91DN3 u2D4uIzwSaLpR1mhzGX/FSfzibh8VAHPbg== X-Google-Smtp-Source: ABdhPJzxKOpRhbvQDSX4+9IsbCHicqyzzMx5o7tTUcd6sZQdzu2v3yaBZPLACZWvlyjI/7iuTPOMlQ== X-Received: by 2002:a1c:998c:: with SMTP id b134mr1282922wme.78.1590496187224; Tue, 26 May 2020 05:29:47 -0700 (PDT) Received: from ?IPv6:2a01:e35:2ec0:82b0:acf8:18a8:b3a5:a17b? ([2a01:e35:2ec0:82b0:acf8:18a8:b3a5:a17b]) by smtp.gmail.com with ESMTPSA id q5sm1157605wrm.62.2020.05.26.05.29.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 26 May 2020 05:29:46 -0700 (PDT) Subject: Re: [PATCH 21/27] drm: bridge: dw-hdmi: Pass drm_connector to internal functions as needed To: Laurent Pinchart , dri-devel@lists.freedesktop.org Cc: linux-renesas-soc@vger.kernel.org, Andrzej Hajda , Jernej Skrabec , Jonas Karlman , Sam Ravnborg , Kieran Bingham References: <20200526011505.31884-1-laurent.pinchart+renesas@ideasonboard.com> <20200526011505.31884-22-laurent.pinchart+renesas@ideasonboard.com> From: Neil Armstrong Autocrypt: addr=narmstrong@baylibre.com; prefer-encrypt=mutual; keydata= xsBNBE1ZBs8BCAD78xVLsXPwV/2qQx2FaO/7mhWL0Qodw8UcQJnkrWmgTFRobtTWxuRx8WWP GTjuhvbleoQ5Cxjr+v+1ARGCH46MxFP5DwauzPekwJUD5QKZlaw/bURTLmS2id5wWi3lqVH4 BVF2WzvGyyeV1o4RTCYDnZ9VLLylJ9bneEaIs/7cjCEbipGGFlfIML3sfqnIvMAxIMZrvcl9 qPV2k+KQ7q+aXavU5W+yLNn7QtXUB530Zlk/d2ETgzQ5FLYYnUDAaRl+8JUTjc0CNOTpCeik 80TZcE6f8M76Xa6yU8VcNko94Ck7iB4vj70q76P/J7kt98hklrr85/3NU3oti3nrIHmHABEB AAHNKE5laWwgQXJtc3Ryb25nIDxuYXJtc3Ryb25nQGJheWxpYnJlLmNvbT7CwHsEEwEK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/0FnqydfId95s+eej+17ldGp lMv1ok7K0H/WJSdr7UwDAHEYU++p4RRTJP6DHWXcByVlpNQ4SSAiivmWiwOt490+Ac7ATQRN WQbPAQgAvIoM384ZRFocFXPCOBir5m2J+96R2tI2XxMgMfyDXGJwFilBNs+fpttJlt2995A8 0JwPj8SFdm6FBcxygmxBBCc7i/BVQuY8aC0Z/w9Vzt3Eo561r6pSHr5JGHe8hwBQUcNPd/9l 2ynP57YTSE9XaGJK8gIuTXWo7pzIkTXfN40Wh5jeCCspj4jNsWiYhljjIbrEj300g8RUT2U0 FcEoiV7AjJWWQ5pi8lZJX6nmB0lc69Jw03V6mblgeZ/1oTZmOepkagwy2zLDXxihf0GowUif GphBDeP8elWBNK+ajl5rmpAMNRoKxpN/xR4NzBg62AjyIvigdywa1RehSTfccQARAQABwsBf BBgBAgAJBQJNWQbPAhsMAAoJEBaat7Gkz/iuteIH+wZuRDqK0ysAh+czshtG6JJlLW6eXJJR Vi7dIPpgFic2LcbkSlvB8E25Pcfz/+tW+04Urg4PxxFiTFdFCZO+prfd4Mge7/OvUcwoSub7 ZIPo8726ZF5/xXzajahoIu9/hZ4iywWPAHRvprXaim5E/vKjcTeBMJIqZtS4u/UK3EpAX59R XVxVpM8zJPbk535ELUr6I5HQXnihQm8l6rt9TNuf8p2WEDxc8bPAZHLjNyw9a/CdeB97m2Tr zR8QplXA5kogS4kLe/7/JmlDMO8Zgm9vKLHSUeesLOrjdZ59EcjldNNBszRZQgEhwaarfz46 BSwxi7g3Mu7u5kUByanqHyA= Organization: Baylibre Message-ID: <235cc8f1-bfba-cf3a-50f0-f6d1b977e9fb@baylibre.com> Date: Tue, 26 May 2020 14:29:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200526011505.31884-22-laurent.pinchart+renesas@ideasonboard.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org On 26/05/2020 03:14, Laurent Pinchart wrote: > To prepare for making connector creation optional in the driver, pass > the drm_connector explicitly to the internal functions that require it. > The functions that still access the connector from the dw_hdmi structure > are dw_hdmi_connector_create() and __dw_hdmi_probe(). The former access > is expected, as that's where the internal connector is created. The > latter will be addressed separately. > > Signed-off-by: Laurent Pinchart > --- > drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 31 +++++++++++++---------- > 1 file changed, 18 insertions(+), 13 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > index 16bffedb4715..b69c14b9de62 100644 > --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > @@ -1632,18 +1632,17 @@ static void hdmi_tx_hdcp_config(struct dw_hdmi *hdmi) > } > > static void hdmi_config_AVI(struct dw_hdmi *hdmi, > + const struct drm_connector *connector, > const struct drm_display_mode *mode) > { > struct hdmi_avi_infoframe frame; > u8 val; > > /* Initialise info frame from DRM mode */ > - drm_hdmi_avi_infoframe_from_display_mode(&frame, > - &hdmi->connector, mode); > + drm_hdmi_avi_infoframe_from_display_mode(&frame, connector, mode); > > if (hdmi_bus_fmt_is_rgb(hdmi->hdmi_data.enc_out_bus_format)) { > - drm_hdmi_avi_infoframe_quant_range(&frame, &hdmi->connector, > - mode, > + drm_hdmi_avi_infoframe_quant_range(&frame, connector, mode, > hdmi->hdmi_data.rgb_limited_range ? > HDMI_QUANTIZATION_RANGE_LIMITED : > HDMI_QUANTIZATION_RANGE_FULL); > @@ -1760,14 +1759,14 @@ static void hdmi_config_AVI(struct dw_hdmi *hdmi, > } > > static void hdmi_config_vendor_specific_infoframe(struct dw_hdmi *hdmi, > + const struct drm_connector *connector, > const struct drm_display_mode *mode) > { > struct hdmi_vendor_infoframe frame; > u8 buffer[10]; > ssize_t err; > > - err = drm_hdmi_vendor_infoframe_from_display_mode(&frame, > - &hdmi->connector, > + err = drm_hdmi_vendor_infoframe_from_display_mode(&frame, connector, > mode); > if (err < 0) > /* > @@ -1813,9 +1812,10 @@ static void hdmi_config_vendor_specific_infoframe(struct dw_hdmi *hdmi, > HDMI_FC_DATAUTO0_VSD_MASK); > } > > -static void hdmi_config_drm_infoframe(struct dw_hdmi *hdmi) > +static void hdmi_config_drm_infoframe(struct dw_hdmi *hdmi, > + const struct drm_connector *connector) > { > - const struct drm_connector_state *conn_state = hdmi->connector.state; > + const struct drm_connector_state *conn_state = connector->state; > struct hdmi_drm_infoframe frame; > u8 buffer[30]; > ssize_t err; > @@ -2118,9 +2118,9 @@ static void hdmi_disable_overflow_interrupts(struct dw_hdmi *hdmi) > } > > static int dw_hdmi_setup(struct dw_hdmi *hdmi, > + const struct drm_connector *connector, > const struct drm_display_mode *mode) > { > - struct drm_connector *connector = &hdmi->connector; > int ret; > > hdmi_disable_overflow_interrupts(hdmi); > @@ -2192,9 +2192,9 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, > dev_dbg(hdmi->dev, "%s HDMI mode\n", __func__); > > /* HDMI Initialization Step F - Configure AVI InfoFrame */ > - hdmi_config_AVI(hdmi, mode); > - hdmi_config_vendor_specific_infoframe(hdmi, mode); > - hdmi_config_drm_infoframe(hdmi); > + hdmi_config_AVI(hdmi, connector, mode); > + hdmi_config_vendor_specific_infoframe(hdmi, connector, mode); > + hdmi_config_drm_infoframe(hdmi, connector); > } else { > dev_dbg(hdmi->dev, "%s DVI mode\n", __func__); > } > @@ -2263,7 +2263,12 @@ static void initialize_hdmi_ih_mutes(struct dw_hdmi *hdmi) > static void dw_hdmi_poweron(struct dw_hdmi *hdmi) > { > hdmi->bridge_is_on = true; > - dw_hdmi_setup(hdmi, &hdmi->previous_mode); > + > + /* > + * The curr_conn field is guaranteed to be valid here, as this function > + * is only be called when !hdmi->disabled. > + */ > + dw_hdmi_setup(hdmi, hdmi->curr_conn, &hdmi->previous_mode); > } > > static void dw_hdmi_poweroff(struct dw_hdmi *hdmi) > Reviewed-by: Neil Armstrong