Skip to content

Commit

Permalink
panfrost patches
Browse files Browse the repository at this point in the history
  • Loading branch information
SolDev69 committed Dec 21, 2023
1 parent d698a30 commit 9a7a6ba
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/gallium/drivers/panfrost/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ compile_args_panfrost = [
'-Wno-pointer-arith'
]

panfrost_versions = ['4', '5', '6', '7', '9']
panfrost_versions = ['4', '5', '6', '7', '9', '10']
libpanfrost_versions = []

foreach ver : panfrost_versions
Expand Down
22 changes: 22 additions & 0 deletions src/gallium/drivers/panfrost/pan_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,28 @@ panfrost_fence_server_sync(struct pipe_context *pctx,
close(fd);
}

static struct panfrost_cs
panfrost_cs_create(struct panfrost_context *ctx, unsigned size, unsigned mask)
{
struct panfrost_screen *screen = pan_screen(ctx->base.screen);
struct panfrost_device *dev = pan_device(ctx->base.screen);
struct kbase_context *kctx = ctx->kbase_ctx;

struct panfrost_cs c = {0};

c.bo = panfrost_bo_create(dev, size, 0, "Command stream");

c.base = dev->mali.cs_bind(&dev->mali, kctx, c.bo->ptr.gpu, size);

c.event_ptr = dev->mali.event_mem.gpu + c.base.event_mem_offset * PAN_EVENT_SIZE;
c.kcpu_event_ptr = dev->mali.kcpu_event_mem.gpu + c.base.event_mem_offset * PAN_EVENT_SIZE;

c.hw_resources = mask;
screen->vtbl.init_cs(ctx, &c);

return c;
}

struct pipe_context *
panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags)
{
Expand Down
12 changes: 12 additions & 0 deletions src/gallium/drivers/panfrost/pan_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@
#include "compiler/shader_enums.h"
#include "midgard/midgard_compile.h"

struct panfrost_cs {
struct kbase_cs base;
struct panfrost_bo *bo;
pan_command_stream cs;
mali_ptr event_ptr;
uint64_t seqnum;
mali_ptr kcpu_event_ptr;
uint64_t kcpu_seqnum;
uint64_t offset;
unsigned hw_resources;
};

#define SET_BIT(lval, bit, cond) \
if (cond) \
lval |= (bit); \
Expand Down

0 comments on commit 9a7a6ba

Please sign in to comment.