From 3032793800ba5f687329255f5f97b653f02d3d9f Mon Sep 17 00:00:00 2001 From: Disantkumar Mistry Date: Wed, 22 May 2024 17:02:30 +0530 Subject: [PATCH] Added Debug logs Change-Id: Ie48186a54a76e8b258cb14c60b3f2ba53be46597 --- src/egl/drivers/dri2/egl_dri2.c | 1 + src/egl/drivers/dri2/platform_device.c | 1 + src/egl/drivers/dri2/platform_drm.c | 1 + src/egl/drivers/dri2/platform_surfaceless.c | 1 + src/egl/drivers/dri2/platform_wayland.c | 4 ++++ .../auxiliary/target-helpers/drm_helper.h | 4 ++++ src/gallium/auxiliary/util/u_inlines.h | 11 ++++++++++ src/gallium/auxiliary/vl/vl_winsys_dri3.c | 5 +++++ .../auxiliary/vl/vl_winsys_xlib_swrast.c | 1 + src/gallium/drivers/virgl/virgl_resource.c | 8 ++++++- src/gallium/drivers/virgl/virgl_screen.c | 1 + src/gallium/drivers/virgl/virgl_staging_mgr.c | 1 + src/gallium/drivers/virgl/virgl_texture.c | 1 + src/gallium/frontends/dri/dri2.c | 13 +++++++++++- src/gallium/frontends/dri/drisw.c | 1 + .../winsys/sw/wrapper/wrapper_sw_winsys.c | 1 + .../winsys/virgl/drm/virgl_drm_winsys.c | 21 +++++++++++++++++-- src/gbm/backends/dri/gbm_dri.c | 1 + src/loader/loader_dri3_helper.c | 9 +++++++- src/loader/loader_dri_helper.c | 1 + src/mesa/main/bufferobj.c | 4 ++++ src/mesa/main/renderbuffer.c | 1 + src/virtio/vulkan/vn_renderer_virtgpu.c | 3 +++ src/vulkan/wsi/wsi_common.c | 8 +++++++ src/vulkan/wsi/wsi_common_display.c | 1 + src/vulkan/wsi/wsi_common_drm.c | 6 ++++++ src/vulkan/wsi/wsi_common_headless.c | 1 + src/vulkan/wsi/wsi_common_wayland.c | 1 + src/vulkan/wsi/wsi_common_x11.c | 1 + 29 files changed, 108 insertions(+), 5 deletions(-) diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 1533c4939d9..b7e056d1f43 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -2900,6 +2900,7 @@ dri2_create_drm_image_mesa(_EGLDisplay *disp, const EGLint *attr_list) _eglInitImage(&dri2_img->base, disp); + log_info("dri2_create_drm_image_mesa::dri2_dpy->image->createImage\n"); dri2_img->dri_image = dri2_dpy->image->createImage(dri2_dpy->dri_screen_render_gpu, attrs.Width, attrs.Height, format, dri_use, dri2_img); diff --git a/src/egl/drivers/dri2/platform_device.c b/src/egl/drivers/dri2/platform_device.c index e748284bd6f..77ba5e67912 100644 --- a/src/egl/drivers/dri2/platform_device.c +++ b/src/egl/drivers/dri2/platform_device.c @@ -48,6 +48,7 @@ static __DRIimage * device_alloc_image(struct dri2_egl_display *dri2_dpy, struct dri2_egl_surface *dri2_surf) { + log_info("device_alloc_image::dri2_dpy->image->createImage\n"); return dri2_dpy->image->createImage( dri2_dpy->dri_screen_render_gpu, dri2_surf->base.Width, dri2_surf->base.Height, dri2_surf->visual, 0, NULL); diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c index 3933f3776bd..19dcad1d503 100644 --- a/src/egl/drivers/dri2/platform_drm.c +++ b/src/egl/drivers/dri2/platform_drm.c @@ -246,6 +246,7 @@ get_back_bo(struct dri2_egl_surface *dri2_surf) unsigned flags = surf->base.v0.flags; if (dri2_surf->base.ProtectedContent) flags |= GBM_BO_USE_PROTECTED; + printf(">>>>> mesa::get_back_bo\n"); dri2_surf->back->bo = gbm_bo_create(&dri2_dpy->gbm_dri->base, surf->base.v0.width, surf->base.v0.height, surf->base.v0.format, flags); diff --git a/src/egl/drivers/dri2/platform_surfaceless.c b/src/egl/drivers/dri2/platform_surfaceless.c index 0668ec9285f..e21dc214118 100644 --- a/src/egl/drivers/dri2/platform_surfaceless.c +++ b/src/egl/drivers/dri2/platform_surfaceless.c @@ -43,6 +43,7 @@ static __DRIimage * surfaceless_alloc_image(struct dri2_egl_display *dri2_dpy, struct dri2_egl_surface *dri2_surf) { + log_info("surfaceless_alloc_image::dri2_dpy->image->createImage\n"); return dri2_dpy->image->createImage( dri2_dpy->dri_screen_render_gpu, dri2_surf->base.Width, dri2_surf->base.Height, dri2_surf->visual, 0, NULL); diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index f04aadbc30e..4fbba132506 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -933,6 +933,7 @@ create_dri_image_from_dmabuf_feedback(struct dri2_egl_surface *dri2_surf, if (tranche->flags & ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_SCANOUT) flags |= __DRI_IMAGE_USE_SCANOUT; + log_info("create_dri_image_from_dmabuf_feedback::loader_dri_create_image\n"); dri2_surf->back->dri_image = loader_dri_create_image( dri2_dpy->dri_screen_render_gpu, dri2_dpy->image, dri2_surf->base.Width, dri2_surf->base.Height, pipe_format, @@ -969,6 +970,7 @@ create_dri_image(struct dri2_egl_surface *dri2_surf, /* If our DRIImage implementation does not support createImageWithModifiers, * then fall back to the old createImage, and hope it allocates an image * which is acceptable to the winsys. */ + log_info("create_dri_image::loader_dri_create_image\n"); dri2_surf->back->dri_image = loader_dri_create_image( dri2_dpy->dri_screen_render_gpu, dri2_dpy->image, dri2_surf->base.Width, dri2_surf->base.Height, pipe_format, @@ -1052,6 +1054,7 @@ get_back_bo(struct dri2_egl_surface *dri2_surf) __DRIimage *linear_copy_display_gpu_image = NULL; if (dri2_dpy->dri_screen_display_gpu) { + log_info("get_back_bo::dri_screen_display_gpu::loader_dri_create_image\n"); linear_copy_display_gpu_image = loader_dri_create_image( dri2_dpy->dri_screen_display_gpu, dri2_dpy->image, dri2_surf->base.Width, dri2_surf->base.Height, @@ -1137,6 +1140,7 @@ get_back_bo(struct dri2_egl_surface *dri2_surf) } if (!dri2_surf->back->linear_copy) { + log_info("get_back_bo::!dri2_surf->back->linear_copy::loader_dri_create_image\n"); dri2_surf->back->linear_copy = loader_dri_create_image( dri2_dpy->dri_screen_render_gpu, dri2_dpy->image, dri2_surf->base.Width, dri2_surf->base.Height, diff --git a/src/gallium/auxiliary/target-helpers/drm_helper.h b/src/gallium/auxiliary/target-helpers/drm_helper.h index 23f2215a1e6..b29cf0290f0 100644 --- a/src/gallium/auxiliary/target-helpers/drm_helper.h +++ b/src/gallium/auxiliary/target-helpers/drm_helper.h @@ -268,6 +268,7 @@ pipe_virtio_gpu_create_screen(int fd, const struct pipe_screen_config *config) { struct pipe_screen *screen = NULL; + log_info("pipe_virtio_gpu_create_screen\n"); /* Try native guest driver(s) first, and then fallback to virgl: */ #ifdef GALLIUM_FREEDRENO if (!screen) @@ -275,7 +276,10 @@ pipe_virtio_gpu_create_screen(int fd, const struct pipe_screen_config *config) #endif #ifdef GALLIUM_VIRGL if (!screen) + { + log_info("pipe_virtio_gpu_create_screen::virgl_drm_screen_create\n"); screen = virgl_drm_screen_create(fd, config); + } #endif return screen ? debug_screen_wrap(screen) : NULL; } diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h index 7e855e498db..19bd146d8c4 100644 --- a/src/gallium/auxiliary/util/u_inlines.h +++ b/src/gallium/auxiliary/util/u_inlines.h @@ -938,6 +938,17 @@ util_set_vertex_buffers(struct pipe_context *pipe, pipe->set_vertex_buffers(pipe, num_buffers, buffers); } +static inline void +log_format(const char* tag, const char* fn, const char* line, const char* message, va_list args) +{ + printf(">>>> [%ld] %s::MESA::%s[%s] ::",(long)getpid(),tag,fn,line); + vprintf(message, args); + printf("\n"); +} + +#define log_info(const char* message, ...)\ + { va_list args; va_start(args, message); log_format("info",__func__,__LINE__, message, args); va_end(args); } + #ifdef __cplusplus } #endif diff --git a/src/gallium/auxiliary/vl/vl_winsys_dri3.c b/src/gallium/auxiliary/vl/vl_winsys_dri3.c index 6d0f6bf03e0..e35a7447405 100644 --- a/src/gallium/auxiliary/vl/vl_winsys_dri3.c +++ b/src/gallium/auxiliary/vl/vl_winsys_dri3.c @@ -237,6 +237,7 @@ dri3_alloc_back_buffer(struct vl_dri3_screen *scrn) struct pipe_resource templ, *pixmap_buffer_texture; struct winsys_handle whandle; + log_info("dri3_alloc_back_buffer\n"); buffer = CALLOC_STRUCT(vl_dri3_buffer); if (!buffer) return NULL; @@ -262,6 +263,7 @@ dri3_alloc_back_buffer(struct vl_dri3_screen *scrn) templ.array_size = 1; if (scrn->is_different_gpu) { + log_info("dri3_alloc_back_buffer::resource_create::is_different_gpu\n"); buffer->texture = (scrn->output_texture) ? scrn->output_texture : scrn->base.pscreen->resource_create(scrn->base.pscreen, &templ); if (!buffer->texture) @@ -269,6 +271,7 @@ dri3_alloc_back_buffer(struct vl_dri3_screen *scrn) templ.bind |= PIPE_BIND_SCANOUT | PIPE_BIND_SHARED | PIPE_BIND_LINEAR; + log_info("dri3_alloc_back_buffer::resource_create::is_different_gpu::PIPE_BIND_SCANOUT/SHARED/LINEAR\n"); buffer->linear_texture = scrn->base.pscreen->resource_create(scrn->base.pscreen, &templ); pixmap_buffer_texture = buffer->linear_texture; @@ -276,6 +279,7 @@ dri3_alloc_back_buffer(struct vl_dri3_screen *scrn) if (!buffer->linear_texture) goto no_linear_texture; } else { + log_info("dri3_alloc_back_buffer::resource_create::else\n"); templ.bind |= PIPE_BIND_SCANOUT | PIPE_BIND_SHARED; buffer->texture = (scrn->output_texture) ? scrn->output_texture : scrn->base.pscreen->resource_create(scrn->base.pscreen, &templ); @@ -311,6 +315,7 @@ dri3_alloc_back_buffer(struct vl_dri3_screen *scrn) xshmfence_trigger(buffer->shm_fence); + log_info("dri3_alloc_back_buffer::returned\n"); return buffer; no_linear_texture: diff --git a/src/gallium/auxiliary/vl/vl_winsys_xlib_swrast.c b/src/gallium/auxiliary/vl/vl_winsys_xlib_swrast.c index 1d3b4a8e3c2..316225a09f2 100644 --- a/src/gallium/auxiliary/vl/vl_winsys_xlib_swrast.c +++ b/src/gallium/auxiliary/vl/vl_winsys_xlib_swrast.c @@ -174,6 +174,7 @@ vl_swrast_texture_from_drawable(struct vl_screen *vscreen, void *drawable) templat.last_level = 0; templat.bind = (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DISPLAY_TARGET); + log_info("vl_swrast_texture_from_drawable::vscreen->pscreen->resource_create\n"); scrn->drawable_texture = vscreen->pscreen->resource_create(vscreen->pscreen, &templat); } else { struct pipe_resource *drawable_texture = NULL; diff --git a/src/gallium/drivers/virgl/virgl_resource.c b/src/gallium/drivers/virgl/virgl_resource.c index ace2358833e..23d7f1f6f5c 100644 --- a/src/gallium/drivers/virgl/virgl_resource.c +++ b/src/gallium/drivers/virgl/virgl_resource.c @@ -449,6 +449,7 @@ virgl_resource_realloc(struct virgl_context *vctx, struct virgl_resource *res) int alloc_size = res->use_staging ? 1 : res->metadata.total_size; + log_info("virgl_resource_realloc::resource_create\n"); hw_res = vs->vws->resource_create(vs->vws, templ->target, NULL, @@ -618,10 +619,12 @@ static void virgl_resource_layout(struct pipe_resource *pt, nblocksy = util_format_get_nblocksy(pt->format, height); if ((pt->bind & (PIPE_BIND_SCANOUT | PIPE_BIND_SHARED)) == (PIPE_BIND_SCANOUT | PIPE_BIND_SHARED)) { /* Shared scanout buffers need to be aligned to 256 bytes */ - metadata->stride[level] = ALIGN(util_format_get_stride(pt->format, width), 256); + metadata->stride[level] = ALIGN( (winsys_stride ? winsys_stride : util_format_get_stride(pt->format, width)), 256); + log_info("virgl_resource_layout::SCANOUT/SHARED::metadata->stride[level]::%d\n",metadata->stride[level]); } else { metadata->stride[level] = winsys_stride ? winsys_stride : util_format_get_stride(pt->format, width); + log_info("virgl_resource_layout::metadata->stride[level]::%d\n",metadata->stride[level]); } metadata->layer_stride[level] = nblocksy * metadata->stride[level]; metadata->level_offset[level] = buffer_size; @@ -677,6 +680,7 @@ static struct pipe_resource *virgl_resource_create_front(struct pipe_screen *scr else alloc_size = res->metadata.total_size; + log_info("virgl_resource_create_front::vs->vws->resource_create\n"); res->hw_res = vs->vws->resource_create(vs->vws, templ->target, map_front_private, templ->format, vbind, @@ -732,6 +736,7 @@ static struct pipe_resource *virgl_resource_from_handle(struct pipe_screen *scre pipe_reference_init(&res->b.reference, 1); plane = winsys_stride = plane_offset = modifier = 0; + log_info("virgl_resource_from_handle::resource_create_from_handle\n"); res->hw_res = vs->vws->resource_create_from_handle(vs->vws, whandle, &res->b, &plane, @@ -752,6 +757,7 @@ static struct pipe_resource *virgl_resource_from_handle(struct pipe_screen *scre modifier = 0; } + log_info("virgl_resource_from_handle::virgl_resource_layout\n"); virgl_resource_layout(&res->b, &res->metadata, plane, winsys_stride, plane_offset, modifier); diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c index a841e171540..87107a5c0c1 100644 --- a/src/gallium/drivers/virgl/virgl_screen.c +++ b/src/gallium/drivers/virgl/virgl_screen.c @@ -1027,6 +1027,7 @@ static void virgl_query_memory_info(struct pipe_screen *screen, struct pipe_memo .flags = 0 }; + log_info("virgl_query_memory_info::screen->resource_create\n"); res = (struct virgl_resource*) screen->resource_create(screen, &templ); virgl_encode_get_memory_info(vctx, res); diff --git a/src/gallium/drivers/virgl/virgl_staging_mgr.c b/src/gallium/drivers/virgl/virgl_staging_mgr.c index c73c79ec233..7fd9d6093cf 100644 --- a/src/gallium/drivers/virgl/virgl_staging_mgr.c +++ b/src/gallium/drivers/virgl/virgl_staging_mgr.c @@ -45,6 +45,7 @@ virgl_staging_alloc_buffer(struct virgl_staging_mgr *staging, unsigned min_size) */ size = align(MAX2(staging->default_size, min_size), 4096); + log_info("virgl_staging_alloc_buffer::vws->resource_create\n"); staging->hw_res = vws->resource_create(vws, PIPE_BUFFER, NULL, diff --git a/src/gallium/drivers/virgl/virgl_texture.c b/src/gallium/drivers/virgl/virgl_texture.c index 7412d86b35e..c2d778a7c62 100644 --- a/src/gallium/drivers/virgl/virgl_texture.c +++ b/src/gallium/drivers/virgl/virgl_texture.c @@ -158,6 +158,7 @@ static void *texture_transfer_map_resolve(struct pipe_context *ctx, virgl_init_temp_resource_from_box(&templ, resource, &dst_box, level, 0, fmt); + log_info("texture_transfer_map_resolve::ctx->screen->resource_create\n"); resolve_tmp = ctx->screen->resource_create(ctx->screen, &templ); if (!resolve_tmp) return NULL; diff --git a/src/gallium/frontends/dri/dri2.c b/src/gallium/frontends/dri/dri2.c index b5137183b0c..0e78153e9d6 100644 --- a/src/gallium/frontends/dri/dri2.c +++ b/src/gallium/frontends/dri/dri2.c @@ -354,6 +354,7 @@ dri2_allocate_buffer(struct dri_screen *screen, templ.depth0 = 1; templ.array_size = 1; + log_info("dri2_allocate_buffer::screen->base.screen->resource_create\n"); buffer->resource = screen->base.screen->resource_create(screen->base.screen, &templ); if (!buffer->resource) { @@ -639,6 +640,7 @@ dri2_allocate_textures(struct dri_context *ctx, /* Allocate a new one. */ pipe_resource_reference(&drawable->msaa_textures[statt], NULL); + log_info("dri2_allocate_textures::screen->base.screen->resource_create\n"); drawable->msaa_textures[statt] = screen->base.screen->resource_create(screen->base.screen, &templ); @@ -697,6 +699,7 @@ dri2_allocate_textures(struct dri_context *ctx, (*zsbuf)->height0 != templ.height0) { /* Allocate a new one. */ pipe_resource_reference(zsbuf, NULL); + log_info("dri2_allocate_textures::screen->base.screen->resource_create2\n"); *zsbuf = screen->base.screen->resource_create(screen->base.screen, &templ); assert(*zsbuf); @@ -1251,15 +1254,20 @@ dri2_create_image_common(__DRIscreen *_screen, templ.array_size = 1; if (modifiers) + { + log_info("dri2_create_image_common::screen->base.screen->resource_create_with_modifiers\n"); img->texture = screen->base.screen ->resource_create_with_modifiers(screen->base.screen, &templ, modifiers, count); - else + }else + { + log_info("dri2_create_image_common::screen->base.screen->resource_create\n"); img->texture = screen->base.screen->resource_create(screen->base.screen, &templ); + } if (!img->texture) { FREE(img); return NULL; @@ -1283,6 +1291,7 @@ dri2_create_image(__DRIscreen *_screen, int width, int height, int format, unsigned int use, void *loaderPrivate) { + log_info("dri2_create_image::dri2_create_image_common\n"); return dri2_create_image_common(_screen, width, height, format, use, NULL /* modifiers */, 0 /* count */, loaderPrivate); @@ -1295,6 +1304,7 @@ dri2_create_image_with_modifiers(__DRIscreen *dri_screen, const unsigned count, void *loaderPrivate) { + log_info("dri2_create_image_with_modifiers::dri2_create_image_common\n"); return dri2_create_image_common(dri_screen, width, height, format, __DRI_IMAGE_USE_SHARE, modifiers, count, loaderPrivate); @@ -1307,6 +1317,7 @@ dri2_create_image_with_modifiers2(__DRIscreen *dri_screen, const unsigned count, unsigned int use, void *loaderPrivate) { + log_info("dri2_create_image_with_modifiers2::dri2_create_image_common\n"); return dri2_create_image_common(dri_screen, width, height, format, use, modifiers, count, loaderPrivate); } diff --git a/src/gallium/frontends/dri/drisw.c b/src/gallium/frontends/dri/drisw.c index a64092569aa..41f0504a51d 100644 --- a/src/gallium/frontends/dri/drisw.c +++ b/src/gallium/frontends/dri/drisw.c @@ -426,6 +426,7 @@ drisw_allocate_textures(struct dri_context *stctx, if (statts[i] == ST_ATTACHMENT_FRONT_LEFT && screen->base.screen->resource_create_front && loader->base.version >= 3) { + log_info("drisw_allocate_textures::screen->base.screen->resource_create_front\n"); drawable->textures[statts[i]] = screen->base.screen->resource_create_front(screen->base.screen, &templ, (const void *)drawable); } else diff --git a/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c b/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c index 427cbff7b42..e9c92be9921 100644 --- a/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c +++ b/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c @@ -169,6 +169,7 @@ wsw_dt_create(struct sw_winsys *ws, /* XXX alignment: we can't do anything about this */ + log_info("wsw_dt_create::wsw->screen->resource_create\n"); tex = wsw->screen->resource_create(wsw->screen, &templ); if (!tex) return NULL; diff --git a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c index a221e4cfd69..ec3358f2d9d 100644 --- a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c +++ b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c @@ -291,6 +291,7 @@ virgl_drm_winsys_resource_create_shared_scanout(struct virgl_winsys *qws, blob_id = p_atomic_inc_return(&qdws->blob_id); cmd[0] = VIRGL_CMD0(VIRGL_CCMD_PIPE_RESOURCE_CREATE, 0, VIRGL_PIPE_RES_CREATE_SIZE); cmd[VIRGL_PIPE_RES_CREATE_FORMAT] = pipe_to_virgl_format(format); + //cmd[VIRGL_PIPE_RES_CREATE_FORMAT] = format; cmd[VIRGL_PIPE_RES_CREATE_BIND] = bind; cmd[VIRGL_PIPE_RES_CREATE_TARGET] = target; cmd[VIRGL_PIPE_RES_CREATE_WIDTH] = width; @@ -558,22 +559,34 @@ virgl_drm_winsys_resource_cache_create(struct virgl_winsys *qws, if (target == PIPE_BUFFER && (bind & VIRGL_BIND_CUSTOM)) need_sync = true; + log_info("virgl_drm_winsys_resource_cache_create::format::%d ::bind::0x%x\n",format,bind); + if ((bind & (VIRGL_BIND_SCANOUT | VIRGL_BIND_SHARED)) == (VIRGL_BIND_SCANOUT | VIRGL_BIND_SHARED)) + { + //format = 49; + log_info("virgl_drm_winsys_resource_cache_create::create_shared_scanout::format::%d ::bind::0x%x\n",format,bind); res = virgl_drm_winsys_resource_create_shared_scanout(qws, target, format, bind, width, height, depth, array_size, last_level, nr_samples, flags, size); - else if (flags & (VIRGL_RESOURCE_FLAG_MAP_PERSISTENT | + } + else + if (flags & (VIRGL_RESOURCE_FLAG_MAP_PERSISTENT | VIRGL_RESOURCE_FLAG_MAP_COHERENT)) + { + log_info("virgl_drm_winsys_resource_cache_create::blob::format::%d ::bind::0x%x\n",format,bind); res = virgl_drm_winsys_resource_create_blob(qws, target, format, bind, width, height, depth, array_size, last_level, nr_samples, flags, size); + } else + { log_info("virgl_drm_winsys_resource_cache_create::else::format::%d ::bind::0x%x\n",format,bind); res = virgl_drm_winsys_resource_create(qws, target, format, bind, width, height, depth, array_size, last_level, nr_samples, size, need_sync); + } return res; } @@ -1337,7 +1350,7 @@ virgl_drm_winsys_create(int drmFD) struct virgl_drm_winsys *qdws; int drm_version; int ret; - + log_info("virgl_drm_winsys_create\n"); for (uint32_t i = 0; i < ARRAY_SIZE(params); i++) { struct drm_virtgpu_getparam getparam = { 0 }; uint64_t value = 0; @@ -1406,6 +1419,7 @@ virgl_drm_winsys_create(int drmFD) qdws->base.supports_coherent = params[param_resource_blob].value && params[param_host_visible].value; + log_info("virgl_drm_winsys_create::return\n"); return &qdws->base; } @@ -1476,6 +1490,7 @@ virgl_drm_screen_create(int fd, const struct pipe_screen_config *config) { struct pipe_screen *pscreen = NULL; + log_info("virgl_drm_screen_create\n"); simple_mtx_lock(&virgl_screen_mutex); if (!fd_tab) { fd_tab = _mesa_hash_table_create(NULL, hash_fd, equal_fd); @@ -1490,6 +1505,7 @@ virgl_drm_screen_create(int fd, const struct pipe_screen_config *config) struct virgl_winsys *vws; int dup_fd = os_dupfd_cloexec(fd); + log_info("virgl_drm_screen_create::virgl_drm_winsys_create\n"); vws = virgl_drm_winsys_create(dup_fd); if (!vws) { close(dup_fd); @@ -1511,5 +1527,6 @@ virgl_drm_screen_create(int fd, const struct pipe_screen_config *config) unlock: simple_mtx_unlock(&virgl_screen_mutex); + log_info("virgl_drm_screen_create::return\n"); return pscreen; } diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c index 9cccb34e729..0e95ac72e59 100644 --- a/src/gbm/backends/dri/gbm_dri.c +++ b/src/gbm/backends/dri/gbm_dri.c @@ -981,6 +981,7 @@ gbm_dri_bo_create(struct gbm_device *gbm, goto failed; } + log_info("gbm_dri_bo_create::loader_dri_create_image\n"); bo->image = loader_dri_create_image(dri->screen, dri->image, width, height, dri_format, dri_use, modifiers, count, bo); diff --git a/src/loader/loader_dri3_helper.c b/src/loader/loader_dri3_helper.c index 298140e8b91..f8949107af3 100644 --- a/src/loader/loader_dri3_helper.c +++ b/src/loader/loader_dri3_helper.c @@ -1520,6 +1520,7 @@ dri3_alloc_render_buffer(struct loader_dri3_drawable *draw, unsigned int format, free(mod_reply); } #endif + log_info("dri3_alloc_render_buffer::loader_dri_create_image\n"); buffer->image = loader_dri_create_image(draw->dri_screen_render_gpu, draw->ext->image, width, height, format, __DRI_IMAGE_USE_SHARE | @@ -1535,6 +1536,7 @@ dri3_alloc_render_buffer(struct loader_dri3_drawable *draw, unsigned int format, if (!buffer->image) goto no_image; } else { + log_info("dri3_alloc_render_buffer::else::draw->ext->image->createImage\n"); buffer->image = draw->ext->image->createImage(draw->dri_screen_render_gpu, width, height, format, @@ -1549,6 +1551,7 @@ dri3_alloc_render_buffer(struct loader_dri3_drawable *draw, unsigned int format, * is also used for display gpu. */ if (draw->dri_screen_display_gpu) { + log_info("dri3_alloc_render_buffer::else::dri_screen_display_gpu::draw->ext->image->createImage\n"); linear_buffer_display_gpu = draw->ext->display_image->createImage(draw->dri_screen_display_gpu, width, height, @@ -1565,6 +1568,7 @@ dri3_alloc_render_buffer(struct loader_dri3_drawable *draw, unsigned int format, } if (!pixmap_buffer) { + log_info("dri3_alloc_render_buffer::else::!pixmap_buffer::draw->ext->image->createImage\n"); image_ext = draw->ext->image; buffer->linear_buffer = draw->ext->image->createImage(draw->dri_screen_render_gpu, @@ -2080,6 +2084,7 @@ dri3_get_buffer(__DRIdrawable *driDrawable, /* Allocate the new buffers */ + log_info("dri3_get_buffer::dri3_alloc_render_buffer\n"); new_buffer = dri3_alloc_render_buffer(draw, format, draw->width, @@ -2394,9 +2399,11 @@ dri3_find_back_alloc(struct loader_dri3_drawable *draw) /* Allocate a new back if we haven't got one */ if (!back && draw->back_format != __DRI_IMAGE_FORMAT_NONE && dri3_update_drawable(draw)) + { + log_info("dri3_find_back_alloc::dri3_alloc_render_buffer\n"); back = dri3_alloc_render_buffer(draw, draw->back_format, draw->width, draw->height, draw->depth); - + } if (!back) return NULL; diff --git a/src/loader/loader_dri_helper.c b/src/loader/loader_dri_helper.c index f1afce47b92..11c0126b778 100644 --- a/src/loader/loader_dri_helper.c +++ b/src/loader/loader_dri_helper.c @@ -69,6 +69,7 @@ __DRIimage *loader_dri_create_image(__DRIscreen *screen, modifiers_count, loaderPrivate); } + log_info("loader_dri_create_image::image->createImage\n"); /* No modifier given or fallback to the legacy createImage allowed */ return image->createImage(screen, width, height, dri_format, dri_usage, loaderPrivate); diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 6ef81bcbd14..ee65cabbbb9 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -327,6 +327,7 @@ bufferobj_data(struct gl_context *ctx, if (size != 0) { struct pipe_resource buffer; + log_info("bufferobj_data::size != 0 \n"); memset(&buffer, 0, sizeof buffer); buffer.target = PIPE_BUFFER; buffer.format = PIPE_FORMAT_R8_UNORM; /* want TYPELESS or similar */ @@ -349,6 +350,7 @@ bufferobj_data(struct gl_context *ctx, screen->resource_from_user_memory(screen, &buffer, (void*)data); } else { + log_info("bufferobj_data::resource_create\n"); obj->buffer = screen->resource_create(screen, &buffer); if (obj->buffer && data) @@ -397,6 +399,7 @@ _mesa_bufferobj_data(struct gl_context *ctx, GLbitfield storageFlags, struct gl_buffer_object *obj) { + log_info("_mesa_bufferobj_data::bufferobj_data\n"); return bufferobj_data(ctx, target, size, data, NULL, 0, usage, storageFlags, obj); } @@ -409,6 +412,7 @@ bufferobj_data_mem(struct gl_context *ctx, GLenum usage, struct gl_buffer_object *bufObj) { + log_info("bufferobj_data_mem::bufferobj_data\n"); return bufferobj_data(ctx, target, size, NULL, memObj, offset, usage, GL_DYNAMIC_STORAGE_BIT, bufObj); } diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index dd3d7da4af6..cb9b8e6646d 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -284,6 +284,7 @@ renderbuffer_alloc_storage(struct gl_context * ctx, PIPE_BIND_RENDER_TARGET); } + log_info("renderbuffer_alloc_storage::resource_create\n"); rb->texture = screen->resource_create(screen, &templ); if (!rb->texture) diff --git a/src/virtio/vulkan/vn_renderer_virtgpu.c b/src/virtio/vulkan/vn_renderer_virtgpu.c index 411737e24b6..dd7703ec75d 100644 --- a/src/virtio/vulkan/vn_renderer_virtgpu.c +++ b/src/virtio/vulkan/vn_renderer_virtgpu.c @@ -1634,6 +1634,7 @@ virtgpu_open(struct virtgpu *gpu) static VkResult virtgpu_init(struct virtgpu *gpu) { + log_info("virtgpu_init\n"); util_sparse_array_init(&gpu->shmem_array, sizeof(struct virtgpu_shmem), 1024); util_sparse_array_init(&gpu->bo_array, sizeof(struct virtgpu_bo), 1024); @@ -1681,6 +1682,7 @@ virtgpu_init(struct virtgpu *gpu) gpu->base.sync_ops.read = virtgpu_sync_read; gpu->base.sync_ops.write = virtgpu_sync_write; + log_info("virtgpu_init::end\n"); return VK_SUCCESS; } @@ -1697,6 +1699,7 @@ vn_renderer_create_virtgpu(struct vn_instance *instance, gpu->instance = instance; gpu->fd = -1; + log_info("vn_renderer_create_virtgpu::virtgpu_init\n"); VkResult result = virtgpu_init(gpu); if (result != VK_SUCCESS) { virtgpu_destroy(&gpu->base, alloc); diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c index 0ce1f85b8de..334ee8977f7 100644 --- a/src/vulkan/wsi/wsi_common.c +++ b/src/vulkan/wsi/wsi_common.c @@ -361,12 +361,14 @@ configure_image(const struct wsi_swapchain *chain, { switch (params->image_type) { case WSI_IMAGE_TYPE_CPU: { + log_info("configure_image::WSI_IMAGE_TYPE_CPU\n"); const struct wsi_cpu_image_params *cpu_params = container_of(params, const struct wsi_cpu_image_params, base); return wsi_configure_cpu_image(chain, pCreateInfo, cpu_params, info); } #ifdef HAVE_LIBDRM case WSI_IMAGE_TYPE_DRM: { + log_info("configure_image::WSI_IMAGE_TYPE_DRM\n"); const struct wsi_drm_image_params *drm_params = container_of(params, const struct wsi_drm_image_params, base); return wsi_drm_configure_image(chain, pCreateInfo, drm_params, info); @@ -374,6 +376,7 @@ configure_image(const struct wsi_swapchain *chain, #endif #ifdef _WIN32 case WSI_IMAGE_TYPE_DXGI: { + log_info("configure_image::WSI_IMAGE_TYPE_DXGI\n"); const struct wsi_dxgi_image_params *dxgi_params = container_of(params, const struct wsi_dxgi_image_params, base); return wsi_dxgi_configure_image(chain, pCreateInfo, dxgi_params, info); @@ -1764,6 +1767,7 @@ wsi_create_buffer_blit_context(const struct wsi_swapchain *chain, }; __vk_append_struct(&buf_mem_info, &memory_export_info); } + log_info("wsi_create_buffer_blit_context\n"); #ifndef _WIN32 VkImportMemoryFdInfoKHR memory_fd_info; @@ -1771,6 +1775,7 @@ wsi_create_buffer_blit_context(const struct wsi_swapchain *chain, { int fd = 0; + log_info("wsi_create_buffer_blit_context::virtgpu_alloc_and_export\n"); fd = virtgpu_alloc_and_export(info->display_device_fd, info->linear_stride, info->linear_size); memory_fd_info = (VkImportMemoryFdInfoKHR){ .sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR, @@ -2090,6 +2095,7 @@ wsi_create_cpu_buffer_image_mem(const struct wsi_swapchain *chain, { VkResult result; + log_info("wsi_create_cpu_buffer_image_mem::wsi_create_buffer_blit_context\n"); result = wsi_create_buffer_blit_context(chain, info, image, 0, false /* implicit_sync */); if (result != VK_SUCCESS) @@ -2136,6 +2142,7 @@ wsi_configure_cpu_image(const struct wsi_swapchain *chain, return result; if (chain->blit.type != WSI_SWAPCHAIN_NO_BLIT) { + log_info("wsi_configure_cpu_image::wsi_create_cpu_buffer_image_mem\n"); wsi_configure_buffer_image(chain, pCreateInfo, 1 /* stride_align */, 1 /* size_align */, @@ -2145,6 +2152,7 @@ wsi_configure_cpu_image(const struct wsi_swapchain *chain, info->select_image_memory_type = wsi_select_device_memory_type; info->create_mem = wsi_create_cpu_buffer_image_mem; } else { + log_info("wsi_configure_cpu_image::wsi_create_cpu_linear_image_mem\n"); /* Force the image to be linear */ info->create.tiling = VK_IMAGE_TILING_LINEAR; diff --git a/src/vulkan/wsi/wsi_common_display.c b/src/vulkan/wsi/wsi_common_display.c index 3dc4a670cd7..091938ab5c6 100644 --- a/src/vulkan/wsi/wsi_common_display.c +++ b/src/vulkan/wsi/wsi_common_display.c @@ -2113,6 +2113,7 @@ wsi_display_surface_create_swapchain( return VK_ERROR_OUT_OF_HOST_MEMORY; } + log_info("wsi_display_surface_create_swapchain::wsi_swapchain_init\n"); VkResult result = wsi_swapchain_init(wsi_device, &chain->base, device, create_info, &image_params.base, allocator); diff --git a/src/vulkan/wsi/wsi_common_drm.c b/src/vulkan/wsi/wsi_common_drm.c index 2b2e52df6a6..abfa8f9b1d7 100644 --- a/src/vulkan/wsi/wsi_common_drm.c +++ b/src/vulkan/wsi/wsi_common_drm.c @@ -336,6 +336,7 @@ virtgpu_alloc_and_export(int fd, uint32_t linear_stride, uint32_t linear_size) struct drm_gem_close gem_close; uint32_t cmd[VIRGL_PIPE_RES_CREATE_SIZE + 1]; + log_info("virtgpu_alloc_and_export\n"); cmd[0] = VIRGL_CMD0(VIRGL_CCMD_PIPE_RESOURCE_CREATE, 0, VIRGL_PIPE_RES_CREATE_SIZE); cmd[VIRGL_PIPE_RES_CREATE_FORMAT] = VIRGL_FORMAT_B8G8R8X8_UNORM; // pipe_to_virgl_format(format); // 0x54000a @@ -405,6 +406,7 @@ virtgpu_alloc_and_export(int fd, uint32_t linear_stride, uint32_t linear_size) /* Weird! */ } + log_info("virtgpu_alloc_and_export::returned\n"); return prime_handle.fd; } @@ -727,6 +729,7 @@ wsi_create_prime_image_mem(const struct wsi_swapchain *chain, const struct wsi_image_info *info, struct wsi_image *image) { + log_info("wsi_create_prime_image_mem::wsi_create_buffer_blit_context\n"); VkResult result = wsi_create_buffer_blit_context(chain, info, image, VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT, @@ -741,6 +744,9 @@ wsi_create_prime_image_mem(const struct wsi_swapchain *chain, image->drm_modifier = info->prime_use_linear_modifier ? DRM_FORMAT_MOD_LINEAR : DRM_FORMAT_MOD_INVALID; + if(image->drm_modifier == DRM_FORMAT_MOD_LINEAR) + log_info("wsi_create_prime_image_mem::DRM_FORMAT_MOD_LINEAR\n"); + return VK_SUCCESS; } diff --git a/src/vulkan/wsi/wsi_common_headless.c b/src/vulkan/wsi/wsi_common_headless.c index 136a4d11209..e5fe28d81b1 100644 --- a/src/vulkan/wsi/wsi_common_headless.c +++ b/src/vulkan/wsi/wsi_common_headless.c @@ -461,6 +461,7 @@ wsi_headless_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, .same_gpu = true, }; + log_info("wsi_headless_surface_create_swapchain::wsi_swapchain_init\n"); result = wsi_swapchain_init(wsi_device, &chain->base, device, pCreateInfo, &drm_params.base, pAllocator); if (result != VK_SUCCESS) { diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c index 2b529397aa4..9b360ea8c91 100644 --- a/src/vulkan/wsi/wsi_common_wayland.c +++ b/src/vulkan/wsi/wsi_common_wayland.c @@ -2352,6 +2352,7 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, image_params = &drm_image_params.base; } + log_info("wsi_wl_surface_create_swapchain::wsi_swapchain_init\n"); result = wsi_swapchain_init(wsi_device, &chain->base, device, pCreateInfo, image_params, pAllocator); if (result != VK_SUCCESS) diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c index 748cbc3aa8e..40353626292 100644 --- a/src/vulkan/wsi/wsi_common_x11.c +++ b/src/vulkan/wsi/wsi_common_x11.c @@ -2500,6 +2500,7 @@ x11_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, image_params = &drm_image_params.base; } + log_info("x11_surface_create_swapchain::wsi_swapchain_init\n"); result = wsi_swapchain_init(wsi_device, &chain->base, device, pCreateInfo, image_params, pAllocator);