Re: [PATCH v4 2/2] drm/i915: Create dumb buffer from LMEM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Matthew Auld (2019-12-05 12:12:19)
> On Mon, 2 Dec 2019 at 06:55, Ramalingam C <ramalingam.c@xxxxxxxxx> wrote:
> >
> > When LMEM is supported, dumb buffer preferred to be created from LMEM.
> >
> > v2:
> >   Parameters are reshuffled. [Chris]
> > v3:
> >   s/region_id/mem_type
> > v4:
> >   use the i915_gem_object_create_region [chris]
> >
> > Signed-off-by: Ramalingam C <ramalingam.c@xxxxxxxxx>
> > cc: Matthew Auld <matthew.auld@xxxxxxxxx>
> > ---
> >  drivers/gpu/drm/i915/i915_gem.c | 14 +++++++++++---
> >  1 file changed, 11 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> > index 61395b03443e..34e480c8293e 100644
> > --- a/drivers/gpu/drm/i915/i915_gem.c
> > +++ b/drivers/gpu/drm/i915/i915_gem.c
> > @@ -44,6 +44,7 @@
> >  #include "gem/i915_gem_clflush.h"
> >  #include "gem/i915_gem_context.h"
> >  #include "gem/i915_gem_ioctls.h"
> > +#include "gem/i915_gem_region.h"
> >  #include "gem/i915_gem_pm.h"
> >  #include "gt/intel_context.h"
> >  #include "gt/intel_engine_user.h"
> > @@ -176,6 +177,7 @@ i915_gem_phys_pwrite(struct drm_i915_gem_object *obj,
> >  static int
> >  i915_gem_create(struct drm_file *file,
> >                 struct drm_i915_private *dev_priv,
> > +               enum intel_memory_type mem_type,
> >                 u64 *size_p,
> >                 u32 *handle_p)
> >  {
> > @@ -189,7 +191,8 @@ i915_gem_create(struct drm_file *file,
> >                 return -EINVAL;
> >
> >         /* Allocate the new object */
> > -       obj = i915_gem_object_create_shmem(dev_priv, size);
> > +       obj = i915_gem_object_create_region(intel_memory_region_lookup(dev_priv,
> > +                                           mem_type), size, 0);
> 
> Reviewed-by: Matthew Auld <matthew.auld@xxxxxxxxx>
> 
> But how should we go about testing this?
> 
> We would still need to clear the object(maybe I915_BO_ALLOC_CLEARED?)
> in order to pass the IGTs. We also need to adjust dumb_buffer.c, since
> that uses get_avail_ram_mb() for always_clear, but maybe we need the
> query region uapi for that?

Hmm. Questions over the maximum size for dumb buffer, maximum number of
dumb buffers, etc, should be addressed to the dumb API. So some form of
drmGetCap() ?

Note for merging, we need the lmem vm_fault implementation first.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux