[Intel-gfx] [PATCH]fix for large texture with GEM-classic mode (bug#17964)

Xiang, Haihao haihao.xiang at intel.com
Wed Oct 22 04:49:27 CEST 2008


On Tue, 2008-10-21 at 10:32 -0700, Eric Anholt wrote:
> On Tue, 2008-10-21 at 17:31 +0800, Xiang, Haihao wrote:
> > Hi, 
> >    Here are 2 patch for bug#17964. Sometimes a large texture(such as
> > 2048x2048) works incorrectly under GEM-classic mode. There are two
> > problems. Firstly there is an endless loop in intelEmitCopyBlit when
> > using BLT to copy large texture image to mipmap tree. Secondly
> > aperture_check only counts the first 3 level BOs, 
> > The BO for texture is always ignored
> > (batchbuffer_BO->bind_table_BO->surface_states_BO->texture_BO). 
> 
> Could you use git-send-email to send your patches, so they can be
> reviewed inline?
I didn't know this command before. I will learn to how use it.
> 
> @@ -263,8 +263,10 @@ got_flushed:
>          if (check_state(state, &atom->dirty)) {
>             if (atom->emit) {
>                atom->emit( brw );
> -              if (intel->batch->buf != last_batch_bo)
> +              if (intel->batch->buf != last_batch_bo) {
> +                 intel_batchbuffer_flush(intel->batch);
>                   goto got_flushed;
> +               }
>             }
>          }
> 
> The batchbuffer has already been flushed by somebody here.  Why flush it
> again?
The batchbuffer is filled with some commands after flushed, and the BOs
referenced by these commands are counted by emit_reloc.  These BOs will
be counted again when pass is 1. If the size of these BOs is greater
than bufmgr_fake->size/2, aperture_check still fails.

Flush again to ensure the batchbuffer is unfilled, or return at once
after flushing in emit function.

> 
> +   if (pass >= 2) {
> +       intel->Fallback = 1;
> +       return;
>     }
> 
> Where does that Fallback value get cleared?
> 
>     if (intelImage->mt) {
>        /* Copy potentially with the blitter:
>         */
> +      useBlitter = GL_TRUE; 
> +      intel->Fallback = 0;
>        intel_miptree_image_copy(intel,
>                                 intelObj->mt,
>                                 intelImage->face,
>                                 intelImage->level, intelImage->mt);
> 
> Can't clear the fallback value like that, as you'll wipe out 915's
> fallback state.  Just return a boolean from the function of whether
> blitting was successful.  (even better, just do the fallback right in
> the function)
Oh, I forgot 915. I will send out the update.

> The second patch looks good.
> 




More information about the Intel-gfx mailing list