Commit fc1b0a02 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau: pass nvif_client to nouveau_gem_new() instead of drm_device

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent bab7cc18
...@@ -321,7 +321,7 @@ nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS) ...@@ -321,7 +321,7 @@ nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS)
} }
/* Named memory object area */ /* Named memory object area */
ret = nouveau_gem_new(dev, PAGE_SIZE, 0, NOUVEAU_GEM_DOMAIN_GART, ret = nouveau_gem_new(cli, PAGE_SIZE, 0, NOUVEAU_GEM_DOMAIN_GART,
0, 0, &chan->ntfy); 0, 0, &chan->ntfy);
if (ret == 0) if (ret == 0)
ret = nouveau_bo_pin(chan->ntfy, TTM_PL_FLAG_TT, false); ret = nouveau_bo_pin(chan->ntfy, TTM_PL_FLAG_TT, false);
......
...@@ -1057,6 +1057,7 @@ int ...@@ -1057,6 +1057,7 @@ int
nouveau_display_dumb_create(struct drm_file *file_priv, struct drm_device *dev, nouveau_display_dumb_create(struct drm_file *file_priv, struct drm_device *dev,
struct drm_mode_create_dumb *args) struct drm_mode_create_dumb *args)
{ {
struct nouveau_cli *cli = nouveau_cli(file_priv);
struct nouveau_bo *bo; struct nouveau_bo *bo;
uint32_t domain; uint32_t domain;
int ret; int ret;
...@@ -1071,7 +1072,7 @@ nouveau_display_dumb_create(struct drm_file *file_priv, struct drm_device *dev, ...@@ -1071,7 +1072,7 @@ nouveau_display_dumb_create(struct drm_file *file_priv, struct drm_device *dev,
else else
domain = NOUVEAU_GEM_DOMAIN_GART; domain = NOUVEAU_GEM_DOMAIN_GART;
ret = nouveau_gem_new(dev, args->size, 0, domain, 0, 0, &bo); ret = nouveau_gem_new(cli, args->size, 0, domain, 0, 0, &bo);
if (ret) if (ret)
return ret; return ret;
......
...@@ -341,8 +341,9 @@ nouveau_fbcon_create(struct drm_fb_helper *helper, ...@@ -341,8 +341,9 @@ nouveau_fbcon_create(struct drm_fb_helper *helper,
mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp, mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp,
sizes->surface_depth); sizes->surface_depth);
ret = nouveau_gem_new(dev, mode_cmd.pitches[0] * mode_cmd.height, ret = nouveau_gem_new(&drm->client, mode_cmd.pitches[0] *
0, NOUVEAU_GEM_DOMAIN_VRAM, 0, 0x0000, &nvbo); mode_cmd.height, 0, NOUVEAU_GEM_DOMAIN_VRAM,
0, 0x0000, &nvbo);
if (ret) { if (ret) {
NV_ERROR(drm, "failed to allocate framebuffer\n"); NV_ERROR(drm, "failed to allocate framebuffer\n");
goto out; goto out;
......
...@@ -175,11 +175,11 @@ nouveau_gem_object_close(struct drm_gem_object *gem, struct drm_file *file_priv) ...@@ -175,11 +175,11 @@ nouveau_gem_object_close(struct drm_gem_object *gem, struct drm_file *file_priv)
} }
int int
nouveau_gem_new(struct drm_device *dev, int size, int align, uint32_t domain, nouveau_gem_new(struct nouveau_cli *cli, int size, int align, uint32_t domain,
uint32_t tile_mode, uint32_t tile_flags, uint32_t tile_mode, uint32_t tile_flags,
struct nouveau_bo **pnvbo) struct nouveau_bo **pnvbo)
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(cli->dev);
struct nouveau_bo *nvbo; struct nouveau_bo *nvbo;
u32 flags = 0; u32 flags = 0;
int ret; int ret;
...@@ -194,7 +194,7 @@ nouveau_gem_new(struct drm_device *dev, int size, int align, uint32_t domain, ...@@ -194,7 +194,7 @@ nouveau_gem_new(struct drm_device *dev, int size, int align, uint32_t domain,
if (domain & NOUVEAU_GEM_DOMAIN_COHERENT) if (domain & NOUVEAU_GEM_DOMAIN_COHERENT)
flags |= TTM_PL_FLAG_UNCACHED; flags |= TTM_PL_FLAG_UNCACHED;
ret = nouveau_bo_new(&drm->client, size, align, flags, tile_mode, ret = nouveau_bo_new(cli, size, align, flags, tile_mode,
tile_flags, NULL, NULL, pnvbo); tile_flags, NULL, NULL, pnvbo);
if (ret) if (ret)
return ret; return ret;
...@@ -211,7 +211,7 @@ nouveau_gem_new(struct drm_device *dev, int size, int align, uint32_t domain, ...@@ -211,7 +211,7 @@ nouveau_gem_new(struct drm_device *dev, int size, int align, uint32_t domain,
/* Initialize the embedded gem-object. We return a single gem-reference /* Initialize the embedded gem-object. We return a single gem-reference
* to the caller, instead of a normal nouveau_bo ttm reference. */ * to the caller, instead of a normal nouveau_bo ttm reference. */
ret = drm_gem_object_init(dev, &nvbo->gem, nvbo->bo.mem.size); ret = drm_gem_object_init(drm->dev, &nvbo->gem, nvbo->bo.mem.size);
if (ret) { if (ret) {
nouveau_bo_ref(NULL, pnvbo); nouveau_bo_ref(NULL, pnvbo);
return -ENOMEM; return -ENOMEM;
...@@ -267,7 +267,7 @@ nouveau_gem_ioctl_new(struct drm_device *dev, void *data, ...@@ -267,7 +267,7 @@ nouveau_gem_ioctl_new(struct drm_device *dev, void *data,
return -EINVAL; return -EINVAL;
} }
ret = nouveau_gem_new(dev, req->info.size, req->align, ret = nouveau_gem_new(cli, req->info.size, req->align,
req->info.domain, req->info.tile_mode, req->info.domain, req->info.tile_mode,
req->info.tile_flags, &nvbo); req->info.tile_flags, &nvbo);
if (ret) if (ret)
......
...@@ -16,7 +16,7 @@ nouveau_gem_object(struct drm_gem_object *gem) ...@@ -16,7 +16,7 @@ nouveau_gem_object(struct drm_gem_object *gem)
} }
/* nouveau_gem.c */ /* nouveau_gem.c */
extern int nouveau_gem_new(struct drm_device *, int size, int align, extern int nouveau_gem_new(struct nouveau_cli *, int size, int align,
uint32_t domain, uint32_t tile_mode, uint32_t domain, uint32_t tile_mode,
uint32_t tile_flags, struct nouveau_bo **); uint32_t tile_flags, struct nouveau_bo **);
extern void nouveau_gem_object_del(struct drm_gem_object *); extern void nouveau_gem_object_del(struct drm_gem_object *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment