Excerpts from Ian Romanick's message of Wed Nov 11 20:18:58 +0000 2009:
> Chris Wilson wrote:
> > +#if FEATURE_APPLE_object_purgeable
> > +static GLenum
> > +intel_bufferobj_purgeable(GLcontext * ctx,
> > +              struct gl_buffer_object *obj,
> > +              GLenum option)
> > +{
> > +   struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
> > +   int retained;
> > +
> > +   if (intel_obj->buffer != NULL) {
> > +      retained = drm_intel_bo_madvise (intel_obj->buffer, 
> > I915_MADV_DONTNEED);
> > +   } else {
> > +      if (intel_obj->sys_buffer != NULL) {
> > +         _mesa_free(intel_obj->sys_buffer);
> 
> I don't think we want to free the buffer here.  This case really only
> happens on i915 for vertex buffers.  I don't expect these types of
> buffers to be marked purgeable very often.  Can we do
> madvise(MADV_WONTNEED) instead?   This isn't quite the same (it doesn't
> release the contents during memory pressure), but it seems close enough.

The only reason we do something different here is that we have yet to
allocate the buffer so there was nothing to mark as advisory. The
alternative would be to create the buffer and transfer the data from
system to 'video' and then mark the buffer as advisory...

A compromise: only free the system buffer if the hint is RELEASED?

> > +   _mesa_enable_extension(ctx, "GL_APPLE_object_purgeable");
> 
> No!  Add this to the ttm_extensions table in intel_extensions.c.

Ok, I'm looking at how to do so now. Just when I thought I understood one
level of complexity, you reveal a whole new chasm. ;-)
-ickle
-- 
Chris Wilson, Intel Open Source Technology Centre

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to