[Intel-gfx] [PATCH 02/25 v2] drm/i915: preliminary context support
Ville Syrjälä
ville.syrjala at linux.intel.com
Tue Jun 5 14:23:26 CEST 2012
On Mon, Jun 04, 2012 at 02:42:42PM -0700, Ben Widawsky wrote:
> Very basic code for context setup/destruction in the driver.
>
> Adds the file i915_gem_context.c This file implements HW context
> support. On gen5+ a HW context consists of an opaque GPU object which is
> referenced at times of context saves and restores. With RC6 enabled,
> the context is also referenced as the GPU enters and exists from RC6
> (GPU has it's own internal power context, except on gen5). Though
> something like a context does exist for the media ring, the code only
> supports contexts for the render ring.
>
> In software, there is a distinction between contexts created by the
> user, and the default HW context. The default HW context is used by GPU
> clients that do not request setup of their own hardware context. The
> default context's state is never restored to help prevent programming
> errors. This would happen if a client ran and piggy-backed off another
> clients GPU state. The default context only exists to give the GPU some
> offset to load as the current to invoke a save of the context we
> actually care about. In fact, the code could likely be constructed,
> albeit in a more complicated fashion, to never use the default context,
> though that limits the driver's ability to swap out, and/or destroy
> other contexts.
I'm not actually familiar with the GPU state management in the driver
yet, but I assume that currently much of the state has to be uploaded
every time a client submits rendering commands to the GPU.
So would it make sense to have an implicit context created for each
client? That way each client could just pretend that it's the only user
of the GPU and wouldn't have to worry about someone else corrupting the
GPU state.
--
Ville Syrjälä
Intel OTC
More information about the Intel-gfx
mailing list