[Intel-gfx] [PATCH 05/15] drm/i915: Handle the overflow condition for command stream buf

Matthew Auld matthew.william.auld at gmail.com
Mon Nov 7 11:10:19 UTC 2016


On 4 November 2016 at 09:30,  <sourab.gupta at intel.com> wrote:
> From: Sourab Gupta <sourab.gupta at intel.com>
>
> Add a compile time option for detecting the overflow condition of command
> stream buffer, and not overwriting the old entries in such a case.
> Also, set a status flag to forward the overflow condition to userspace if
> overflow is detected.
>
> Signed-off-by: Sourab Gupta <sourab.gupta at intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h  |  2 ++
>  drivers/gpu/drm/i915/i915_perf.c | 75 ++++++++++++++++++++++++++++++++--------
>  2 files changed, 62 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index dedb7f8..e9cf939 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2235,6 +2235,8 @@ struct drm_i915_private {
>                         struct drm_i915_gem_object *obj;
>                         struct i915_vma *vma;
>                         u8 *addr;
> +#define I915_PERF_CMD_STREAM_BUF_STATUS_OVERFLOW (1<<0)
> +                       u32 status;
>                 } command_stream_buf;
>
>                 struct list_head node_list;
> diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
> index 2ee4711..e10e78f 100644
> --- a/drivers/gpu/drm/i915/i915_perf.c
> +++ b/drivers/gpu/drm/i915/i915_perf.c
> @@ -247,6 +247,9 @@ static u32 i915_perf_stream_paranoid = true;
>  #define GEN8_OAREPORT_REASON_GO_TRANSITION  (1<<23)
>  #define GEN9_OAREPORT_REASON_CLK_RATIO      (1<<24)
>
> +/* For determining the behavior on overflow of command stream samples */
> +#define CMD_STREAM_BUF_OVERFLOW_ALLOWED
By compile time option I sort of imagined this would be a kconfig
option, otherwise I would be expected to manually hack at this file
and carry around the local change ?


More information about the Intel-gfx mailing list