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

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Reply via email to