aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2010-07-03 12:36:39 -0400
committerBen Skeggs <bskeggs@redhat.com>2010-07-12 20:13:23 -0400
commit6e86e0419471d11ed3d4d46039ee90e8cb85806c (patch)
tree176b7ffdef1bd434bb4d9223f33d0f9de8b33ebc /drivers/gpu/drm
parent2ed06b7d974a750ccb90ff88f5b7a870b89db966 (diff)
drm/nouveau: Fix a couple of sparse warnings.
Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_acpi.c2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_connector.c7
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drv.c1
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_fbcon.c2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_gem.c2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_mem.c2
-rw-r--r--drivers/gpu/drm/nouveau/nv04_fifo.c11
-rw-r--r--drivers/gpu/drm/nouveau/nv04_graph.c2
-rw-r--r--drivers/gpu/drm/nouveau/nv50_graph.c10
9 files changed, 20 insertions, 19 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c
index d4bcca8a5133..381d3851f5c3 100644
--- a/drivers/gpu/drm/nouveau/nouveau_acpi.c
+++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c
@@ -42,7 +42,7 @@ static const char nouveau_dsm_muid[] = {
42 0xB3, 0x4D, 0x7E, 0x5F, 0xEA, 0x12, 0x9F, 0xD4, 42 0xB3, 0x4D, 0x7E, 0x5F, 0xEA, 0x12, 0x9F, 0xD4,
43}; 43};
44 44
45static int nouveau_dsm(acpi_handle handle, int func, int arg, int *result) 45static int nouveau_dsm(acpi_handle handle, int func, int arg, uint32_t *result)
46{ 46{
47 struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL }; 47 struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
48 struct acpi_object_list input; 48 struct acpi_object_list input;
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
index c2524ca099da..464b3dca94a4 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -585,7 +585,6 @@ nouveau_connector_get_modes(struct drm_connector *connector)
585 struct drm_nouveau_private *dev_priv = dev->dev_private; 585 struct drm_nouveau_private *dev_priv = dev->dev_private;
586 struct nouveau_connector *nv_connector = nouveau_connector(connector); 586 struct nouveau_connector *nv_connector = nouveau_connector(connector);
587 struct nouveau_encoder *nv_encoder = nv_connector->detected_encoder; 587 struct nouveau_encoder *nv_encoder = nv_connector->detected_encoder;
588 struct drm_display_mode mode;
589 int ret = 0; 588 int ret = 0;
590 589
591 /* destroy the native mode, the attached monitor could have changed. 590 /* destroy the native mode, the attached monitor could have changed.
@@ -600,9 +599,9 @@ nouveau_connector_get_modes(struct drm_connector *connector)
600 else 599 else
601 if (nv_encoder->dcb->type == OUTPUT_LVDS && 600 if (nv_encoder->dcb->type == OUTPUT_LVDS &&
602 (nv_encoder->dcb->lvdsconf.use_straps_for_mode || 601 (nv_encoder->dcb->lvdsconf.use_straps_for_mode ||
603 dev_priv->vbios.fp_no_ddc) && 602 dev_priv->vbios.fp_no_ddc) && nouveau_bios_fp_mode(dev, NULL)) {
604 nouveau_bios_fp_mode(dev, &mode)) { 603 nv_connector->native_mode = drm_mode_create(dev);
605 nv_connector->native_mode = drm_mode_duplicate(dev, &mode); 604 nouveau_bios_fp_mode(dev, nv_connector->native_mode);
606 } 605 }
607 606
608 /* Find the native mode if this is a digital panel, if we didn't 607 /* Find the native mode if this is a digital panel, if we didn't
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.c b/drivers/gpu/drm/nouveau/nouveau_drv.c
index 6edfc23e6285..2171dc82c3de 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.c
@@ -317,7 +317,6 @@ nouveau_pci_resume(struct pci_dev *pdev)
317 317
318 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 318 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
319 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); 319 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
320 int ret;
321 320
322 ret = nouveau_bo_pin(nv_crtc->cursor.nvbo, TTM_PL_FLAG_VRAM); 321 ret = nouveau_bo_pin(nv_crtc->cursor.nvbo, TTM_PL_FLAG_VRAM);
323 if (!ret) 322 if (!ret)
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
index c9a4a0d2a115..728f5550e68b 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
@@ -333,7 +333,7 @@ nouveau_fbcon_output_poll_changed(struct drm_device *dev)
333 drm_fb_helper_hotplug_event(&dev_priv->nfbdev->helper); 333 drm_fb_helper_hotplug_event(&dev_priv->nfbdev->helper);
334} 334}
335 335
336int 336static int
337nouveau_fbcon_destroy(struct drm_device *dev, struct nouveau_fbdev *nfbdev) 337nouveau_fbcon_destroy(struct drm_device *dev, struct nouveau_fbdev *nfbdev)
338{ 338{
339 struct nouveau_framebuffer *nouveau_fb = &nfbdev->nouveau_fb; 339 struct nouveau_framebuffer *nouveau_fb = &nfbdev->nouveau_fb;
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
index 69c76cf93407..791531bdb2c4 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
@@ -577,7 +577,7 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data,
577 struct drm_nouveau_gem_pushbuf_bo *bo; 577 struct drm_nouveau_gem_pushbuf_bo *bo;
578 struct nouveau_channel *chan; 578 struct nouveau_channel *chan;
579 struct validate_op op; 579 struct validate_op op;
580 struct nouveau_fence *fence = 0; 580 struct nouveau_fence *fence = NULL;
581 int i, j, ret = 0, do_reloc = 0; 581 int i, j, ret = 0, do_reloc = 0;
582 582
583 NOUVEAU_CHECK_INITIALISED_WITH_RETURN; 583 NOUVEAU_CHECK_INITIALISED_WITH_RETURN;
diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c
index 2853ba0137af..4b42bf218f61 100644
--- a/drivers/gpu/drm/nouveau/nouveau_mem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_mem.c
@@ -371,7 +371,7 @@ nouveau_mem_detect(struct drm_device *dev)
371 } else { 371 } else {
372 dev_priv->vram_size = nv_rd32(dev, NV04_FIFO_DATA); 372 dev_priv->vram_size = nv_rd32(dev, NV04_FIFO_DATA);
373 dev_priv->vram_size |= (dev_priv->vram_size & 0xff) << 32; 373 dev_priv->vram_size |= (dev_priv->vram_size & 0xff) << 32;
374 dev_priv->vram_size &= 0xffffffff00; 374 dev_priv->vram_size &= 0xffffffff00ll;
375 if (dev_priv->chipset == 0xaa || dev_priv->chipset == 0xac) { 375 if (dev_priv->chipset == 0xaa || dev_priv->chipset == 0xac) {
376 dev_priv->vram_sys_base = nv_rd32(dev, 0x100e10); 376 dev_priv->vram_sys_base = nv_rd32(dev, 0x100e10);
377 dev_priv->vram_sys_base <<= 12; 377 dev_priv->vram_sys_base <<= 12;
diff --git a/drivers/gpu/drm/nouveau/nv04_fifo.c b/drivers/gpu/drm/nouveau/nv04_fifo.c
index 66fe55983b6e..611c83e6d9f4 100644
--- a/drivers/gpu/drm/nouveau/nv04_fifo.c
+++ b/drivers/gpu/drm/nouveau/nv04_fifo.c
@@ -112,6 +112,12 @@ nv04_fifo_channel_id(struct drm_device *dev)
112 NV03_PFIFO_CACHE1_PUSH1_CHID_MASK; 112 NV03_PFIFO_CACHE1_PUSH1_CHID_MASK;
113} 113}
114 114
115#ifdef __BIG_ENDIAN
116#define DMA_FETCH_ENDIANNESS NV_PFIFO_CACHE1_BIG_ENDIAN
117#else
118#define DMA_FETCH_ENDIANNESS 0
119#endif
120
115int 121int
116nv04_fifo_create_context(struct nouveau_channel *chan) 122nv04_fifo_create_context(struct nouveau_channel *chan)
117{ 123{
@@ -138,10 +144,7 @@ nv04_fifo_create_context(struct nouveau_channel *chan)
138 RAMFC_WR(DMA_FETCH, (NV_PFIFO_CACHE1_DMA_FETCH_TRIG_128_BYTES | 144 RAMFC_WR(DMA_FETCH, (NV_PFIFO_CACHE1_DMA_FETCH_TRIG_128_BYTES |
139 NV_PFIFO_CACHE1_DMA_FETCH_SIZE_128_BYTES | 145 NV_PFIFO_CACHE1_DMA_FETCH_SIZE_128_BYTES |
140 NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS_8 | 146 NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS_8 |
141#ifdef __BIG_ENDIAN 147 DMA_FETCH_ENDIANNESS));
142 NV_PFIFO_CACHE1_BIG_ENDIAN |
143#endif
144 0));
145 dev_priv->engine.instmem.finish_access(dev); 148 dev_priv->engine.instmem.finish_access(dev);
146 149
147 /* enable the fifo dma operation */ 150 /* enable the fifo dma operation */
diff --git a/drivers/gpu/drm/nouveau/nv04_graph.c b/drivers/gpu/drm/nouveau/nv04_graph.c
index 618355e9cdd5..dd09679d31dc 100644
--- a/drivers/gpu/drm/nouveau/nv04_graph.c
+++ b/drivers/gpu/drm/nouveau/nv04_graph.c
@@ -342,7 +342,7 @@ static uint32_t nv04_graph_ctx_regs[] = {
342}; 342};
343 343
344struct graph_state { 344struct graph_state {
345 int nv04[ARRAY_SIZE(nv04_graph_ctx_regs)]; 345 uint32_t nv04[ARRAY_SIZE(nv04_graph_ctx_regs)];
346}; 346};
347 347
348struct nouveau_channel * 348struct nouveau_channel *
diff --git a/drivers/gpu/drm/nouveau/nv50_graph.c b/drivers/gpu/drm/nouveau/nv50_graph.c
index b203d06f601f..b04e7c8449a5 100644
--- a/drivers/gpu/drm/nouveau/nv50_graph.c
+++ b/drivers/gpu/drm/nouveau/nv50_graph.c
@@ -212,7 +212,7 @@ nv50_graph_create_context(struct nouveau_channel *chan)
212 struct drm_device *dev = chan->dev; 212 struct drm_device *dev = chan->dev;
213 struct drm_nouveau_private *dev_priv = dev->dev_private; 213 struct drm_nouveau_private *dev_priv = dev->dev_private;
214 struct nouveau_gpuobj *ramin = chan->ramin->gpuobj; 214 struct nouveau_gpuobj *ramin = chan->ramin->gpuobj;
215 struct nouveau_gpuobj *ctx; 215 struct nouveau_gpuobj *obj;
216 struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph; 216 struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph;
217 int hdr, ret; 217 int hdr, ret;
218 218
@@ -223,7 +223,7 @@ nv50_graph_create_context(struct nouveau_channel *chan)
223 NVOBJ_FLAG_ZERO_FREE, &chan->ramin_grctx); 223 NVOBJ_FLAG_ZERO_FREE, &chan->ramin_grctx);
224 if (ret) 224 if (ret)
225 return ret; 225 return ret;
226 ctx = chan->ramin_grctx->gpuobj; 226 obj = chan->ramin_grctx->gpuobj;
227 227
228 hdr = IS_G80 ? 0x200 : 0x20; 228 hdr = IS_G80 ? 0x200 : 0x20;
229 dev_priv->engine.instmem.prepare_access(dev, true); 229 dev_priv->engine.instmem.prepare_access(dev, true);
@@ -241,12 +241,12 @@ nv50_graph_create_context(struct nouveau_channel *chan)
241 struct nouveau_grctx ctx = {}; 241 struct nouveau_grctx ctx = {};
242 ctx.dev = chan->dev; 242 ctx.dev = chan->dev;
243 ctx.mode = NOUVEAU_GRCTX_VALS; 243 ctx.mode = NOUVEAU_GRCTX_VALS;
244 ctx.data = chan->ramin_grctx->gpuobj; 244 ctx.data = obj;
245 nv50_grctx_init(&ctx); 245 nv50_grctx_init(&ctx);
246 } else { 246 } else {
247 nouveau_grctx_vals_load(dev, ctx); 247 nouveau_grctx_vals_load(dev, obj);
248 } 248 }
249 nv_wo32(dev, ctx, 0x00000/4, chan->ramin->instance >> 12); 249 nv_wo32(dev, obj, 0x00000/4, chan->ramin->instance >> 12);
250 dev_priv->engine.instmem.finish_access(dev); 250 dev_priv->engine.instmem.finish_access(dev);
251 251
252 return 0; 252 return 0;