diff options
author | Rob Clark <[email protected]> | 2018-11-11 10:16:30 -0500 |
---|---|---|
committer | Rob Clark <[email protected]> | 2018-11-27 15:44:02 -0500 |
commit | 6cb74eb4f1499d6e319a1c96d16174038e22540d (patch) | |
tree | 5b5091111eeafe06148e3437a5acddfb98930e91 /src/gallium | |
parent | 88c4680b5a50ea8840c38aa0a80acde63ef1677b (diff) |
freedreno/drm: remove dependency on gallium driver
Prep work to move drm to a common location.
Slightly hacky, but the softpin debug flag is only temporary.
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/freedreno/drm/msm_pipe.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/drm/msm_pipe.c b/src/gallium/drivers/freedreno/drm/msm_pipe.c index b7996e5528a..13defc6d917 100644 --- a/src/gallium/drivers/freedreno/drm/msm_pipe.c +++ b/src/gallium/drivers/freedreno/drm/msm_pipe.c @@ -26,7 +26,6 @@ #include "util/slab.h" -#include "freedreno_util.h" #include "msm_priv.h" static int query_param(struct fd_pipe *pipe, uint32_t param, @@ -169,6 +168,16 @@ static uint64_t get_param(struct fd_pipe *pipe, uint32_t param) return value; } +static bool use_softpin(void) +{ + static int sp = -1; + if (sp < 0) { + const char *str = getenv("FD_MESA_DEBUG"); + sp = str && strstr(str, "softpin"); + } + return sp; +} + struct fd_pipe * msm_pipe_new(struct fd_device *dev, enum fd_pipe_id id, uint32_t prio) { @@ -189,7 +198,7 @@ struct fd_pipe * msm_pipe_new(struct fd_device *dev, // TODO once kernel changes are in place, this switch will be // based on kernel version: - if (fd_mesa_debug & FD_DBG_SOFTPIN) { + if (use_softpin()) { pipe->funcs = &sp_funcs; } else { pipe->funcs = &legacy_funcs; |