dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: patrik.r.jakobsson@gmail.com, airlied@linux.ie, daniel@ffwll.ch
Cc: dri-devel@lists.freedesktop.org, Thomas Zimmermann <tzimmermann@suse.de>
Subject: [PATCH v3 00/10] drm/gma500: Refactor GEM code
Date: Fri, 15 Oct 2021 10:40:43 +0200	[thread overview]
Message-ID: <20211015084053.13708-1-tzimmermann@suse.de> (raw)

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


             reply	other threads:[~2021-10-15  8:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-15  8:40 Thomas Zimmermann [this message]
2021-10-15  8:40 ` [PATCH v3 01/10] drm/gma500: Move helpers for struct gtt_range from gtt.c to gem.c Thomas Zimmermann
2021-10-15  8:40 ` [PATCH v3 02/10] drm/gma500: Use to_gtt_range() everywhere Thomas Zimmermann
2021-10-15  8:40 ` [PATCH v3 03/10] drm/gma500: Reimplement psb_gem_create() Thomas Zimmermann
2021-10-15  8:40 ` [PATCH v3 04/10] drm/gma500: Allocate GTT ranges in stolen memory with psb_gem_create() Thomas Zimmermann
2021-10-15  8:40 ` [PATCH v3 05/10] drm/gma500: Rename psb_gtt_{pin, unpin}() to psb_gem_{pin, unpin}() Thomas Zimmermann
2021-10-15  8:40 ` [PATCH v3 06/10] drm/gma500: Inline psb_gtt_attach_pages() and psb_gtt_detach_pages() Thomas Zimmermann
2021-10-15  8:40 ` [PATCH v3 07/10] drm/gma500: Inline psb_gtt_{alloc, free}_range() into rsp callers Thomas Zimmermann
2021-10-18 12:27   ` Patrik Jakobsson
2021-10-15  8:40 ` [PATCH v3 08/10] drm/gma500: Set page-caching flags in GEM pin/unpin Thomas Zimmermann
2021-10-15  8:40 ` [PATCH v3 09/10] drm/gma500: Rewrite GTT page insert/remove without struct gtt_range Thomas Zimmermann
2021-10-18 12:27   ` Patrik Jakobsson
2021-10-15  8:40 ` [PATCH v3 10/10] drm/gma500: Rename struct gtt_range to struct psb_gem_object Thomas Zimmermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211015084053.13708-1-tzimmermann@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=patrik.r.jakobsson@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox