Re: [PATCH 02/13] drm/i915: Implement command buffer parsing logic

Jani Nikula
2014-03-20T12:40:19Z

On Tue, 18 Feb 2014, bradley.d.volkin@intel.com wrote:
> +static u32 gen7_render_get_cmd_length_mask(u32 cmd_header)
> +{
> + u32 client = (cmd_header & INSTR_CLIENT_MASK) >> INSTR_CLIENT_SHIFT;
> + u32 subclient =
> + (cmd_header & INSTR_SUBCLIENT_MASK) >> INSTR_SUBCLIENT_SHIFT;
> +
> + if (client == INSTR_MI_CLIENT)
> + return 0x3F;
> + else if (client == INSTR_RC_CLIENT) {
> + if (subclient == INSTR_MEDIA_SUBCLIENT)
> + return 0xFFFF;
> + else
> + return 0xFF;
> + }
> +
> + DRM_DEBUG_DRIVER("CMD: Abnormal rcs cmd length! 0x%08X\n", cmd_header);
> + return 0;
> +}
> +
> +static u32 gen7_bsd_get_cmd_length_mask(u32 cmd_header)
> +{
> + u32 client = (cmd_header & INSTR_CLIENT_MASK) >> INSTR_CLIENT_SHIFT;
> + u32 subclient =
> + (cmd_header & INSTR_SUBCLIENT_MASK) >> INSTR_SUBCLIENT_SHIFT;
> +
> + if (client == INSTR_MI_CLIENT)
> + return 0x3F;
> + else if (client == INSTR_RC_CLIENT) {
> + if (subclient == INSTR_MEDIA_SUBCLIENT)
> + return 0xFFF;

Should this be 0xffff like in gen7_render_get_cmd_length_mask()?

Jani.

> + else
> + return 0xFF;
> + }
> +
> + DRM_DEBUG_DRIVER("CMD: Abnormal bsd cmd length! 0x%08X\n", cmd_header);
> + return 0;
> +}

--
Jani Nikula, Intel Open Source Technology Center