summaryrefslogtreecommitdiff
path: root/src/radeon_exa.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2018-05-18 18:49:35 +0200
committerMichel Dänzer <michel@daenzer.net>2018-07-09 18:28:05 +0200
commitb85b7b11f5b5e792f21951b881bd8433d3d70858 (patch)
treee079f521cf1a8600ee31d073c56b00088dca3acd /src/radeon_exa.c
parent37ba075b34130c41bb7a2261bd666af5b29ffaf3 (diff)
Add struct radeon_buffer
Inspired by amdgpu, preparation for the following change. For now, this is mostly a wrapper around struct radeon_bo, no functional change intended. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/radeon_exa.c')
-rw-r--r--src/radeon_exa.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/radeon_exa.c b/src/radeon_exa.c
index ef60bc0c..90d92d7b 100644
--- a/src/radeon_exa.c
+++ b/src/radeon_exa.c
@@ -184,11 +184,11 @@ Bool RADEONPrepareAccess_CS(PixmapPtr pPix, int index)
return FALSE;
/* if we have more refs than just the BO then flush */
- if (radeon_bo_is_referenced_by_cs(driver_priv->bo, info->cs)) {
+ if (radeon_bo_is_referenced_by_cs(driver_priv->bo->bo.radeon, info->cs)) {
flush = TRUE;
if (can_fail) {
- possible_domains = radeon_bo_get_src_domain(driver_priv->bo);
+ possible_domains = radeon_bo_get_src_domain(driver_priv->bo->bo.radeon);
if (possible_domains == RADEON_GEM_DOMAIN_VRAM)
return FALSE; /* use DownloadFromScreen */
}
@@ -196,7 +196,7 @@ Bool RADEONPrepareAccess_CS(PixmapPtr pPix, int index)
/* if the BO might end up in VRAM, prefer DownloadFromScreen */
if (can_fail && (possible_domains & RADEON_GEM_DOMAIN_VRAM)) {
- radeon_bo_is_busy(driver_priv->bo, &current_domain);
+ radeon_bo_is_busy(driver_priv->bo->bo.radeon, &current_domain);
if (current_domain & possible_domains) {
if (current_domain == RADEON_GEM_DOMAIN_VRAM)
@@ -209,14 +209,14 @@ Bool RADEONPrepareAccess_CS(PixmapPtr pPix, int index)
radeon_cs_flush_indirect(pScrn);
/* flush IB */
- ret = radeon_bo_map(driver_priv->bo, 1);
+ ret = radeon_bo_map(driver_priv->bo->bo.radeon, 1);
if (ret) {
FatalError("failed to map pixmap %d\n", ret);
return FALSE;
}
driver_priv->bo_mapped = TRUE;
- pPix->devPrivate.ptr = driver_priv->bo->ptr;
+ pPix->devPrivate.ptr = driver_priv->bo->bo.radeon->ptr;
return TRUE;
}
@@ -229,7 +229,7 @@ void RADEONFinishAccess_CS(PixmapPtr pPix, int index)
if (!driver_priv || !driver_priv->bo_mapped)
return;
- radeon_bo_unmap(driver_priv->bo);
+ radeon_bo_unmap(driver_priv->bo->bo.radeon);
driver_priv->bo_mapped = FALSE;
pPix->devPrivate.ptr = NULL;
}
@@ -277,8 +277,7 @@ void RADEONEXADestroyPixmap(ScreenPtr pScreen, void *driverPriv)
if (!driverPriv)
return;
- if (driver_priv->bo)
- radeon_bo_unref(driver_priv->bo);
+ radeon_buffer_unref(&driver_priv->bo);
drmmode_fb_reference(pRADEONEnt->fd, &driver_priv->fb, NULL);
free(driverPriv);
}
@@ -287,7 +286,7 @@ Bool RADEONEXASharePixmapBacking(PixmapPtr ppix, ScreenPtr slave, void **fd_hand
{
struct radeon_exa_pixmap_priv *driver_priv = exaGetPixmapDriverPrivate(ppix);
- if (!radeon_share_pixmap_backing(driver_priv->bo, fd_handle))
+ if (!radeon_share_pixmap_backing(driver_priv->bo->bo.radeon, fd_handle))
return FALSE;
driver_priv->shared = TRUE;