etnaviv/drm: Add some bo debug output
This makes it simpler to trace BO usage. Signed-off-by: Guido Günther <agx@sigxcpu.org> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com> Acked-by: Lucas Stach <l.stach@pengutronix.de> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10546>
This commit is contained in:
parent
87879b0633
commit
a93c0e1860
|
@ -46,6 +46,7 @@ static void set_name(struct etna_bo *bo, uint32_t name)
|
|||
/* Called under etna_drm_table_lock */
|
||||
void _etna_bo_del(struct etna_bo *bo)
|
||||
{
|
||||
DEBUG_BO("Del bo:", bo);
|
||||
VG_BO_FREE(bo);
|
||||
|
||||
simple_mtx_assert_locked(&etna_drm_table_lock);
|
||||
|
@ -150,6 +151,7 @@ struct etna_bo *etna_bo_new(struct etna_device *dev, uint32_t size,
|
|||
bo->reuse = 1;
|
||||
simple_mtx_unlock(&etna_drm_table_lock);
|
||||
|
||||
DEBUG_BO("New bo:", bo);
|
||||
VG_BO_ALLOC(bo);
|
||||
|
||||
return bo;
|
||||
|
@ -210,6 +212,7 @@ struct etna_bo *etna_bo_from_name(struct etna_device *dev,
|
|||
bo = bo_from_handle(dev, req.size, req.handle, 0);
|
||||
if (bo) {
|
||||
set_name(bo, name);
|
||||
DEBUG_BO("New from name:", bo);
|
||||
VG_BO_ALLOC(bo);
|
||||
}
|
||||
|
||||
|
@ -251,6 +254,7 @@ struct etna_bo *etna_bo_from_dmabuf(struct etna_device *dev, int fd)
|
|||
|
||||
bo = bo_from_handle(dev, size, handle, 0);
|
||||
|
||||
DEBUG_BO("New from dmabuf:", bo);
|
||||
VG_BO_ALLOC(bo);
|
||||
|
||||
out_unlock:
|
||||
|
|
|
@ -205,6 +205,11 @@ extern int etna_mesa_debug;
|
|||
do { debug_printf("[E] " fmt " (%s:%d)\n", \
|
||||
##__VA_ARGS__, __FUNCTION__, __LINE__); } while (0)
|
||||
|
||||
#define DEBUG_BO(msg, bo) \
|
||||
DEBUG_MSG("%s %p, va: 0x%.8x, size: 0x%.8x, flags: 0x%.8x, " \
|
||||
"refcnt: %d, handle: 0x%.8x, name: 0x%.8x", \
|
||||
msg, bo, bo->va, bo->size, bo->flags, bo->refcnt, bo->handle, bo->name);
|
||||
|
||||
#define VOID2U64(x) ((uint64_t)(unsigned long)(x))
|
||||
|
||||
static inline void get_abs_timeout(struct drm_etnaviv_timespec *tv, uint64_t ns)
|
||||
|
|
Loading…
Reference in New Issue