[Intel-gfx] [Mesa-dev] [PATCH] i965: Add hardware context support.

Eric Anholt eric at anholt.net
Wed Jun 13 19:59:47 CEST 2012


On Tue, 12 Jun 2012 12:07:09 -0700, Kenneth Graunke <kenneth at whitecape.org> wrote:
> With fixes and updates from Ben Widawsky and comments from Paul Berry.
> 
> This should not be pushed until libdrm 2.4.36 is released with Ben's
> hardware context support.
> 
> I haven't hooked up the context destroy function yet as I'm not entirely
> sure about tear-down, but they will be freed on fd close, so it should
> only be a problem for long running processes that open and destroy many
> GL contexts.

What's wrong with just freeing our context at brw_destroy_context()?  We
definietly have to manually free the stuff, since some apps (web
browsers) will have many context create/destroy cycles.

> diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
> index c2f7d29..fc244c1 100644
> --- a/src/mesa/drivers/dri/intel/intel_context.c
> +++ b/src/mesa/drivers/dri/intel/intel_context.c
> @@ -593,6 +593,8 @@ intelInitContext(struct intel_context *intel,
>     if (intelScreen->bufmgr == NULL)
>        return false;
>  
> +   intel->hw_ctx = NULL;

it's rzalloced, so we don't manually zero most of our data.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20120613/6cbaca44/attachment.sig>


More information about the Intel-gfx mailing list