Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp8441090rwd; Tue, 20 Jun 2023 15:27:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6uXIe8xpPaKhlNO/i6MviFJIfvy8E6vUMiy/DRKuGU7Mpdn1q4omvt/TlgzWeKnK521rB7 X-Received: by 2002:a05:6a00:1911:b0:659:ae1c:c9e2 with SMTP id y17-20020a056a00191100b00659ae1cc9e2mr11081109pfi.17.1687300060886; Tue, 20 Jun 2023 15:27:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687300060; cv=none; d=google.com; s=arc-20160816; b=tgbwISRSG9LSPGSZu9fZ6SHVyoBmlGDmAdappRMWUW90EZiybSX4JmOBUO4DCd8O+g k3sL7+lQKQ0kMzjtFxrlifkluz6L8Zk+25Cucq2JFBlQ8Q1nOPA69rrGG1Bc/jNrpxsH lTaxh+q3PveT0JS+e9c8lkCbLdz+COtIzAuFxQciW/h1drws9JkvTgHj5aytcm3Q8jtK k/6UXg6bKN1Up0bn9KCyeeIG5FpndUTlpectF/gMHKU08lUisOdDWAUycKG/lNqAtFvx X1ZUupJlkdW16q7jQqAEuVR0wFNzHp2BA9mG6g1B8Yq0l1/QjqmZ7mHlDVEUwj3Zj/N8 e1Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=HT6ELgc+vEC14zQPUFAPOU0wYVcABKowburaLkoJ0d0=; b=xQJ/cR8Zkc3CRIF5CDgGGRFs+48bH98L1UIW6/hX14QMF0pYP/ZPzJMLbPaTmiKa2f E+GP5lN6UWDJS27UAJrhgfoDqPmUtGTekRXaS5lfm3IADaAqfZyjRm9OKCyHHyIhzAjp gTaac0MeJ8Gy1067IHlwnV4W0ebB4GPuNmPeDWJVOHlu59ZoUvPeJDCkhGbXBZFZQOGk Nh9/JcJ4q7FDYPEj1XeCgERCJem0iKBjQ/y5fzzj9xt0EiC3UeelbCoIqnHWl7MRr55y q0QfGl6TsXG2WqqCLfH2/NjSBdQV9ZMo9jttwyFsfryxINddZJx0/eSjTpJEanivRY3v sHfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HcyyIFeN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s12-20020a63af4c000000b0052872c32995si2477185pgo.724.2023.06.20.15.27.06; Tue, 20 Jun 2023 15:27:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HcyyIFeN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229676AbjFTWKY (ORCPT + 99 others); Tue, 20 Jun 2023 18:10:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229887AbjFTWKV (ORCPT ); Tue, 20 Jun 2023 18:10:21 -0400 Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6704B1994 for ; Tue, 20 Jun 2023 15:10:19 -0700 (PDT) Received: by mail-yb1-xb2e.google.com with SMTP id 3f1490d57ef6-bcde2b13fe2so5307624276.3 for ; Tue, 20 Jun 2023 15:10:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687299018; x=1689891018; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=HT6ELgc+vEC14zQPUFAPOU0wYVcABKowburaLkoJ0d0=; b=HcyyIFeN1ZxhVpCBerZe43HsXI5lOg7/21g6EDpY4iszu/RN/Q3ijZPgtygCMKkSy9 N402Yer6LMFngtacQ+V7n+n4oHlu3YCFtASsd1sf5FhYISqoCy2Kl9R3uGdeqsre8foZ NObMszuLwIQO7ycCF+vTi2uHx+b6pSF+mNi1wCD4rYtqhGLgq06u5C7q0NzFKId33F/q 8NjcEyQaBolQC0Hb6cYALvoJC9rWqxIL0YIrNPKmltVtwAl6z/fH3qW27ABuLMY96k9J hy4E9kustuyBgb16zcle/svxA3VcNm+Zyne3ovN3AnGHC0/zRCAFX8jLYcrQzJmx2Zop NY3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687299018; x=1689891018; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=HT6ELgc+vEC14zQPUFAPOU0wYVcABKowburaLkoJ0d0=; b=FOR9WbIzmfOdGFFp1IKOa+J4LOc9jYsad9QuOWPRwqjN/0fEIAjsO+af5cmQP8cEKh KAcjtFxxYv4JvYe1FSOGQPC7pDboW8NV/MP42dNLbaNvwa/L7im8EWlaOD/KbmZoNMgb ySCg1rEHLsIeV5fg3/3hKY+B5KAiTy4PGbL7hQNX6TzfILgeNIZf5qxeJvjFgKkhvK1O 7nhzsiHdZOV/kfrpZpAKtwl72jWasMeOEahmgd/xXPt2Nws3hsHJBSaddESJ3iFps/Fs KopsDDKkrsB3fRiRdYra5OBvCAww2NY6+IIjF4epR1tfGCWdJpQL6rFKKpYFlvh66tk1 qCxQ== X-Gm-Message-State: AC+VfDytGWYubEbjpB/ixBgdC+H65jiJTuaHyY39of5jjF6FMbBBsyfJ ZBA9cHBHH/kph8Uy62mMBRRiSTRXN7vBEQgKdp+iXQ== X-Received: by 2002:a25:cb81:0:b0:ba8:58b5:71aa with SMTP id b123-20020a25cb81000000b00ba858b571aamr10791467ybg.9.1687299018527; Tue, 20 Jun 2023 15:10:18 -0700 (PDT) MIME-Version: 1.0 References: <20230525-add-widebus-support-v1-0-c7069f2efca1@quicinc.com> <20230525-add-widebus-support-v1-2-c7069f2efca1@quicinc.com> <81a5e241-ec82-7414-8752-4ce3cb084959@linaro.org> In-Reply-To: From: Dmitry Baryshkov Date: Wed, 21 Jun 2023 01:10:07 +0300 Message-ID: Subject: Re: [PATCH 2/3] drm/msm/dpu: Set DATABUS_WIDEN on command mode encoders To: Jessica Zhang Cc: Marijn Suijten , Abhinav Kumar , Rob Clark , Sean Paul , David Airlie , Daniel Vetter , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 21 Jun 2023 at 00:38, Jessica Zhang wrote: > > > > On 6/16/2023 5:35 PM, Dmitry Baryshkov wrote: > > On 17/06/2023 00:54, Marijn Suijten wrote: > >> On 2023-06-16 14:18:39, Abhinav Kumar wrote: > >>> > >>> > >>> On 6/14/2023 12:56 AM, Dmitry Baryshkov wrote: > >>>> On 14/06/2023 04:57, Jessica Zhang wrote: > >>>>> Add a DPU INTF op to set the DATABUS_WIDEN register to enable the > >>>>> databus-widen mode datapath. > >>>>> > >>>>> Signed-off-by: Jessica Zhang > >>>>> --- > >>>>> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 3 +++ > >>>>> drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c | 12 > >>>>> ++++++++++++ > >>>>> drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h | 3 +++ > >>>>> 3 files changed, 18 insertions(+) > >>>>> > >>>>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c > >>>>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c > >>>>> index b856c6286c85..124ba96bebda 100644 > >>>>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c > >>>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c > >>>>> @@ -70,6 +70,9 @@ static void _dpu_encoder_phys_cmd_update_intf_cfg( > >>>>> if (intf_cfg.dsc != 0 && > >>>>> phys_enc->hw_intf->ops.enable_compression) > >>>>> > >>>>> phys_enc->hw_intf->ops.enable_compression(phys_enc->hw_intf); > >>>>> + > >>>>> + if (phys_enc->hw_intf->ops.enable_widebus) > >>>>> + phys_enc->hw_intf->ops.enable_widebus(phys_enc->hw_intf); > >>>> > >>>> No. Please provide a single function which takes necessary > >>>> configuration, including compression and wide_bus_enable. > >>>> > >>> > >>> There are two ways to look at this. Your point is coming from the > >>> perspective that its programming the same register but just a different > >>> bit. But that will also make it a bit confusing. > > > > My point is to have a high-level function that configures the INTF for > > the CMD mode. This way it can take a structure with necessary > > configuration bits. > > Hi Dmitry, > > After discussing this approach with Abhinav, we still have a few > questions about it: > > Currently, only 3 of the 32 bits for INTF_CONFIG2 are being used (the > rest are reserved with no plans of being programmed in the future). Does > this still justify the use of a struct to pass in the necessary > configuration? Yes. > > In addition, it seems that video mode does all its INTF_CONFIG2 > configuration separately in dpu_hw_intf_setup_timing_engine(). If we > have a generic set_intf_config2() op, it might be good to have it as > part of a larger cleanup where we have both video and command mode use > the generic op. What are your thoughts on this? No. If I get your idea right, this would mean moving INTF_CONFIG2 knowledge to the caller, which, I think, is a bad idea. > > Thanks, > > Jessica Zhang > > > > >>> > >>> So lets say the function is called intf_cfg2_xxx(..., bool widebus, bool > >>> data_compress) > >>> > >>> Now for the caller who wants to just enable widebus this will be > >>> > >>> intf_cfg2_xxx(....., true, false) > >>> > >>> if we want to do both > >>> > >>> intf_cfg2_xxx(...., true, true) > >>> > >>> the last one where we want to do just data_compress(highly unlikely and > >>> not recommended) > >>> > >>> intf_cfg2_xxx(...., false, true) > >>> > >>> Now someone looking at the code will have to go and find out what each > >>> bool is. > >>> > >>> Whereas with separate ops, its kind of implicit. > >> > >> That's why you never pass bools as function argument (edge-case if it is > >> the only argument, and its meaning becomes clear from the function > >> name). Use enumerations anywhere else. > >> > >> - Marijn > >> > >>> > >>> For that reason, I dont think this patch is bad at all. > > > > -- > > With best wishes > > Dmitry > > -- With best wishes Dmitry