[bug report] drm/i915/dsb: Use DEwake to combat PkgC latency

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Ville Syrjälä,

The patch f83b94d23770: "drm/i915/dsb: Use DEwake to combat PkgC
latency" from Jun 6, 2023 (linux-next), leads to the following Smatch
static checker warning:

	drivers/gpu/drm/i915/display/intel_dsb.c:363 _intel_dsb_commit()
	warn: always true condition '(dewake_scanline >= 0) => (0-u32max >= 0)'

drivers/gpu/drm/i915/display/intel_dsb.c
    339 static void _intel_dsb_commit(struct intel_dsb *dsb, u32 ctrl,
    340                               unsigned int dewake_scanline)
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
unsigned int

    341 {
    342         struct intel_crtc *crtc = dsb->crtc;
    343         struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
    344         enum pipe pipe = crtc->pipe;
    345         u32 tail;
    346 
    347         tail = dsb->free_pos * 4;
    348         if (drm_WARN_ON(&dev_priv->drm, !IS_ALIGNED(tail, CACHELINE_BYTES)))
    349                 return;
    350 
    351         if (is_dsb_busy(dev_priv, pipe, dsb->id)) {
    352                 drm_err(&dev_priv->drm, "[CRTC:%d:%s] DSB %d is busy\n",
    353                         crtc->base.base.id, crtc->base.name, dsb->id);
    354                 return;
    355         }
    356 
    357         intel_de_write_fw(dev_priv, DSB_CTRL(pipe, dsb->id),
    358                           ctrl | DSB_ENABLE);
    359 
    360         intel_de_write_fw(dev_priv, DSB_HEAD(pipe, dsb->id),
    361                           i915_ggtt_offset(dsb->vma));
    362 
--> 363         if (dewake_scanline >= 0) {
                    ^^^^^^^^^^^^^^^^^^^^
always true

    364                 int diff, hw_dewake_scanline;
    365 
    366                 hw_dewake_scanline = intel_crtc_scanline_to_hw(crtc, dewake_scanline);
    367 
    368                 intel_de_write_fw(dev_priv, DSB_PMCTRL(pipe, dsb->id),
    369                                   DSB_ENABLE_DEWAKE |
    370                                   DSB_SCANLINE_FOR_DEWAKE(hw_dewake_scanline));
    371 
    372                 /*
    373                  * Force DEwake immediately if we're already past
    374                  * or close to racing past the target scanline.
    375                  */
    376                 diff = dewake_scanline - intel_get_crtc_scanline(crtc);
    377                 intel_de_write_fw(dev_priv, DSB_PMCTRL_2(pipe, dsb->id),
    378                                   (diff >= 0 && diff < 5 ? DSB_FORCE_DEWAKE : 0) |
    379                                   DSB_BLOCK_DEWAKE_EXTENSION);
    380         }
    381 
    382         intel_de_write_fw(dev_priv, DSB_TAIL(pipe, dsb->id),
    383                           i915_ggtt_offset(dsb->vma) + tail);
    384 }

regards,
dan carpenter



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux