diff options
author | Rob Clark <robdclark@chromium.org> | 2022-06-13 12:46:23 -0700 |
---|---|---|
committer | Rob Clark <robdclark@chromium.org> | 2022-07-06 18:54:42 -0700 |
commit | 8b5de73595899858b377b41805f1d00ecbe18fcd (patch) | |
tree | 8665436c4e258bb58833ce274bfcff39f5d9deff /drivers/gpu/drm/msm/msm_drv.c | |
parent | 4b18299b33655fa9672b774b6df774dc03d6aee8 (diff) | |
download | lwn-8b5de73595899858b377b41805f1d00ecbe18fcd.tar.gz lwn-8b5de73595899858b377b41805f1d00ecbe18fcd.zip |
drm/msm: Deprecate MSM_BO_UNCACHED harder
Handle the demotion to MSM_BO_WC at the userspace ABI level, and fix
the remaining internal MSM_BO_UNCACHED user.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Patchwork: https://patchwork.freedesktop.org/patch/489339/
Link: https://lore.kernel.org/r/20220613194623.2588353-1-robdclark@gmail.com
Diffstat (limited to 'drivers/gpu/drm/msm/msm_drv.c')
-rw-r--r-- | drivers/gpu/drm/msm/msm_drv.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 984b93773554..1ed4cd09dbf8 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -678,12 +678,25 @@ static int msm_ioctl_gem_new(struct drm_device *dev, void *data, struct drm_file *file) { struct drm_msm_gem_new *args = data; + uint32_t flags = args->flags; if (args->flags & ~MSM_BO_FLAGS) { DRM_ERROR("invalid flags: %08x\n", args->flags); return -EINVAL; } + /* + * Uncached CPU mappings are deprecated, as of: + * + * 9ef364432db4 ("drm/msm: deprecate MSM_BO_UNCACHED (map as writecombine instead)") + * + * So promote them to WC. + */ + if (flags & MSM_BO_UNCACHED) { + flags &= ~MSM_BO_CACHED; + flags |= MSM_BO_WC; + } + return msm_gem_new_handle(dev, file, args->size, args->flags, &args->handle, NULL); } |