[Mesa-dev] [PATCH 1/3] dri2: Implement a throttle dri extension.
Thomas Hellstrom
thellstrom at vmware.com
Wed Oct 12 02:35:04 PDT 2011
Thanks for reviewing, Michel.
On 10/11/2011 05:29 PM, Michel Dänzer wrote:
> On Die, 2011-10-11 at 15:44 +0200, Thomas Hellstrom wrote:
>
>> The X server has limited throttle support on the server side,
>> but doing this in the client has some benefits:
>>
>> 1) X server throttling is per client. Client side throttling can be done
>> per drawable.
>>
>> 2) It's easier to control the throttling based on what client is run,
>> for example using "driconf".
>>
>> 3) X server throttling requires drm swap complete events.
>>
>> So implement a dri2 throttling extension intended to be used by direct
>> rendering clients.
>>
> I'm on the fence about whether it's better to add a new extension for
> this or to add anything missing to the flush extension instead, as the
> callsites are basically the same.
>
I agree. What made me favor a new extension was that we'd have to add a
new function anyway, since
we pass more argument. Also the throttling extension will most likely
never be called from AIGLX, since
that would stall the server.
>
>
>> @@ -390,6 +393,15 @@ dri2CopySubBuffer(__GLXDRIdrawable *pdraw, int x, int y, int width, int height)
>> (*psc->f->flush) (priv->driDrawable);
>> #endif
>>
>> + if (psc->throttle) {
>> + struct glx_context *gc = __glXGetCurrentContext();
>> + struct dri2_context *dri2Ctx = (struct dri2_context *)gc;
>> + __DRIcontext *ctx =
>> + (dri2Ctx) ? dri2Ctx->driContext : NULL;
>> +
>> + psc->throttle->throttle(ctx, priv->driDrawable, reason);
>> + }
>> +
>>
> Either way though, these blocks should probably be refactored into a
> helper function.
>
>
>
Sure. I'll take care of that.
More information about the mesa-dev
mailing list