[Mesa-dev] [PATCH 04/38] drivers/dri: set the implemented version of __DRItexBufferExtension

Ian Romanick idr at freedesktop.org
Tue Feb 18 17:58:42 PST 2014


On 02/12/2014 06:56 PM, Emil Velikov wrote:
> On 13/02/14 02:47, Emil Velikov wrote:
>> On 13/02/14 02:34, Ilia Mirkin wrote:
>>> On Wed, Feb 12, 2014 at 8:17 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
>>>> ... over the version number provided by the headers.
>>>> Explicitly set extension members to improve clarity.
>>>
>>> So... the current value is 2, but I see code that does
>>>
>>> src/egl/drivers/dri2/egl_dri2.c:#if __DRI_TEX_BUFFER_VERSION >= 3
>>> src/glx/dri2_glx.c:#if __DRI_TEX_BUFFER_VERSION >= 3
>>> src/glx/drisw_glx.c:#if __DRI_TEX_BUFFER_VERSION >= 3
>>>
>>> What's that all about?
>>>
>> Chaos wrt documentation and keeping up with it.
>>
>> Until git log churns this is the only reasonable thing that I can think of:
>>
>>  - releaseTexBuffer was added with version 3 in mind.
>>  - no driver implemented the function
>>  - the version was never bumped or reverted.
>>
> Looks like cvs (or whatever was used back in 2009) failure :\
> 
> Eric introduced v2 with commit 66175aac760, bumping the version 1>2
> Ian made an update with commit 82634ee8df7, bumping the version 1>2

These commits each bump something different from 1>2.

It looks like the field was actually added by:

commit e59fa4c46c8857f2e04447777dd197464c95b2cb
Author:     Juan Zhao <juan.j.zhao at intel.com>
AuthorDate: Sun Jan 9 12:03:02 2011 -0500
Commit:     Kristian Høgsberg <krh at bitplanet.net>
CommitDate: Sun Jan 9 14:55:16 2011 -0500

    dri2: release texture image.

    Add release function for texture_from_pixmap extension.
    Some platform need to release texture image for texture_from_pixmap
    extension, add this interface for those platforms.

Maybe Kristian has some idea?

