drm/vc4: Add a load tracker

Submitted by Boris Brezillon on Oct. 25, 2018, 12:45 p.m.

Details

Reviewer None
Submitted Oct. 25, 2018, 12:45 p.m.
Last Updated Feb. 20, 2019, 3:52 p.m.
Revision 4

Cover Letter(s)

Revision 1
      Hello,

This is the 2nd version of the VC4 load tracker patch.

Daniel, as you suggested, I've implemented a generic infrastructure to
track and report underrun errors (patch 1). Not sure this is what you
had in mind, but it seems to do the job for my use case, and should
allow me to easily track regressions in the load tracking logic with a
bunch of IGT tests. Let me know if you want it done differently.

Patch 2 is implementing the generic underrun interface in the VC4
driver, and patch 3 is just adding the load tracking logic (hasn't
changed since the RFC except for the unused 'ret' var removal).

Regards,

Boris

Boris Brezillon (3):
  drm/atomic: Add a generic infrastructure to track underrun errors
  drm/vc4: Report underrun errors
  drm/vc4: Add a load tracker to prevent HVS underflow errors

 drivers/gpu/drm/drm_atomic.c        |  12 +++
 drivers/gpu/drm/drm_atomic_helper.c |   4 +
 drivers/gpu/drm/vc4/vc4_drv.c       |   1 +
 drivers/gpu/drm/vc4/vc4_drv.h       |  14 ++++
 drivers/gpu/drm/vc4/vc4_hvs.c       |  71 ++++++++++++++++++
 drivers/gpu/drm/vc4/vc4_kms.c       | 110 +++++++++++++++++++++++++++-
 drivers/gpu/drm/vc4/vc4_plane.c     |  60 +++++++++++++++
 drivers/gpu/drm/vc4/vc4_regs.h      |  46 +++---------
 include/drm/drm_atomic_helper.h     |  53 ++++++++++++++
 include/drm/drm_device.h            |  15 ++++
 include/drm/drm_mode_config.h       |  26 +++++++
 11 files changed, 376 insertions(+), 36 deletions(-)
    
Revision 2
      Hello,

This is the 2nd version of the VC4 load tracker patch.

Daniel, as you suggested, I've implemented a generic infrastructure to
track and report underrun errors (patch 1). Not sure this is what you
had in mind, but it seems to do the job for my use case, and should
allow me to easily track regressions in the load tracking logic with a
bunch of IGT tests. Let me know if you want it done differently.

Patch 2 is implementing the generic underrun interface in the VC4
driver, and patch 3 is just adding the load tracking logic (hasn't
changed since the RFC except for the unused 'ret' var removal).

Regards,

Boris

Boris Brezillon (3):
  drm/atomic: Add a generic infrastructure to track underrun errors
  drm/vc4: Report underrun errors
  drm/vc4: Add a load tracker to prevent HVS underflow errors

 drivers/gpu/drm/drm_atomic.c        |  12 +++
 drivers/gpu/drm/drm_atomic_helper.c |   4 +
 drivers/gpu/drm/vc4/vc4_drv.c       |   1 +
 drivers/gpu/drm/vc4/vc4_drv.h       |  14 ++++
 drivers/gpu/drm/vc4/vc4_hvs.c       |  71 ++++++++++++++++++
 drivers/gpu/drm/vc4/vc4_kms.c       | 110 +++++++++++++++++++++++++++-
 drivers/gpu/drm/vc4/vc4_plane.c     |  60 +++++++++++++++
 drivers/gpu/drm/vc4/vc4_regs.h      |  46 +++---------
 include/drm/drm_atomic_helper.h     |  53 ++++++++++++++
 include/drm/drm_device.h            |  15 ++++
 include/drm/drm_mode_config.h       |  26 +++++++
 11 files changed, 376 insertions(+), 36 deletions(-)
    
Revision 3
      Hi,

Here is a fourth iteration of the VC4 load tracking series, which was
initially developed by Boris Brezillon and that I have now taken over.

This new iteration takes in account comments from v3 and comes with a
new approach for avoiding underrun reports when reconfiguring the
pipeline. It is now based on detection instead of delaying the underrun
interrupt unmasking.

