Re: [PATCH 17/49] drm/i915/bdw: A bit more advanced context init/fini

Damien Lespiau
2014-04-01T00:39:04Z

On Thu, Mar 27, 2014 at 05:59:46PM +0000, oscar.mateo@intel.com wrote:
> --- a/drivers/gpu/drm/i915/i915_lrc.c
> +++ b/drivers/gpu/drm/i915/i915_lrc.c
> @@ -41,7 +41,45 @@
> #include <drm/i915_drm.h>
> #include "i915_drv.h"
>
> +#define GEN8_LR_CONTEXT_SIZE (21 * PAGE_SIZE)

I'm a bit puzzled by that number:
- I found a sentence saying: "the Context Image for the rendering
engine consists of 20 4K pages", which seems that it includes the
HWS page (on the same page it says context layout = HWS Page +
register state context).
- When looking at the register state context for the render engine:
18096 dwords -> 18 pages, so in total it'd be 19 pages (need to add
the HWS Page)
- Clearly I must be missing something :)
- That's only for the render engine, other engines have a much smaller
context, smaller enough that it's worth looking at their exact size.
- It'd be nice to work out the real size from the *CXT_*SIZE
registers.

All of this can be refinement patches on top I guess, might have a look
at it.

--
Damien