> I'll update the header but I'll keep version 2 everywhere (dropping the
> null member).
> 
> -Emil
> 
>> -Emil
>>
>>>>
>>>> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
>>>> ---
>>>>  src/mesa/drivers/dri/i915/intel_screen.c      |  2 +-
>>>>  src/mesa/drivers/dri/i965/intel_screen.c      |  2 +-
>>>>  src/mesa/drivers/dri/nouveau/nouveau_screen.c |  8 +++++---
>>>>  src/mesa/drivers/dri/radeon/radeon_screen.c   | 16 ++++++++++------
>>>>  src/mesa/drivers/dri/swrast/swrast.c          |  8 +++++---
>>>>  5 files changed, 22 insertions(+), 14 deletions(-)
>>>>
>>>> diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c
>>>> index 296df16..68ad2b7 100644
>>>> --- a/src/mesa/drivers/dri/i915/intel_screen.c
>>>> +++ b/src/mesa/drivers/dri/i915/intel_screen.c
>>>> @@ -146,7 +146,7 @@ aub_dump_bmp(struct gl_context *ctx)
>>>>  }
>>>>
>>>>  static const __DRItexBufferExtension intelTexBufferExtension = {
>>>> -   .base = { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
>>>> +   .base = { __DRI_TEX_BUFFER, 2 },
>>>>
>>>>     .setTexBuffer        = intelSetTexBuffer,
>>>>     .setTexBuffer2       = intelSetTexBuffer2,
>>>> diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
>>>> index acdb5f3..c7b6c92 100644
>>>> --- a/src/mesa/drivers/dri/i965/intel_screen.c
>>>> +++ b/src/mesa/drivers/dri/i965/intel_screen.c
>>>> @@ -157,7 +157,7 @@ aub_dump_bmp(struct gl_context *ctx)
>>>>  }
>>>>
>>>>  static const __DRItexBufferExtension intelTexBufferExtension = {
>>>> -   .base = { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
>>>> +   .base = { __DRI_TEX_BUFFER, 2 },
>>>>
>>>>     .setTexBuffer        = intelSetTexBuffer,
>>>>     .setTexBuffer2       = intelSetTexBuffer2,
>>>> diff --git a/src/mesa/drivers/dri/nouveau/nouveau_screen.c b/src/mesa/drivers/dri/nouveau/nouveau_screen.c
>>>> index a381064..3c85918 100644
>>>> --- a/src/mesa/drivers/dri/nouveau/nouveau_screen.c
>>>> +++ b/src/mesa/drivers/dri/nouveau/nouveau_screen.c
>>>> @@ -233,9 +233,11 @@ static const struct __DRI2flushExtensionRec nouveau_flush_extension = {
>>>>  };
>>>>
>>>>  static const struct __DRItexBufferExtensionRec nouveau_texbuffer_extension = {
>>>> -    { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
>>>> -    NULL,
>>>> -    nouveau_set_texbuffer,
>>>> +   .base = { __DRI_TEX_BUFFER, 2 },
>>>> +
>>>> +   .setTexBuffer        = NULL,
>>>> +   .setTexBuffer2       = nouveau_set_texbuffer,
>>>> +   .releaseTexBuffer    = NULL,
>>>>  };
>>>>
>>>>  static const __DRIextension *nouveau_screen_extensions[] = {
>>>> diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c
>>>> index 57e866e..8d6840f 100644
>>>> --- a/src/mesa/drivers/dri/radeon/radeon_screen.c
>>>> +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c
>>>> @@ -170,15 +170,19 @@ radeonGetParam(__DRIscreen *sPriv, int param, void *value)
>>>>
>>>>  #if defined(RADEON_R100)
>>>>  static const __DRItexBufferExtension radeonTexBufferExtension = {
>>>> -    { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
>>>> -   radeonSetTexBuffer,
>>>> -   radeonSetTexBuffer2,
>>>> +   .base = { __DRI_TEX_BUFFER, 2 },
>>>> +
>>>> +   .setTexBuffer        = radeonSetTexBuffer,
>>>> +   .setTexBuffer2       = radeonSetTexBuffer2,
>>>> +   .releaseTexBuffer    = NULL,
>>>>  };
>>>>  #elif defined(RADEON_R200)
>>>>  static const __DRItexBufferExtension r200TexBufferExtension = {
>>>> -    { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
>>>> -   r200SetTexBuffer,
>>>> -   r200SetTexBuffer2,
>>>> +   .base = { __DRI_TEX_BUFFER, 2 },
>>>> +
>>>> +   .setTexBuffer        = r200SetTexBuffer,
>>>> +   .setTexBuffer2       = r200SetTexBuffer2,
>>>> +   .releaseTexBuffer    = NULL,
>>>>  };
>>>>  #endif
>>>>
>>>> diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c
>>>> index 071192c..826ee92 100644
>>>> --- a/src/mesa/drivers/dri/swrast/swrast.c
>>>> +++ b/src/mesa/drivers/dri/swrast/swrast.c
>>>> @@ -110,9 +110,11 @@ static void swrastSetTexBuffer(__DRIcontext *pDRICtx, GLint target,
>>>>  }
>>>>
>>>>  static const __DRItexBufferExtension swrastTexBufferExtension = {
>>>> -    { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
>>>> -    swrastSetTexBuffer,
>>>> -    swrastSetTexBuffer2,
>>>> +   .base = { __DRI_TEX_BUFFER, 2 },
>>>> +
>>>> +   .setTexBuffer        = swrastSetTexBuffer,
>>>> +   .setTexBuffer2       = swrastSetTexBuffer2,
>>>> +   .releaseTexBuffer    = NULL,
>>>>  };
>>>>
>>>>  static const __DRIextension *dri_screen_extensions[] = {
>>>> --
>>>> 1.8.5.4
>>>>
>>>> _______________________________________________
>>>> mesa-dev mailing list
>>>> mesa-dev at lists.freedesktop.org
>>>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>>
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 



More information about the mesa-dev mailing list