summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/panfrost')
-rw-r--r--src/gallium/drivers/panfrost/pan_drm.c6
-rw-r--r--src/gallium/drivers/panfrost/pan_screen.c3
-rw-r--r--src/gallium/drivers/panfrost/pan_screen.h3
3 files changed, 10 insertions, 2 deletions
diff --git a/src/gallium/drivers/panfrost/pan_drm.c b/src/gallium/drivers/panfrost/pan_drm.c
index 8ae541ae11b..6d1e0c08d33 100644
--- a/src/gallium/drivers/panfrost/pan_drm.c
+++ b/src/gallium/drivers/panfrost/pan_drm.c
@@ -93,7 +93,11 @@ panfrost_drm_create_bo(struct panfrost_screen *screen, size_t size,
unsigned translated_flags = 0;
- /* TODO: translate flags to kernel flags, if the kernel supports */
+ if (screen->kernel_version->version_major > 1 ||
+ screen->kernel_version->version_minor >= 1) {
+ if (!(flags & PAN_ALLOCATE_EXECUTE))
+ translated_flags |= PANFROST_BO_NOEXEC;
+ }
struct drm_panfrost_create_bo create_bo = {
.size = size,
diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c
index b2fac88e956..5f527d0d3b3 100644
--- a/src/gallium/drivers/panfrost/pan_screen.c
+++ b/src/gallium/drivers/panfrost/pan_screen.c
@@ -37,7 +37,6 @@
#include "pipe/p_defines.h"
#include "pipe/p_screen.h"
#include "draw/draw_context.h"
-#include <xf86drm.h>
#include <fcntl.h>
@@ -537,6 +536,7 @@ panfrost_destroy_screen(struct pipe_screen *pscreen)
{
struct panfrost_screen *screen = pan_screen(pscreen);
panfrost_bo_cache_evict_all(screen);
+ drmFreeVersion(screen->kernel_version);
ralloc_free(screen);
}
@@ -617,6 +617,7 @@ panfrost_create_screen(int fd, struct renderonly *ro)
screen->gpu_id = panfrost_drm_query_gpu_version(screen);
screen->require_sfbd = screen->gpu_id < 0x0750; /* T760 is the first to support MFBD */
+ screen->kernel_version = drmGetVersion(fd);
/* Check if we're loading against a supported GPU model. */
diff --git a/src/gallium/drivers/panfrost/pan_screen.h b/src/gallium/drivers/panfrost/pan_screen.h
index 22cd7dcc9fe..35fb8de2628 100644
--- a/src/gallium/drivers/panfrost/pan_screen.h
+++ b/src/gallium/drivers/panfrost/pan_screen.h
@@ -29,6 +29,7 @@
#ifndef PAN_SCREEN_H
#define PAN_SCREEN_H
+#include <xf86drm.h>
#include "pipe/p_screen.h"
#include "pipe/p_defines.h"
#include "renderonly/renderonly.h"
@@ -99,6 +100,8 @@ struct panfrost_screen {
unsigned gpu_id;
bool require_sfbd;
+ drmVersionPtr kernel_version;
+
struct renderonly *ro;
/* Transient memory management is based on borrowing fixed-size slabs