v3d: use screen name in disk cache

To keep in sync the GPU name used by the (pipe) screen and disk cache,
use the former in the latter.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29186>
This commit is contained in:
Juan A. Suarez Romero
2024-05-10 23:10:44 +02:00
committed by Marge Bot
parent 7900ecdfc7
commit ac7971e7f4
3 changed files with 7 additions and 12 deletions

View File

@@ -26,6 +26,7 @@
*/
#include "v3d_context.h"
#include "v3d_screen.h"
#include "util/blob.h"
#include "util/u_upload_mgr.h"
@@ -51,14 +52,6 @@ v3d_key_size(gl_shader_stage stage)
void v3d_disk_cache_init(struct v3d_screen *screen)
{
char *renderer;
ASSERTED int len =
asprintf(&renderer, "V3D %d.%d",
screen->devinfo.ver / 10,
screen->devinfo.ver % 10);
assert(len > 0);
const struct build_id_note *note =
build_id_find_nhdr_for_addr(v3d_disk_cache_init);
assert(note && build_id_length(note) == 20);
@@ -69,9 +62,9 @@ void v3d_disk_cache_init(struct v3d_screen *screen)
char timestamp[41];
_mesa_sha1_format(timestamp, id_sha1);
screen->disk_cache = disk_cache_create(renderer, timestamp, v3d_mesa_debug);
free(renderer);
screen->disk_cache =
disk_cache_create(v3d_screen_get_name((struct pipe_screen *) screen),
timestamp, v3d_mesa_debug);
}
static void

View File

@@ -47,7 +47,7 @@
#include "compiler/v3d_compiler.h"
#include "drm-uapi/drm_fourcc.h"
static const char *
const char *
v3d_screen_get_name(struct pipe_screen *pscreen)
{
struct v3d_screen *screen = v3d_screen(pscreen);

View File

@@ -104,6 +104,8 @@ struct pipe_screen *v3d_screen_create(int fd,
const struct pipe_screen_config *config,
struct renderonly *ro);
const char *v3d_screen_get_name(struct pipe_screen *pscreen);
void
v3d_fence_screen_init(struct v3d_screen *screen);