It can be tested with a dedicated IGT GPU Tools series:
  VC4 load tracker testing

Changes since v3:
* Returned IRQ_NONE for short line interrupt to avoid storm;
* Made register definitions with per-channel offsets more direct;
* cleaned all IRQ fields instead of writing back the status bit as
  advised by docs;
* Reworked first commit's message;
* Removed in-commit changelogs with inconsistent revision numbers;
* Removed explicit wait for sync before unmasking underrun interrupt;
* Checked that the display lists are synced before reporting underrun;

Cheers,

Paul

Boris Brezillon (2):
  drm/vc4: Report HVS underrun errors
  drm/vc4: Add a load tracker to prevent HVS underflow errors

Paul Kocialkowski (2):
  drm/vc4: Detect and ignore underruns caused by out-of-sync dlists
  drm/vc4: Add a debugfs entry to disable/enable the load tracker

 drivers/gpu/drm/vc4/vc4_debugfs.c |  10 +++
 drivers/gpu/drm/vc4/vc4_drv.c     |   1 +
 drivers/gpu/drm/vc4/vc4_drv.h     |  32 ++++++++
 drivers/gpu/drm/vc4/vc4_hvs.c     | 123 ++++++++++++++++++++++++++++++
 drivers/gpu/drm/vc4/vc4_kms.c     | 116 +++++++++++++++++++++++++++-
 drivers/gpu/drm/vc4/vc4_plane.c   |  57 ++++++++++++++
 drivers/gpu/drm/vc4/vc4_regs.h    |  51 ++++---------
 7 files changed, 354 insertions(+), 36 deletions(-)
    
Revision 4
      Hi,

Here is a fourth iteration of the VC4 load tracking series, which was
initially developed by Boris Brezillon and that I have now taken over.

This new iteration takes in account comments from v3 and comes with a
new approach for avoiding underrun reports when reconfiguring the
pipeline. It is now based on detection instead of delaying the underrun
interrupt unmasking.

It can be tested with a dedicated IGT GPU Tools series:
  VC4 load tracker testing

Changes since v4:
* Unmasked underrun in vc4_crtc_handle_page_flip instead of the previous
  workaround for detecting out-of-sync display lists causing underruns;
* Added comments where it felt relevant;
* Made underrun masking/unmasking per-channel to avoid race conditions
  resulting in unwanted masking/unmasking;
* Added a check for unmasked interrupt before acting upon it;
* Disabled shortline/underrun interrupts at initial config time;
* Added collected Reviewed-by tags.

Changes since v3:
* Returned IRQ_NONE for short line interrupt to avoid storm;
* Made register definitions with per-channel offsets more direct;
* cleaned all IRQ fields instead of writing back the status bit as
  advised by docs;
* Reworked first commit's message;
* Removed in-commit changelogs with inconsistent revision numbers;
* Removed explicit wait for sync before unmasking underrun interrupt;
* Checked that the display lists are synced before reporting underrun;

Cheers,

Paul

Boris Brezillon (2):
  drm/vc4: Report HVS underrun errors
  drm/vc4: Add a load tracker to prevent HVS underflow errors

Paul Kocialkowski (1):
  drm/vc4: Add a debugfs entry to disable/enable the load tracker

 drivers/gpu/drm/vc4/vc4_crtc.c    |   8 ++
 drivers/gpu/drm/vc4/vc4_debugfs.c |  10 +++
 drivers/gpu/drm/vc4/vc4_drv.c     |   1 +
 drivers/gpu/drm/vc4/vc4_drv.h     |  24 ++++++
 drivers/gpu/drm/vc4/vc4_hvs.c     |  95 +++++++++++++++++++++++
 drivers/gpu/drm/vc4/vc4_kms.c     | 122 +++++++++++++++++++++++++++++-
 drivers/gpu/drm/vc4/vc4_plane.c   |  57 ++++++++++++++
 drivers/gpu/drm/vc4/vc4_regs.h    |  51 ++++---------
 8 files changed, 332 insertions(+), 36 deletions(-)
    

Revisions