[PATCH v4 01/19] drm: Add |struct drm_gem_vram_object| and helpers

Gerd Hoffmann kraxel at redhat.com
Mon May 6 13:17:39 UTC 2019


  Hi,

> This misses the call to drm_gem_vram_placement(), where
> drm_gem_vram_push_to_system() enforces placement in system memory.

Ah, missed that detail.

> We
> could build a common implementation out of both interfaces, but that
> would obfuscate the code IMHO. I'd just leave it as it is.

Ok.

> >> +struct drm_gem_vram_object {
> >> +	/* Supported placements are %TTM_PL_VRAM and %TTM_PL_SYSTEM */
> >> +	struct ttm_placement placement;
> >> +	struct ttm_place placements[3];
> > 
> > placements[2] should be enough I guess?
> 
> TTM_PL_VRAM has index 2 and TTM_PL_SYSTEM has index 0. There's TTM_PL_TT
> at index 1. We don't use all three array entries here, but I'm not sure
> if something in TTM does. I took the line from the drivers and didn't
> change it for that reason.

TTM_PL_* isn't an index into that array.  See drm_gem_vram_placement()
which fills that array.  It'll use one or two entries of that array.

cheers,
  Gerd



More information about the dri-devel mailing list