Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1178077ybg; Wed, 29 Jul 2020 07:44:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiqDrYcEYPhfBiiAVms+Th5iFHvm+vEFqlI9tPAMHaqmvzAY61d8TJA/7iVtqIxPYa9afj X-Received: by 2002:a17:906:c096:: with SMTP id f22mr21375063ejz.159.1596033860591; Wed, 29 Jul 2020 07:44:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596033860; cv=none; d=google.com; s=arc-20160816; b=X6x5+LvggaoPDMyB29k/swbJco5VY70dlqzJEtrtrXcxuxYZtmA4ugzTvWBaNzss4C /3OjqDdYDFcs/w7adXLzzQ3GKrSwZCvpcHupqrmCNiK0E2XGD5XidYWXlUEag/qXVdqL q26oQEN3JFikaVEBZCmQeUAE9BefRzgV+5JB7i9eLrcvjC7kcSYB0u1V7wj0bF1urM0A eHUg7QBLiHrhtYIRVQq10H1lt0rgNi1/pj47zGESLzURZLwis+xRED+5Xa0TrL00lP2E TddG236vjhfvr4ghvxysJGaplkuyje3RtjQW8qbRUy5IvnTguv9l+viF2jXUuXmxxeVk N6oA== 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=Wd61Bbp9ukgeA9Chq75iGFckRsvukuJaOV9sT03x+48=; b=GKsbpDiKqZyQOlAd99BOeW0tnCAO5Il/aIN+uDr5PhkEn6D2dUEoZlKoTNE1UnaCPT UzP0unRSM7vVlK8CwPjaYSfSU1Zt9y6+wqOUKzUz6OolutrpSyO6F3XTsLvrP3bP/iQo W9ysGuhfeQ0gew4BQKdvO0xPTkk1P9P37X3G5TWBU02+n0lPClIcOOtn3yMgEk+oAbBc esCKl2zQvzullvGkefk+2iL+7msosYuMaaqBF/PChR3KKqC2KZAGCoJTQxUSPY0fOfRA yxVxq9DvWvIzvUKhHjWOc5FGWs2nsbGC83vq5Vs8FPaZ2dgklgfegd7gOBQ3RNqBwG09 azHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@raspberrypi.com header.s=google header.b=OG5EldDE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=raspberrypi.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n25si1393685edf.229.2020.07.29.07.43.58; Wed, 29 Jul 2020 07:44:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@raspberrypi.com header.s=google header.b=OG5EldDE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=raspberrypi.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726817AbgG2OnP (ORCPT + 99 others); Wed, 29 Jul 2020 10:43:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726385AbgG2OnP (ORCPT ); Wed, 29 Jul 2020 10:43:15 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B620EC061794 for ; Wed, 29 Jul 2020 07:43:14 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id p14so2967826wmg.1 for ; Wed, 29 Jul 2020 07:43:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Wd61Bbp9ukgeA9Chq75iGFckRsvukuJaOV9sT03x+48=; b=OG5EldDEwNlD9cxTierr+fUm2xb5qV3Pm2ihUpCVFluLtG85Na7ozcsIz4ro2MsILb dtWgwO1md/MNqjPwiEXxkOE440Hz5oNVbjbkVNBSYn1a+EIjXNNur4ofrXFdyJKsEvLk lpGOfqeFxlhd0BaJgKXASjH9aWGymd9nd85sug879ctdNp2muWe8MkvbR7UCLNJX1CtI G14YrXsH7QLXWVzM7I6wxGlTcuG8nU85f6vNNboNXefJvEXMwYFcFudfXJxhcu+iWgvK Kwb8MZn2bZZdcjZTDKaIO3HEbN9RIq3+FJCqFZbwroCJmT86hzSf00jDZcx0sigP7g+a dyng== 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=Wd61Bbp9ukgeA9Chq75iGFckRsvukuJaOV9sT03x+48=; b=gQoR7JAIyinnFcZVShO18ZdbQZy3GRb/N4qqgfHxTU+s7o5lq/eOFdEK4+cA4OEoCy kmzktcyYpveLji9o5dwIJDSSU+nE5RFwqUipXUArekevRC2wG6vVtaoYgveLGc+oFay6 U9M/tslu0/wY9o55WmjjM4P4JahnIiaVRgNwtQUbUvlA/bPp5oyKi6ArbZNx/+66VQtU ncYM0ohRq/tRXtXa6K68SwGdkA7TY6zU3wrE8fUo5oL6+zGGPsm5Q1aCakBnnMXwPKSu VmZtAgSpHyEpFJd0+7Ts+c7/kPhYedZI44cAEJos9ifRTLDjlNioqkeYLpP/hQY0+sj9 0PzQ== X-Gm-Message-State: AOAM532dtwJuBz7DOrnPvD71QE19R/hVLTw4wY7BLhmheIjs5FMRbCxQ Ps7TS/JOq4/tfZMz/nyXLbi5MOidRDsTWu4cPKV/Fg== X-Received: by 2002:a1c:e382:: with SMTP id a124mr8417867wmh.96.1596033793425; Wed, 29 Jul 2020 07:43:13 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dave Stevenson Date: Wed, 29 Jul 2020 15:42:54 +0100 Message-ID: Subject: Re: [PATCH v4 23/78] drm/vc4: crtc: Move the HVS gamma LUT setup to our init function To: Maxime Ripard Cc: Nicolas Saenz Julienne , Eric Anholt , DRI Development , linux-rpi-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, LKML , Tim Gover , Phil Elwell 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 Hi Maxime On Wed, 8 Jul 2020 at 18:43, Maxime Ripard wrote: > > Since most of the HVS channel is setup in the init function, let's move the > gamma setup there too. As this makes the HVS mode_set function empty, let's > remove it in the process. > > Signed-off-by: Maxime Ripard Reviewed-by: Dave Stevenson > --- > drivers/gpu/drm/vc4/vc4_crtc.c | 2 +- > drivers/gpu/drm/vc4/vc4_drv.h | 1 +- > drivers/gpu/drm/vc4/vc4_hvs.c | 59 +++++++++-------------------------- > drivers/gpu/drm/vc4/vc4_txp.c | 1 +- > 4 files changed, 16 insertions(+), 47 deletions(-) > > diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c > index 181d3fd57bc7..284a85b9d7d4 100644 > --- a/drivers/gpu/drm/vc4/vc4_crtc.c > +++ b/drivers/gpu/drm/vc4/vc4_crtc.c > @@ -379,8 +379,6 @@ static void vc4_crtc_config_pv(struct drm_crtc *crtc) > static void vc4_crtc_mode_set_nofb(struct drm_crtc *crtc) > { > vc4_crtc_config_pv(crtc); > - > - vc4_hvs_mode_set_nofb(crtc); > } > > static void require_hvs_enabled(struct drm_device *dev) > diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h > index 4126506b3a69..dfcc684f5d28 100644 > --- a/drivers/gpu/drm/vc4/vc4_drv.h > +++ b/drivers/gpu/drm/vc4/vc4_drv.h > @@ -904,7 +904,6 @@ int vc4_hvs_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state); > void vc4_hvs_atomic_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state); > void vc4_hvs_atomic_disable(struct drm_crtc *crtc, struct drm_crtc_state *old_state); > void vc4_hvs_atomic_flush(struct drm_crtc *crtc, struct drm_crtc_state *state); > -void vc4_hvs_mode_set_nofb(struct drm_crtc *crtc); > void vc4_hvs_dump_state(struct drm_device *dev); > void vc4_hvs_unmask_underrun(struct drm_device *dev, int channel); > void vc4_hvs_mask_underrun(struct drm_device *dev, int channel); > diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c > index 78bb1c0b0b76..c7de77afbf0a 100644 > --- a/drivers/gpu/drm/vc4/vc4_hvs.c > +++ b/drivers/gpu/drm/vc4/vc4_hvs.c > @@ -201,6 +201,8 @@ static int vc4_hvs_init_channel(struct vc4_dev *vc4, struct drm_crtc *crtc, > { > struct vc4_crtc_state *vc4_crtc_state = to_vc4_crtc_state(crtc->state); > unsigned int chan = vc4_crtc_state->assigned_channel; > + bool interlace = mode->flags & DRM_MODE_FLAG_INTERLACE; > + u32 dispbkgndx; > u32 dispctrl; > > /* Turn on the scaler, which will wait for vstart to start > @@ -225,6 +227,20 @@ static int vc4_hvs_init_channel(struct vc4_dev *vc4, struct drm_crtc *crtc, > > HVS_WRITE(SCALER_DISPCTRLX(chan), dispctrl); > > + dispbkgndx = HVS_READ(SCALER_DISPBKGNDX(chan)); > + dispbkgndx &= ~SCALER_DISPBKGND_GAMMA; > + dispbkgndx &= ~SCALER_DISPBKGND_INTERLACE; > + > + HVS_WRITE(SCALER_DISPBKGNDX(chan), dispbkgndx | > + SCALER_DISPBKGND_AUTOHS | > + ((!vc4->hvs->hvs5) ? SCALER_DISPBKGND_GAMMA : 0) | > + (interlace ? SCALER_DISPBKGND_INTERLACE : 0)); > + > + /* Reload the LUT, since the SRAMs would have been disabled if > + * all CRTCs had SCALER_DISPBKGND_GAMMA unset at once. > + */ > + vc4_hvs_lut_load(crtc); > + > return 0; > } > > @@ -421,49 +437,6 @@ void vc4_hvs_atomic_flush(struct drm_crtc *crtc, > } > } > > -void vc4_hvs_mode_set_nofb(struct drm_crtc *crtc) > -{ > - struct drm_device *dev = crtc->dev; > - struct vc4_dev *vc4 = to_vc4_dev(dev); > - struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc->state); > - struct drm_display_mode *mode = &crtc->state->adjusted_mode; > - bool interlace = mode->flags & DRM_MODE_FLAG_INTERLACE; > - > - if (vc4_state->assigned_channel == 2) { > - u32 dispctrl; > - u32 dsp3_mux; > - > - /* > - * SCALER_DISPCTRL_DSP3 = X, where X < 2 means 'connect DSP3 to > - * FIFO X'. > - * SCALER_DISPCTRL_DSP3 = 3 means 'disable DSP 3'. > - * > - * DSP3 is connected to FIFO2 unless the transposer is > - * enabled. In this case, FIFO 2 is directly accessed by the > - * TXP IP, and we need to disable the FIFO2 -> pixelvalve1 > - * route. > - */ > - if (vc4_state->feed_txp) > - dsp3_mux = VC4_SET_FIELD(3, SCALER_DISPCTRL_DSP3_MUX); > - else > - dsp3_mux = VC4_SET_FIELD(2, SCALER_DISPCTRL_DSP3_MUX); > - > - dispctrl = HVS_READ(SCALER_DISPCTRL) & > - ~SCALER_DISPCTRL_DSP3_MUX_MASK; > - HVS_WRITE(SCALER_DISPCTRL, dispctrl | dsp3_mux); > - } > - > - HVS_WRITE(SCALER_DISPBKGNDX(vc4_state->assigned_channel), > - SCALER_DISPBKGND_AUTOHS | > - ((!vc4->hvs->hvs5) ? SCALER_DISPBKGND_GAMMA : 0) | > - (interlace ? SCALER_DISPBKGND_INTERLACE : 0)); > - > - /* Reload the LUT, since the SRAMs would have been disabled if > - * all CRTCs had SCALER_DISPBKGND_GAMMA unset at once. > - */ > - vc4_hvs_lut_load(crtc); > -} > - > void vc4_hvs_mask_underrun(struct drm_device *dev, int channel) > { > struct vc4_dev *vc4 = to_vc4_dev(dev); > diff --git a/drivers/gpu/drm/vc4/vc4_txp.c b/drivers/gpu/drm/vc4/vc4_txp.c > index a2380d856000..849dcafbfff1 100644 > --- a/drivers/gpu/drm/vc4/vc4_txp.c > +++ b/drivers/gpu/drm/vc4/vc4_txp.c > @@ -436,7 +436,6 @@ static const struct drm_crtc_helper_funcs vc4_txp_crtc_helper_funcs = { > .atomic_flush = vc4_hvs_atomic_flush, > .atomic_enable = vc4_txp_atomic_enable, > .atomic_disable = vc4_txp_atomic_disable, > - .mode_set_nofb = vc4_hvs_mode_set_nofb, > }; > > static irqreturn_t vc4_txp_interrupt(int irq, void *data) > -- > git-series 0.9.1