Skip to content

drm/gma500: Refactor GEM code

Thomas Zimmermann dri-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest10 patches 2 repliesIn review
  2. v210 patches 5 repliesSuperseded
  3. v110 patches 14 repliesSuperseded

Changes in v3 from the cover letter

* replace [static 1] with pointer notation
* keep lost comments about GTT locking

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10drm/gma500: Move helpers for struct gtt_range from gtt.c to gem.cdrivers/gpu/drm/gma500/framebuffer.c drivers/gpu/drm/gma500/gem.c drivers/gpu/drm/gma500/gem.h +4 more+147 -2090 replies
2/10drm/gma500: Use to_gtt_range() everywheredrivers/gpu/drm/gma500/gem.c drivers/gpu/drm/gma500/gma_display.c+5 -60 replies
3/10drm/gma500: Reimplement psb_gem_create()drivers/gpu/drm/gma500/gem.c drivers/gpu/drm/gma500/gem.h+59 -380 replies
4/10drm/gma500: Allocate GTT ranges in stolen memory with psb_gem_create()drivers/gpu/drm/gma500/framebuffer.c drivers/gpu/drm/gma500/gem.c drivers/gpu/drm/gma500/gem.h +2 more+29 -500 replies
5/10drm/gma500: Rename psb_gtt_{pin, unpin}() to psb_gem_{pin, unpin}()drivers/gpu/drm/gma500/gem.c drivers/gpu/drm/gma500/gem.h drivers/gpu/drm/gma500/gma_display.c+12 -120 replies
6/10drm/gma500: Inline psb_gtt_attach_pages() and psb_gtt_detach_pages()drivers/gpu/drm/gma500/gem.c+42 -520 replies
7/10drm/gma500: Inline psb_gtt_{alloc, free}_range() into rsp callersdrivers/gpu/drm/gma500/gem.c drivers/gpu/drm/gma500/gtt.c drivers/gpu/drm/gma500/gtt.h+65 -621 reply
8/10drm/gma500: Set page-caching flags in GEM pin/unpindrivers/gpu/drm/gma500/gem.c drivers/gpu/drm/gma500/gtt.c drivers/gpu/drm/gma500/gtt.h+11 -170 replies
9/10drm/gma500: Rewrite GTT page insert/remove without struct gtt_rangedrivers/gpu/drm/gma500/gem.c drivers/gpu/drm/gma500/gtt.c drivers/gpu/drm/gma500/gtt.h+44 -661 reply
10/10drm/gma500: Rename struct gtt_range to struct psb_gem_objectdrivers/gpu/drm/gma500/framebuffer.c drivers/gpu/drm/gma500/gem.c drivers/gpu/drm/gma500/gem.h +6 more+123 -1170 replies

Reviews trailers per patch

All 10 patches have a Reviewed-by or Acked-by.

PatchPatrik Jakobsson
1/10A-b
2/10A-b
3/10A-b
4/10A-b
5/10A-b
6/10A-b
7/10A-b
8/10A-b
9/10A-b
10/10A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 00/10] drm/gma500: Refactor GEM code

Bring GEM code up to current standards and untangle the connection to GTT helpers.

The allocation and pinning helpers for struct gtt_range are located in the GTT code, but actually part of the GEM implementation. The patchset moves them to GEM code and refactors much of the implementation. Most of the GTT code is then independend from the struct gtt_range, while the GEM code does not contain GTT management.

In addition to internal refiactoring, patches 2 to 4 update the rest of the driver to use the GEM interfaces for object allocation and release.

Finally, rename struct gtt_range to struct psb_gem_object to designate it as a 'real' GEM object.

Future work: with the GEM and GTT code separated, future patchsets can implement on-demand release of GTT entries, or remove the perma-mapping of stolen memory. Dma-buf support might also be added.

Tested on Atom N2800 hardware.

v3:
* replace [static 1] with pointer notation
* keep lost comments about GTT locking
v2:
* keep docs about GTT locking
* release mutex in pin error path

Thomas Zimmermann (10):
drm/gma500: Move helpers for struct gtt_range from gtt.c to gem.c drm/gma500: Use to_gtt_range() everywhere
drm/gma500: Reimplement psb_gem_create()
drm/gma500: Allocate GTT ranges in stolen memory with psb_gem_create() drm/gma500: Rename psb_gtt_{pin,unpin}() to psb_gem_{pin,unpin}() drm/gma500: Inline psb_gtt_attach_pages() and psb_gtt_detach_pages() drm/gma500: Inline psb_gtt_{alloc,free}_range() into rsp callers drm/gma500: Set page-caching flags in GEM pin/unpin drm/gma500: Rewrite GTT page insert/remove without struct gtt_range drm/gma500: Rename struct gtt_range to struct psb_gem_object

 drivers/gpu/drm/gma500/framebuffer.c       |  52 +---
 drivers/gpu/drm/gma500/gem.c               | 234 +++++++++++----
 drivers/gpu/drm/gma500/gem.h               |  28 +-
 drivers/gpu/drm/gma500/gma_display.c       |  51 ++--
 drivers/gpu/drm/gma500/gtt.c               | 326 +++++----------------
 drivers/gpu/drm/gma500/gtt.h               |  29 +-
 drivers/gpu/drm/gma500/oaktrail_crtc.c     |   3 +-
 drivers/gpu/drm/gma500/psb_intel_display.c |  17 +-
 drivers/gpu/drm/gma500/psb_intel_drv.h     |   2 +-
 9 files changed, 325 insertions(+), 417 deletions(-)

--
2.33.0