Eric Anholt wrote:
On Mon, 2007-09-24 at 15:30 +0100, Keith Whitwell wrote:
Keith Whitwell wrote:
2) Figure out what memory manager you are using and, if it is the fake one, disable any paths in the driver that rely on the assumption of persistent video-ram buffers, and provide alternatives. This would effectively mean switching between i915tex and i965 versions of CopyTexSubImage, texture uploads, etc, and turning off extensions like FBO's for the fake manager.
I just took a look at the extension list -- it seems like you have **unconditionally** removed framebuffer objects and pixel buffer objects from the extension list???

This isn't really acceptable. People rely on that functionality, and removing it is a major regression. It's also needless in the TTM case, because FBOs and PBOs still work there.
Ugh. I looked closer. Apologies, FBO/PBO code is still there, and gated on TTM as suggested. (sigh). Apologies again.

It looks like most of what you need to do is key things like the CopyTexSubImage path, etc off intelScreen->ttm.

I'll take a pass at putting together some fixes for this.

Yes, that was exactly the intention for how i915-unification would work
going forward.  Thanks for catching that path, which I had missed in my
initial review.

Sorry for the over-quick review & false alarm. It would have been good to get a day or two to look at things on a branch before they hit the mainline.

The two paths I've found that need to be caught are CopyTexSubImage and copy_image_data_to_tree(). Most of the others are implicitly disabled when you disable PBO's, though this is partially coincidence.

I haven't been able to compile head recently, but the attached patch *should* do the trick.

It would probably make sense to have an attribute in the buffer struct for 'contents preserved' or similar. This would be set for all buffers in the ttm manager and only for the static buffers in the non-ttm manager. The non-ttm validate function could then assert() if a non-contents-preserved buffer was ever validated for WRITE.

Untested, uncompiled patch attached.

Keith

Keith
diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel.c b/src/mesa/drivers/dri/i915tex/intel_pixel.c
diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c b/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c
index afb586b..7dcf1d5 100644
diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel_read.c b/src/mesa/drivers/dri/i915tex/intel_pixel_read.c
index a228449..76499ed 100644
diff --git a/src/mesa/drivers/dri/i915tex/intel_regions.c b/src/mesa/drivers/dri/i915tex/intel_regions.c
index 4eac859..b1ec1bb 100644
diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_copy.c b/src/mesa/drivers/dri/i915tex/intel_tex_copy.c
index b85a256..e8cc399 100644
--- a/src/mesa/drivers/dri/i915tex/intel_tex_copy.c
+++ b/src/mesa/drivers/dri/i915tex/intel_tex_copy.c
@@ -95,6 +95,11 @@ do_copy_texsubimage(struct intel_context *intel,
    const struct intel_region *src =
       get_teximage_source(intel, internalFormat);
 
+   /* This doesn't work without TTM.
+    */
+   if (!intel->intelScreen->ttm)
+      return GL_FALSE;
+
    if (!intelImage->mt || !src) {
       DBG("%s fail %p %p\n", __FUNCTION__, intelImage->mt, src);
       return GL_FALSE;
diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_image.c b/src/mesa/drivers/dri/i915tex/intel_tex_image.c
index 197cf35..6d936a4 100644
diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_validate.c b/src/mesa/drivers/dri/i915tex/intel_tex_validate.c
index af18c26..b7010b1 100644
--- a/src/mesa/drivers/dri/i915tex/intel_tex_validate.c
+++ b/src/mesa/drivers/dri/i915tex/intel_tex_validate.c
@@ -67,7 +67,9 @@ copy_image_data_to_tree(struct intel_context *intel,
                         struct intel_texture_object *intelObj,
                         struct intel_texture_image *intelImage)
 {
-   if (intelImage->mt) {
+   if (intelImage->mt &&
+       intel->intelScreen->ttm) 
+   {
       /* Copy potentially with the blitter:
        */
       intel_miptree_image_copy(intel,
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to