[Freedreno] [PATCH 0/4] drm/msm: Remove four set but not used variables

2019-10-09 Thread zhengbin
zhengbin (4):
  drm/msm/mdp5: Remove set but not used variable 'fmt'
  drm/msm/mdp5: Remove set but not used variable 'hw_cfg' in blend_setup
  drm/msm/dsi: Remove set but not used variable 'lpx'
  drm/msm/dsi: Remove set but not used variable 'lp'

 drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 3 ---
 drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c  | 2 --
 drivers/gpu/drm/msm/dsi/dsi_host.c| 3 +--
 drivers/gpu/drm/msm/dsi/phy/dsi_phy.c | 6 ++
 4 files changed, 3 insertions(+), 11 deletions(-)

--
2.7.4

___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

[Freedreno] [PATCH 3/4] drm/msm/dsi: Remove set but not used variable 'lpx'

2019-10-09 Thread zhengbin
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/msm/dsi/phy/dsi_phy.c: In function msm_dsi_dphy_timing_calc_v2:
drivers/gpu/drm/msm/dsi/phy/dsi_phy.c:156:17: warning: variable lpx set but not 
used [-Wunused-but-set-variable]
drivers/gpu/drm/msm/dsi/phy/dsi_phy.c: In function msm_dsi_dphy_timing_calc_v3:
drivers/gpu/drm/msm/dsi/phy/dsi_phy.c:273:17: warning: variable lpx set but not 
used [-Wunused-but-set-variable]

'lpx' in msm_dsi_dphy_timing_calc_v2 is not used since commit a4df68fa232e
("drm/msm/dsi: Add new method to calculate 14nm PHY timings")

'lpx' in msm_dsi_dphy_timing_calc_v3 is not used since commit f1fa7ff44056
("drm/msm/dsi: implement auto PHY timing calculator for 10nm PHY")

Reported-by: Hulk Robot 
Signed-off-by: zhengbin 
---
 drivers/gpu/drm/msm/dsi/phy/dsi_phy.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c 
b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
index 3522863..aa22c3a 100644
--- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
+++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
@@ -145,7 +145,7 @@ int msm_dsi_dphy_timing_calc_v2(struct msm_dsi_dphy_timing 
*timing,
 {
const unsigned long bit_rate = clk_req->bitclk_rate;
const unsigned long esc_rate = clk_req->escclk_rate;
-   s32 ui, ui_x8, lpx;
+   s32 ui, ui_x8;
s32 tmax, tmin;
s32 pcnt0 = 50;
s32 pcnt1 = 50;
@@ -175,7 +175,6 @@ int msm_dsi_dphy_timing_calc_v2(struct msm_dsi_dphy_timing 
*timing,

ui = mult_frac(NSEC_PER_MSEC, coeff, bit_rate / 1000);
ui_x8 = ui << 3;
-   lpx = mult_frac(NSEC_PER_MSEC, coeff, esc_rate / 1000);

temp = S_DIV_ROUND_UP(38 * coeff - val_ckln * ui, ui_x8);
tmin = max_t(s32, temp, 0);
@@ -262,7 +261,7 @@ int msm_dsi_dphy_timing_calc_v3(struct msm_dsi_dphy_timing 
*timing,
 {
const unsigned long bit_rate = clk_req->bitclk_rate;
const unsigned long esc_rate = clk_req->escclk_rate;
-   s32 ui, ui_x8, lpx;
+   s32 ui, ui_x8;
s32 tmax, tmin;
s32 pcnt0 = 50;
s32 pcnt1 = 50;
@@ -284,7 +283,6 @@ int msm_dsi_dphy_timing_calc_v3(struct msm_dsi_dphy_timing 
*timing,

ui = mult_frac(NSEC_PER_MSEC, coeff, bit_rate / 1000);
ui_x8 = ui << 3;
-   lpx = mult_frac(NSEC_PER_MSEC, coeff, esc_rate / 1000);

temp = S_DIV_ROUND_UP(38 * coeff, ui_x8);
tmin = max_t(s32, temp, 0);
--
2.7.4

___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

[Freedreno] [PATCH 4/4] drm/msm/dsi: Remove set but not used variable 'lp'

2019-10-09 Thread zhengbin
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/msm/dsi/dsi_host.c: In function dsi_cmd_dma_rx:
drivers/gpu/drm/msm/dsi/dsi_host.c:1302:7: warning: variable lp set but not 
used [-Wunused-but-set-variable]

It is not used since commit a689554ba6ed ("drm/msm:
Initial add DSI connector support")

Reported-by: Hulk Robot 
Signed-off-by: zhengbin 
---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c 
b/drivers/gpu/drm/msm/dsi/dsi_host.c
index 663ff9f..4851188 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -1291,14 +1291,13 @@ static int dsi_cmd_dma_tx(struct msm_dsi_host 
*msm_host, int len)
 static int dsi_cmd_dma_rx(struct msm_dsi_host *msm_host,
u8 *buf, int rx_byte, int pkt_size)
 {
-   u32 *lp, *temp, data;
+   u32 *temp, data;
int i, j = 0, cnt;
u32 read_cnt;
u8 reg[16];
int repeated_bytes = 0;
int buf_offset = buf - msm_host->rx_buf;

-   lp = (u32 *)buf;
temp = (u32 *)reg;
cnt = (rx_byte + 3) >> 2;
if (cnt > 4)
--
2.7.4

___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

[Freedreno] [PATCH 2/4] drm/msm/mdp5: Remove set but not used variable 'hw_cfg' in blend_setup

2019-10-09 Thread zhengbin
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c: In function blend_setup:
drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c:225:28: warning: variable hw_cfg set 
but not used [-Wunused-but-set-variable]

It is not used since commit 14be3200cd5f ("drm/msm: rename mdp->disp")

Reported-by: Hulk Robot 
Signed-off-by: zhengbin 
---
 drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c 
b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
index eb0b4b7..05cc04f 100644
--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
@@ -214,7 +214,6 @@ static void blend_setup(struct drm_crtc *crtc)
struct mdp5_pipeline *pipeline = &mdp5_cstate->pipeline;
struct mdp5_kms *mdp5_kms = get_kms(crtc);
struct drm_plane *plane;
-   const struct mdp5_cfg_hw *hw_cfg;
struct mdp5_plane_state *pstate, *pstates[STAGE_MAX + 1] = {NULL};
const struct mdp_format *format;
struct mdp5_hw_mixer *mixer = pipeline->mixer;
@@ -232,8 +231,6 @@ static void blend_setup(struct drm_crtc *crtc)
u32 val;
 #define blender(stage) ((stage) - STAGE0)

-   hw_cfg = mdp5_cfg_get_hw_config(mdp5_kms->cfg);
-
spin_lock_irqsave(&mdp5_crtc->lm_lock, flags);

/* ctl could be released already when we are shutting down: */
--
2.7.4

___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

[Freedreno] [PATCH 1/4] drm/msm/mdp5: Remove set but not used variable 'fmt'

2019-10-09 Thread zhengbin
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c: In function mdp5_smp_calculate:
drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c:134:6: warning: variable fmt set but 
not used [-Wunused-but-set-variable]

It is not used since commit 24c478ead0bf ("drm/fourcc:
Pass the format_info pointer to drm_format_plane_cpp")

Reported-by: Hulk Robot 
Signed-off-by: zhengbin 
---
 drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c 
b/drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c
index b31cfb5..d7fa2c4 100644
--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c
+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c
@@ -121,7 +121,6 @@ uint32_t mdp5_smp_calculate(struct mdp5_smp *smp,
struct mdp5_kms *mdp5_kms = get_kms(smp);
int rev = mdp5_cfg_get_hw_rev(mdp5_kms->cfg);
int i, hsub, nplanes, nlines;
-   u32 fmt = format->base.pixel_format;
uint32_t blkcfg = 0;

nplanes = info->num_planes;
@@ -135,7 +134,6 @@ uint32_t mdp5_smp_calculate(struct mdp5_smp *smp,
 * them together, writes to SMP using a single client.
 */
if ((rev > 0) && (format->chroma_sample > CHROMA_FULL)) {
-   fmt = DRM_FORMAT_NV24;
nplanes = 2;

/* if decimation is enabled, HW decimates less on the
--
2.7.4

___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

Re: [Freedreno] [PATCH] drm/msm/mdp5: Remove set but not used variable 'hw_cfg' in modeset_init

2019-10-09 Thread Bjorn Andersson
On Wed 09 Oct 07:13 PDT 2019, zhengbin wrote:

> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c: In function modeset_init:
> drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c:458:28: warning: variable hw_cfg set 
> but not used [-Wunused-but-set-variable]
> 
> It is not used since commit 36d1364abbed ("drm/msm/mdp5:
> Clean up interface assignment")
> 
> Reported-by: Hulk Robot 
> Signed-off-by: zhengbin 

Reviewed-by: Bjorn Andersson 

> ---
>  drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c 
> b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
> index f8bd0bf..5476892 100644
> --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
> +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
> @@ -461,14 +461,11 @@ static int modeset_init(struct mdp5_kms *mdp5_kms)
>  {
>   struct drm_device *dev = mdp5_kms->dev;
>   struct msm_drm_private *priv = dev->dev_private;
> - const struct mdp5_cfg_hw *hw_cfg;
>   unsigned int num_crtcs;
>   int i, ret, pi = 0, ci = 0;
>   struct drm_plane *primary[MAX_BASES] = { NULL };
>   struct drm_plane *cursor[MAX_BASES] = { NULL };
> 
> - hw_cfg = mdp5_cfg_get_hw_config(mdp5_kms->cfg);
> -
>   /*
>* Construct encoders and modeset initialize connector devices
>* for each external display interface.
> --
> 2.7.4
> 
___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

Re: [Freedreno] [PATCH v2 16/24] drm/msm: dpu: Add modeset lock checks where applicable

2019-10-09 Thread Daniel Vetter
On Fri, Nov 16, 2018 at 7:44 PM Sean Paul  wrote:
>
> From: Sean Paul 
>
> Add modeset lock checks to functions that could be called outside the
> core atomic stack.
>
> Changes in v2:
> - None
>
> Signed-off-by: Sean Paul 
> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 2 ++
>  drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c  | 1 +
>  2 files changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c 
> b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> index a008a87a8113..cd0a0bea4335 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> @@ -284,6 +284,8 @@ enum dpu_intf_mode dpu_crtc_get_intf_mode(struct drm_crtc 
> *crtc)
> return INTF_MODE_NONE;
> }
>
> +   WARN_ON(!drm_modeset_is_locked(&crtc->mutex));
> +
> /* TODO: Returns the first INTF_MODE, could there be multiple values? 
> */
> drm_for_each_encoder_mask(encoder, crtc->dev, 
> crtc->state->encoder_mask)
> return dpu_encoder_get_intf_mode(encoder);
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c 
> b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> index 64134d619748..5104fc01147e 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> @@ -358,6 +358,7 @@ void dpu_kms_encoder_enable(struct drm_encoder *encoder)
> if (funcs && funcs->commit)
> funcs->commit(encoder);
>
> +   WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex));
> drm_for_each_crtc(crtc, dev) {
> if (!(crtc->state->encoder_mask & drm_encoder_mask(encoder)))
> continue;

I'm fairly sure this is called in the atomic_commit path, and in there
you might not actually hold these locks (if you do a nonblocking
modeset).

The locking rules for ->state are pretty fun: Either hold the lock, or
be in atomic commit. In the later case atomic helpers' commit ordering
guarantees that you can safely access ->state (but read-only only)
without hodling any locks. You might want to revert.

Don't ask why I stumbled over this.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

[Freedreno] [PATCH] drm/msm/dsi: Implement reset correctly

2019-10-09 Thread Jeffrey Hugo
On msm8998, vblank timeouts are observed because the DSI controller is not
reset properly, which ends up stalling the MDP.  This is because the reset
logic is not correct per the hardware documentation.

The documentation states that after asserting reset, software should wait
some time (no indication of how long), or poll the status register until it
returns 0 before deasserting reset.

wmb() is insufficient for this purpose since it just ensures ordering, not
timing between writes.  Since asserting and deasserting reset occurs on the
same register, ordering is already guaranteed by the architecture, making
the wmb extraneous.

Since we would define a timeout for polling the status register to avoid a
possible infinite loop, lets just use a static delay of 20 ms, since 16.666
ms is the time available to process one frame at 60 fps.

Fixes: a689554ba6ed (drm/msm: Initial add DSI connector support)
Signed-off-by: Jeffrey Hugo 
---

Rob et al, is it possible for this to go into a 5.4-rc?

 drivers/gpu/drm/msm/dsi/dsi_host.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c 
b/drivers/gpu/drm/msm/dsi/dsi_host.c
index 663ff9f4fac9..68ded9b4735d 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -986,7 +986,7 @@ static void dsi_sw_reset(struct msm_dsi_host *msm_host)
wmb(); /* clocks need to be enabled before reset */
 
dsi_write(msm_host, REG_DSI_RESET, 1);
-   wmb(); /* make sure reset happen */
+   msleep(20); /* make sure reset happen */
dsi_write(msm_host, REG_DSI_RESET, 0);
 }
 
@@ -1396,7 +1396,7 @@ static void dsi_sw_reset_restore(struct msm_dsi_host 
*msm_host)
 
/* dsi controller can only be reset while clocks are running */
dsi_write(msm_host, REG_DSI_RESET, 1);
-   wmb();  /* make sure reset happen */
+   msleep(20); /* make sure reset happen */
dsi_write(msm_host, REG_DSI_RESET, 0);
wmb();  /* controller out of reset */
dsi_write(msm_host, REG_DSI_CTRL, data0);
-- 
2.17.1

___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

Re: [Freedreno] [PATCH RFC v2 4/5] ARM: dts: qcom: msm8974: add HDMI nodes

2019-10-09 Thread Brian Masney
On Wed, Oct 09, 2019 at 08:39:26AM -0700, Stephen Boyd wrote:
> Quoting Brian Masney (2019-10-08 23:05:20)
> > On Tue, Oct 08, 2019 at 07:21:30PM -0700, Stephen Boyd wrote:
> > > Quoting Brian Masney (2019-10-06 18:45:08)
> > > > diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi 
> > > > b/arch/arm/boot/dts/qcom-msm8974.dtsi
> > > > index 7fc23e422cc5..af02eace14e2 100644
> > > > --- a/arch/arm/boot/dts/qcom-msm8974.dtsi
> > > > +++ b/arch/arm/boot/dts/qcom-msm8974.dtsi
> > > > @@ -1335,6 +1342,77 @@
> > > > clocks = <&mmcc MDSS_AHB_CLK>;
> > > > clock-names = "iface";
> > > > };
> > > > +
> > > > +   hdmi: hdmi-tx@fd922100 {
> > > > +   status = "disabled";
> > > > +
> > > > +   compatible = "qcom,hdmi-tx-8974";
> > > > +   reg = <0xfd922100 0x35c>,
> > > > + <0xfc4b8000 0x60f0>;
> > > > +   reg-names = "core_physical",
> > > > +   "qfprom_physical";
> > > 
> > > Is this the qfprom "uncorrected" physical address? If so, why can't this
> > > node use an nvmem to read whatever it needs out of the qfprom?
> > 
> > The MSM HDMI code is configured to look for this reg-name here:
> > 
> > https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/msm/hdmi/hdmi.c#L582
> > 
> > There is a qcom,qfprom configured for this board in DTS, however its at
> > a different address range, so maybe there are multiple qfproms?
> > 
> > https://elixir.bootlin.com/linux/latest/source/arch/arm/boot/dts/qcom-msm8974.dtsi#L424
> > 
> > msm8996.dtsi has the same style of configuration:
> > 
> > https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/qcom/msm8996.dtsi#L956
> > https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/qcom/msm8996.dtsi#L1736
> > 
> 
> There's only one qfprom and there's the address space that's
> "uncorrected" which is not supposed to be used and there's the space
> that is "corrected" and is supposed to be used. It looks like this is
> poking the uncorrected space and it should probably stop doing that and
> use the nvmem provider instead. Maybe someone with docs for this chip
> and 8996 can help confirm this.

Do you know of any publicly-available documentation that describes the
"uncorrected" and "corrected" addresses? I got that qfprom address for
the HDMI from here:

https://github.com/AICP/kernel_lge_hammerhead/blob/n7.1/arch/arm/boot/dts/msm8974-mdss.dtsi#L101

I assume the downstream kernel probably doesn't have the corrected
address anywhere else?

Brian

___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

Re: [Freedreno] [PATCH] drm/msm: make a5xx_show and a5xx_gpu_state_put static

2019-10-09 Thread Jordan Crouse
On Wed, Oct 09, 2019 at 12:46:07PM +0100, Ben Dooks wrote:
> The a5xx_show and a5xx_gpu_state_put objects are not exported
> outside of the file, so make them static to avoid the following
> warnings from sparse:
> 
> drivers/gpu/drm/msm/adreno/a5xx_gpu.c:1292:5: warning: symbol 
> 'a5xx_gpu_state_put' was not declared. Should it be static?
> drivers/gpu/drm/msm/adreno/a5xx_gpu.c:1302:6: warning: symbol 'a5xx_show' was 
> not declared. Should it be static?

Reviewed-by: Jordan Crouse 

> Signed-off-by: Ben Dooks 
> ---
> Cc: Rob Clark 
> Cc: Sean Paul 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: linux-arm-...@vger.kernel.org
> Cc: dri-de...@lists.freedesktop.org
> Cc: freedreno@lists.freedesktop.org
> ---
>  drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c 
> b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> index e9c55d1d6c04..7fdc9e2bcaac 100644
> --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> @@ -1289,7 +1289,7 @@ static void a5xx_gpu_state_destroy(struct kref *kref)
>   kfree(a5xx_state);
>  }
>  
> -int a5xx_gpu_state_put(struct msm_gpu_state *state)
> +static int a5xx_gpu_state_put(struct msm_gpu_state *state)
>  {
>   if (IS_ERR_OR_NULL(state))
>   return 1;
> @@ -1299,8 +1299,8 @@ int a5xx_gpu_state_put(struct msm_gpu_state *state)
>  
>  
>  #if defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP)
> -void a5xx_show(struct msm_gpu *gpu, struct msm_gpu_state *state,
> - struct drm_printer *p)
> +static void a5xx_show(struct msm_gpu *gpu, struct msm_gpu_state *state,
> +   struct drm_printer *p)
>  {
>   int i, j;
>   u32 pos = 0;
> -- 
> 2.23.0
> 

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

Re: [Freedreno] [PATCH RFC v2 4/5] ARM: dts: qcom: msm8974: add HDMI nodes

2019-10-09 Thread Stephen Boyd
Quoting Brian Masney (2019-10-08 23:05:20)
> On Tue, Oct 08, 2019 at 07:21:30PM -0700, Stephen Boyd wrote:
> > Quoting Brian Masney (2019-10-06 18:45:08)
> > > diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi 
> > > b/arch/arm/boot/dts/qcom-msm8974.dtsi
> > > index 7fc23e422cc5..af02eace14e2 100644
> > > --- a/arch/arm/boot/dts/qcom-msm8974.dtsi
> > > +++ b/arch/arm/boot/dts/qcom-msm8974.dtsi
> > > @@ -1335,6 +1342,77 @@
> > > clocks = <&mmcc MDSS_AHB_CLK>;
> > > clock-names = "iface";
> > > };
> > > +
> > > +   hdmi: hdmi-tx@fd922100 {
> > > +   status = "disabled";
> > > +
> > > +   compatible = "qcom,hdmi-tx-8974";
> > > +   reg = <0xfd922100 0x35c>,
> > > + <0xfc4b8000 0x60f0>;
> > > +   reg-names = "core_physical",
> > > +   "qfprom_physical";
> > 
> > Is this the qfprom "uncorrected" physical address? If so, why can't this
> > node use an nvmem to read whatever it needs out of the qfprom?
> 
> The MSM HDMI code is configured to look for this reg-name here:
> 
> https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/msm/hdmi/hdmi.c#L582
> 
> There is a qcom,qfprom configured for this board in DTS, however its at
> a different address range, so maybe there are multiple qfproms?
> 
> https://elixir.bootlin.com/linux/latest/source/arch/arm/boot/dts/qcom-msm8974.dtsi#L424
> 
> msm8996.dtsi has the same style of configuration:
> 
> https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/qcom/msm8996.dtsi#L956
> https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/qcom/msm8996.dtsi#L1736
> 

There's only one qfprom and there's the address space that's
"uncorrected" which is not supposed to be used and there's the space
that is "corrected" and is supposed to be used. It looks like this is
poking the uncorrected space and it should probably stop doing that and
use the nvmem provider instead. Maybe someone with docs for this chip
and 8996 can help confirm this.

___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

[Freedreno] [PATCH] drm/msm/mdp5: make config variables static

2019-10-09 Thread Ben Dooks
A number of the config structs are not exported so make
them static to avoid the following sparse warnings:

drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c:17:26: warning: symbol 
'msm8x74v1_config' was not declared. Should it be static?
drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c:101:26: warning: symbol 
'msm8x74v2_config' was not declared. Should it be static?
drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c:183:26: warning: symbol 
'apq8084_config' was not declared. Should it be static?
drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c:278:26: warning: symbol 
'msm8x16_config' was not declared. Should it be static?
drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c:345:26: warning: symbol 
'msm8x94_config' was not declared. Should it be static?
drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c:440:26: warning: symbol 
'msm8x96_config' was not declared. Should it be static?
drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c:548:26: warning: symbol 
'msm8917_config' was not declared. Should it be static?
drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c:633:26: warning: symbol 
'msm8998_config' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
Cc: Rob Clark 
Cc: Sean Paul 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: linux-arm-...@vger.kernel.org
Cc: dri-de...@lists.freedesktop.org
Cc: freedreno@lists.freedesktop.org
---
 drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c 
b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c
index f6e71ff539ca..7c9c1ddae821 100644
--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c
+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c
@@ -14,7 +14,7 @@ struct mdp5_cfg_handler {
 /* mdp5_cfg must be exposed (used in mdp5.xml.h) */
 const struct mdp5_cfg_hw *mdp5_cfg = NULL;
 
-const struct mdp5_cfg_hw msm8x74v1_config = {
+static const struct mdp5_cfg_hw msm8x74v1_config = {
.name = "msm8x74v1",
.mdp = {
.count = 1,
@@ -98,7 +98,7 @@ const struct mdp5_cfg_hw msm8x74v1_config = {
.max_clk = 2,
 };
 
-const struct mdp5_cfg_hw msm8x74v2_config = {
+static const struct mdp5_cfg_hw msm8x74v2_config = {
.name = "msm8x74",
.mdp = {
.count = 1,
@@ -180,7 +180,7 @@ const struct mdp5_cfg_hw msm8x74v2_config = {
.max_clk = 2,
 };
 
-const struct mdp5_cfg_hw apq8084_config = {
+static const struct mdp5_cfg_hw apq8084_config = {
.name = "apq8084",
.mdp = {
.count = 1,
@@ -275,7 +275,7 @@ const struct mdp5_cfg_hw apq8084_config = {
.max_clk = 32000,
 };
 
-const struct mdp5_cfg_hw msm8x16_config = {
+static const struct mdp5_cfg_hw msm8x16_config = {
.name = "msm8x16",
.mdp = {
.count = 1,
@@ -342,7 +342,7 @@ const struct mdp5_cfg_hw msm8x16_config = {
.max_clk = 32000,
 };
 
-const struct mdp5_cfg_hw msm8x94_config = {
+static const struct mdp5_cfg_hw msm8x94_config = {
.name = "msm8x94",
.mdp = {
.count = 1,
@@ -437,7 +437,7 @@ const struct mdp5_cfg_hw msm8x94_config = {
.max_clk = 4,
 };
 
-const struct mdp5_cfg_hw msm8x96_config = {
+static const struct mdp5_cfg_hw msm8x96_config = {
.name = "msm8x96",
.mdp = {
.count = 1,
@@ -545,7 +545,7 @@ const struct mdp5_cfg_hw msm8x96_config = {
.max_clk = 41250,
 };
 
-const struct mdp5_cfg_hw msm8917_config = {
+static const struct mdp5_cfg_hw msm8917_config = {
.name = "msm8917",
.mdp = {
.count = 1,
@@ -630,7 +630,7 @@ const struct mdp5_cfg_hw msm8917_config = {
.max_clk = 32000,
 };
 
-const struct mdp5_cfg_hw msm8998_config = {
+static const struct mdp5_cfg_hw msm8998_config = {
.name = "msm8998",
.mdp = {
.count = 1,
-- 
2.23.0

___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

[Freedreno] [PATCH] drm/msm: make a5xx_show and a5xx_gpu_state_put static

2019-10-09 Thread Ben Dooks
The a5xx_show and a5xx_gpu_state_put objects are not exported
outside of the file, so make them static to avoid the following
warnings from sparse:

drivers/gpu/drm/msm/adreno/a5xx_gpu.c:1292:5: warning: symbol 
'a5xx_gpu_state_put' was not declared. Should it be static?
drivers/gpu/drm/msm/adreno/a5xx_gpu.c:1302:6: warning: symbol 'a5xx_show' was 
not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
Cc: Rob Clark 
Cc: Sean Paul 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: linux-arm-...@vger.kernel.org
Cc: dri-de...@lists.freedesktop.org
Cc: freedreno@lists.freedesktop.org
---
 drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c 
b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
index e9c55d1d6c04..7fdc9e2bcaac 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
@@ -1289,7 +1289,7 @@ static void a5xx_gpu_state_destroy(struct kref *kref)
kfree(a5xx_state);
 }
 
-int a5xx_gpu_state_put(struct msm_gpu_state *state)
+static int a5xx_gpu_state_put(struct msm_gpu_state *state)
 {
if (IS_ERR_OR_NULL(state))
return 1;
@@ -1299,8 +1299,8 @@ int a5xx_gpu_state_put(struct msm_gpu_state *state)
 
 
 #if defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP)
-void a5xx_show(struct msm_gpu *gpu, struct msm_gpu_state *state,
-   struct drm_printer *p)
+static void a5xx_show(struct msm_gpu *gpu, struct msm_gpu_state *state,
+ struct drm_printer *p)
 {
int i, j;
u32 pos = 0;
-- 
2.23.0

___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

[Freedreno] [PATCH] drm/msm/mdp5: Remove set but not used variable 'hw_cfg' in modeset_init

2019-10-09 Thread zhengbin
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c: In function modeset_init:
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c:458:28: warning: variable hw_cfg set 
but not used [-Wunused-but-set-variable]

It is not used since commit 36d1364abbed ("drm/msm/mdp5:
Clean up interface assignment")

Reported-by: Hulk Robot 
Signed-off-by: zhengbin 
---
 drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c 
b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
index f8bd0bf..5476892 100644
--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
@@ -461,14 +461,11 @@ static int modeset_init(struct mdp5_kms *mdp5_kms)
 {
struct drm_device *dev = mdp5_kms->dev;
struct msm_drm_private *priv = dev->dev_private;
-   const struct mdp5_cfg_hw *hw_cfg;
unsigned int num_crtcs;
int i, ret, pi = 0, ci = 0;
struct drm_plane *primary[MAX_BASES] = { NULL };
struct drm_plane *cursor[MAX_BASES] = { NULL };

-   hw_cfg = mdp5_cfg_get_hw_config(mdp5_kms->cfg);
-
/*
 * Construct encoders and modeset initialize connector devices
 * for each external display interface.
--
2.7.4

___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

Re: [Freedreno] [PATCH v2] iommu/arm-smmu: fix "hang" when games exit

2019-10-09 Thread Robin Murphy

On 2019-10-07 9:49 pm, Rob Clark wrote:

From: Rob Clark 

When games, browser, or anything using a lot of GPU buffers exits, there
can be many hundreds or thousands of buffers to unmap and free.  If the
GPU is otherwise suspended, this can cause arm-smmu to resume/suspend
for each buffer, resulting 5-10 seconds worth of reprogramming the
context bank (arm_smmu_write_context_bank()/arm_smmu_write_s2cr()/etc).
To the user it would appear that the system just locked up.

A simple solution is to use pm_runtime_put_autosuspend() instead, so we
don't immediately suspend the SMMU device.


Reviewed-by: Robin Murphy 


Signed-off-by: Rob Clark 
---
v1: original
v2: unconditionally use autosuspend, rather than deciding based on what
 consumer does

  drivers/iommu/arm-smmu.c | 5 -
  1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 3f1d55fb43c4..b7b41f5001bc 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -289,7 +289,7 @@ static inline int arm_smmu_rpm_get(struct arm_smmu_device 
*smmu)
  static inline void arm_smmu_rpm_put(struct arm_smmu_device *smmu)
  {
if (pm_runtime_enabled(smmu->dev))
-   pm_runtime_put(smmu->dev);
+   pm_runtime_put_autosuspend(smmu->dev);
  }
  
  static struct arm_smmu_domain *to_smmu_domain(struct iommu_domain *dom)

@@ -1445,6 +1445,9 @@ static int arm_smmu_attach_dev(struct iommu_domain 
*domain, struct device *dev)
/* Looks ok, so add the device to the domain */
ret = arm_smmu_domain_add_master(smmu_domain, fwspec);
  
+	pm_runtime_set_autosuspend_delay(smmu->dev, 20);

+   pm_runtime_use_autosuspend(smmu->dev);
+
  rpm_put:
arm_smmu_rpm_put(smmu);
return ret;


___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno