Skip to content

Commit

Permalink
Set SSEU configuration according to the per-context createOption.
Browse files Browse the repository at this point in the history
Fixes #267.
  • Loading branch information
zxye committed Aug 13, 2018
1 parent 94e0dd5 commit 9c0a28e
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions media_driver/linux/common/os/mos_os_specific.c
Original file line number Diff line number Diff line change
Expand Up @@ -3790,6 +3790,43 @@ MOS_STATUS Mos_Specific_CreateGpuContext(
pOsContextSpecific->SetGpuContextHandle(mosGpuCxt, gpuContextSpecific->GetGpuContextHandle());
}

if (createOption->SSEUValue)
{
struct drm_i915_gem_context_param_sseu sseu = { .flags = I915_EXEC_RENDER };

if (mos_get_context_param_sseu(pOsInterface->pOsContext->intel_context, &sseu))
{
MOS_OS_ASSERTMESSAGE("Failed to get sseu configuration.");
return MOS_STATUS_UNKNOWN;
};

if (createOption->packed.SliceCount)
{
sseu.packed.slice_mask = mos_get_slice_mask(createOption->packed.SliceCount);
}

if (createOption->packed.SubSliceCount)
{
sseu.packed.subslice_mask = mos_get_slice_mask(createOption->packed.SubSliceCount);
}

if (createOption->packed.MinEUcountPerSubSlice)
{
sseu.packed.min_eu_per_subslice = createOption->packed.MinEUcountPerSubSlice;
}

if (createOption->packed.MaxEUcountPerSubSlice)
{
sseu.packed.max_eu_per_subslice = createOption->packed.MaxEUcountPerSubSlice;
}

if (mos_set_context_param_sseu(pOsInterface->pOsContext->intel_context, sseu))
{
MOS_OS_ASSERTMESSAGE("Failed to set sseu configuration.");
return MOS_STATUS_UNKNOWN;
};
}

return MOS_STATUS_SUCCESS;
}

Expand Down

0 comments on commit 9c0a28e

Please sign in to comment.