Commit 6e86e041 authored by Francisco Jerez's avatar Francisco Jerez Committed by Ben Skeggs

drm/nouveau: Fix a couple of sparse warnings.

Signed-off-by: default avatarFrancisco Jerez <currojerez@riseup.net>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 2ed06b7d
...@@ -42,7 +42,7 @@ static const char nouveau_dsm_muid[] = { ...@@ -42,7 +42,7 @@ static const char nouveau_dsm_muid[] = {
0xB3, 0x4D, 0x7E, 0x5F, 0xEA, 0x12, 0x9F, 0xD4, 0xB3, 0x4D, 0x7E, 0x5F, 0xEA, 0x12, 0x9F, 0xD4,
}; };
static int nouveau_dsm(acpi_handle handle, int func, int arg, int *result) static int nouveau_dsm(acpi_handle handle, int func, int arg, uint32_t *result)
{ {
struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL }; struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
struct acpi_object_list input; struct acpi_object_list input;
......
...@@ -585,7 +585,6 @@ nouveau_connector_get_modes(struct drm_connector *connector) ...@@ -585,7 +585,6 @@ nouveau_connector_get_modes(struct drm_connector *connector)
struct drm_nouveau_private *dev_priv = dev->dev_private; struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nouveau_connector *nv_connector = nouveau_connector(connector); struct nouveau_connector *nv_connector = nouveau_connector(connector);
struct nouveau_encoder *nv_encoder = nv_connector->detected_encoder; struct nouveau_encoder *nv_encoder = nv_connector->detected_encoder;
struct drm_display_mode mode;
int ret = 0; int ret = 0;
/* destroy the native mode, the attached monitor could have changed. /* destroy the native mode, the attached monitor could have changed.
...@@ -600,9 +599,9 @@ nouveau_connector_get_modes(struct drm_connector *connector) ...@@ -600,9 +599,9 @@ nouveau_connector_get_modes(struct drm_connector *connector)
else else
if (nv_encoder->dcb->type == OUTPUT_LVDS && if (nv_encoder->dcb->type == OUTPUT_LVDS &&
(nv_encoder->dcb->lvdsconf.use_straps_for_mode || (nv_encoder->dcb->lvdsconf.use_straps_for_mode ||
dev_priv->vbios.fp_no_ddc) && dev_priv->vbios.fp_no_ddc) && nouveau_bios_fp_mode(dev, NULL)) {
nouveau_bios_fp_mode(dev, &mode)) { nv_connector->native_mode = drm_mode_create(dev);
nv_connector->native_mode = drm_mode_duplicate(dev, &mode); nouveau_bios_fp_mode(dev, nv_connector->native_mode);
} }
/* Find the native mode if this is a digital panel, if we didn't /* Find the native mode if this is a digital panel, if we didn't
......
...@@ -317,7 +317,6 @@ nouveau_pci_resume(struct pci_dev *pdev) ...@@ -317,7 +317,6 @@ nouveau_pci_resume(struct pci_dev *pdev)
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
int ret;
ret = nouveau_bo_pin(nv_crtc->cursor.nvbo, TTM_PL_FLAG_VRAM); ret = nouveau_bo_pin(nv_crtc->cursor.nvbo, TTM_PL_FLAG_VRAM);
if (!ret) if (!ret)
......
...@@ -333,7 +333,7 @@ nouveau_fbcon_output_poll_changed(struct drm_device *dev) ...@@ -333,7 +333,7 @@ nouveau_fbcon_output_poll_changed(struct drm_device *dev)
drm_fb_helper_hotplug_event(&dev_priv->nfbdev->helper); drm_fb_helper_hotplug_event(&dev_priv->nfbdev->helper);
} }
int static int
nouveau_fbcon_destroy(struct drm_device *dev, struct nouveau_fbdev *nfbdev) nouveau_fbcon_destroy(struct drm_device *dev, struct nouveau_fbdev *nfbdev)
{ {
struct nouveau_framebuffer *nouveau_fb = &nfbdev->nouveau_fb; struct nouveau_framebuffer *nouveau_fb = &nfbdev->nouveau_fb;
......
...@@ -577,7 +577,7 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data, ...@@ -577,7 +577,7 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data,
struct drm_nouveau_gem_pushbuf_bo *bo; struct drm_nouveau_gem_pushbuf_bo *bo;
struct nouveau_channel *chan; struct nouveau_channel *chan;
struct validate_op op; struct validate_op op;
struct nouveau_fence *fence = 0; struct nouveau_fence *fence = NULL;
int i, j, ret = 0, do_reloc = 0; int i, j, ret = 0, do_reloc = 0;
NOUVEAU_CHECK_INITIALISED_WITH_RETURN; NOUVEAU_CHECK_INITIALISED_WITH_RETURN;
......
...@@ -371,7 +371,7 @@ nouveau_mem_detect(struct drm_device *dev) ...@@ -371,7 +371,7 @@ nouveau_mem_detect(struct drm_device *dev)
} else { } else {
dev_priv->vram_size = nv_rd32(dev, NV04_FIFO_DATA); dev_priv->vram_size = nv_rd32(dev, NV04_FIFO_DATA);
dev_priv->vram_size |= (dev_priv->vram_size & 0xff) << 32; dev_priv->vram_size |= (dev_priv->vram_size & 0xff) << 32;
dev_priv->vram_size &= 0xffffffff00; dev_priv->vram_size &= 0xffffffff00ll;
if (dev_priv->chipset == 0xaa || dev_priv->chipset == 0xac) { if (dev_priv->chipset == 0xaa || dev_priv->chipset == 0xac) {
dev_priv->vram_sys_base = nv_rd32(dev, 0x100e10); dev_priv->vram_sys_base = nv_rd32(dev, 0x100e10);
dev_priv->vram_sys_base <<= 12; dev_priv->vram_sys_base <<= 12;
......
...@@ -112,6 +112,12 @@ nv04_fifo_channel_id(struct drm_device *dev) ...@@ -112,6 +112,12 @@ nv04_fifo_channel_id(struct drm_device *dev)
NV03_PFIFO_CACHE1_PUSH1_CHID_MASK; NV03_PFIFO_CACHE1_PUSH1_CHID_MASK;
} }
#ifdef __BIG_ENDIAN
#define DMA_FETCH_ENDIANNESS NV_PFIFO_CACHE1_BIG_ENDIAN
#else
#define DMA_FETCH_ENDIANNESS 0
#endif
int int
nv04_fifo_create_context(struct nouveau_channel *chan) nv04_fifo_create_context(struct nouveau_channel *chan)
{ {
...@@ -138,10 +144,7 @@ nv04_fifo_create_context(struct nouveau_channel *chan) ...@@ -138,10 +144,7 @@ nv04_fifo_create_context(struct nouveau_channel *chan)
RAMFC_WR(DMA_FETCH, (NV_PFIFO_CACHE1_DMA_FETCH_TRIG_128_BYTES | RAMFC_WR(DMA_FETCH, (NV_PFIFO_CACHE1_DMA_FETCH_TRIG_128_BYTES |
NV_PFIFO_CACHE1_DMA_FETCH_SIZE_128_BYTES | NV_PFIFO_CACHE1_DMA_FETCH_SIZE_128_BYTES |
NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS_8 | NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS_8 |
#ifdef __BIG_ENDIAN DMA_FETCH_ENDIANNESS));
NV_PFIFO_CACHE1_BIG_ENDIAN |
#endif
0));
dev_priv->engine.instmem.finish_access(dev); dev_priv->engine.instmem.finish_access(dev);
/* enable the fifo dma operation */ /* enable the fifo dma operation */
......
...@@ -342,7 +342,7 @@ static uint32_t nv04_graph_ctx_regs[] = { ...@@ -342,7 +342,7 @@ static uint32_t nv04_graph_ctx_regs[] = {
}; };
struct graph_state { struct graph_state {
int nv04[ARRAY_SIZE(nv04_graph_ctx_regs)]; uint32_t nv04[ARRAY_SIZE(nv04_graph_ctx_regs)];
}; };
struct nouveau_channel * struct nouveau_channel *
......
...@@ -212,7 +212,7 @@ nv50_graph_create_context(struct nouveau_channel *chan) ...@@ -212,7 +212,7 @@ nv50_graph_create_context(struct nouveau_channel *chan)
struct drm_device *dev = chan->dev; struct drm_device *dev = chan->dev;
struct drm_nouveau_private *dev_priv = dev->dev_private; struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nouveau_gpuobj *ramin = chan->ramin->gpuobj; struct nouveau_gpuobj *ramin = chan->ramin->gpuobj;
struct nouveau_gpuobj *ctx; struct nouveau_gpuobj *obj;
struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph; struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph;
int hdr, ret; int hdr, ret;
...@@ -223,7 +223,7 @@ nv50_graph_create_context(struct nouveau_channel *chan) ...@@ -223,7 +223,7 @@ nv50_graph_create_context(struct nouveau_channel *chan)
NVOBJ_FLAG_ZERO_FREE, &chan->ramin_grctx); NVOBJ_FLAG_ZERO_FREE, &chan->ramin_grctx);
if (ret) if (ret)
return ret; return ret;
ctx = chan->ramin_grctx->gpuobj; obj = chan->ramin_grctx->gpuobj;
hdr = IS_G80 ? 0x200 : 0x20; hdr = IS_G80 ? 0x200 : 0x20;
dev_priv->engine.instmem.prepare_access(dev, true); dev_priv->engine.instmem.prepare_access(dev, true);
...@@ -241,12 +241,12 @@ nv50_graph_create_context(struct nouveau_channel *chan) ...@@ -241,12 +241,12 @@ nv50_graph_create_context(struct nouveau_channel *chan)
struct nouveau_grctx ctx = {}; struct nouveau_grctx ctx = {};
ctx.dev = chan->dev; ctx.dev = chan->dev;
ctx.mode = NOUVEAU_GRCTX_VALS; ctx.mode = NOUVEAU_GRCTX_VALS;
ctx.data = chan->ramin_grctx->gpuobj; ctx.data = obj;
nv50_grctx_init(&ctx); nv50_grctx_init(&ctx);
} else { } else {
nouveau_grctx_vals_load(dev, ctx); nouveau_grctx_vals_load(dev, obj);
} }
nv_wo32(dev, ctx, 0x00000/4, chan->ramin->instance >> 12); nv_wo32(dev, obj, 0x00000/4, chan->ramin->instance >> 12);
dev_priv->engine.instmem.finish_access(dev); dev_priv->engine.instmem.finish_access(dev);
return 0; return 0;
......
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