Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose va-attrib to configure scanout flag #1811

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion media_softlet/linux/common/ddi/media_libva_util_next.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,9 @@ VAStatus MediaLibvaUtilNext::CreateInternalSurface(
alloc.ext.mem_type = params.memType;
alloc.ext.pat_index = patIndex;
alloc.ext.cpu_cacheable = isCpuCacheable;
if (VA_SURFACE_ATTRIB_USAGE_HINT_SCANOUT & mediaSurface->surfaceUsageHint)
alloc.ext.use_scanout = true;

bo = mos_bo_alloc(mediaDrvCtx->pDrmBufMgr, &alloc);
params.pitch = gmmPitch;
}
Expand All @@ -863,6 +866,8 @@ VAStatus MediaLibvaUtilNext::CreateInternalSurface(
alloc_tiled.ext.mem_type = params.memType;;
alloc_tiled.ext.pat_index = patIndex;
alloc_tiled.ext.cpu_cacheable = isCpuCacheable;
if (VA_SURFACE_ATTRIB_USAGE_HINT_SCANOUT & mediaSurface->surfaceUsageHint)
alloc_tiled.ext.use_scanout = true;

bo = mos_bo_alloc_tiled(mediaDrvCtx->pDrmBufMgr, &alloc_tiled);
params.pitch = alloc_tiled.pitch;
Expand Down Expand Up @@ -2448,4 +2453,4 @@ void MediaLibvaUtilNext::MediaPrintFps()
pthread_mutex_unlock(&m_fpsMutex);
return;
}
#endif
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ struct mos_drm_bo_alloc_ext{
int mem_type = 0;
uint16_t pat_index = PAT_INDEX_INVALID;
bool cpu_cacheable = true;
bool use_scanout = false;
};

struct mos_drm_bo_alloc {
Expand Down
3 changes: 3 additions & 0 deletions media_softlet/linux/common/os/xe/mos_bufmgr_xe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,9 @@ mos_bo_alloc_xe(struct mos_bufmgr *bufmgr,
*/
create.cpu_caching = alloc->ext.cpu_cacheable ? DRM_XE_GEM_CPU_CACHING_WB : DRM_XE_GEM_CPU_CACHING_WC;

if (alloc->ext.use_scanout)
create.flags |= DRM_XE_GEM_CREATE_FLAG_SCANOUT;

ret = drmIoctl(bufmgr_gem->fd,
DRM_IOCTL_XE_GEM_CREATE,
&create);
Expand Down
Loading