[Mesa-dev] [PATCH 21/27] dri: Stop using driUpdateFramebufferSize() wrapper function

Kristian Høgsberg krh at bitplanet.net
Mon Oct 31 09:29:53 PDT 2011


On Mon, Oct 31, 2011 at 12:08 PM, Eric Anholt <eric at anholt.net> wrote:
> On Fri, 28 Oct 2011 18:11:51 -0400, Kristian Høgsberg <krh at bitplanet.net> wrote:
>> ---
>>  src/mesa/drivers/dri/intel/intel_context.c         |    3 +--
>>  .../drivers/dri/radeon/radeon_common_context.c     |   10 ++++++----
>>  2 files changed, 7 insertions(+), 6 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
>> index 6190396..476f9dc 100644
>> --- a/src/mesa/drivers/dri/intel/intel_context.c
>> +++ b/src/mesa/drivers/dri/intel/intel_context.c
>> @@ -54,7 +54,6 @@
>>  #include "intel_bufmgr.h"
>>  #include "intel_screen.h"
>>
>> -#include "drirenderbuffer.h"
>>  #include "utils.h"
>>  #include "../glsl/ralloc.h"
>>
>> @@ -377,7 +376,7 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable)
>>     if (attachments)
>>        free(attachments);
>>
>> -   driUpdateFramebufferSize(&intel->ctx, drawable);
>> +   intel->ctx.Driver.ResizeBuffers(&intel->ctx, fb, drawable->w, drawable->h);
>>  }
>
> There's a behavior change in this patch.  Previously,
> driUpdateFramebufferSize() would check for size not changing and not
> call ResizeBuffers() (aka _mesa_resize_framebuffer(), which has a
> comment saying "I think we should check if the size is not changing and
> return early", because it does a bunch of looping over renderbuffers).
> Now you're calling that function directly.
>
> All patches until this one are
>
> Reviewed-by: Eric Anholt <eric at anholt.net>
>
> but I think for this one we want to fix _mesa_resize_framebuffer() to do
> what the comment suggests first.

Yeah, maybe I went one step too far here.  driUpdateFramebufferSize()
is only called from intel and radeon update_renderbuffers or radeon
makeCurrent, so the framebuffer will always have new sizes when we get
there.  But you're right, from a refactoring point of view, the right
thing is keep the wrapper and move it to dri_common.c and not change
the behavior.  I'll update this commit to be on the safe side.

Kristian


More information about the mesa-dev mailing list