aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/nouveau/Kconfig5
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bo.c2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_fence.c2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_gem.c7
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_mem.c4
-rw-r--r--drivers/gpu/drm/nouveau/nv40_graph.c20
6 files changed, 22 insertions, 18 deletions
diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig
index d823e6319516..b1bc1ea182b8 100644
--- a/drivers/gpu/drm/nouveau/Kconfig
+++ b/drivers/gpu/drm/nouveau/Kconfig
@@ -30,11 +30,12 @@ config DRM_NOUVEAU_DEBUG
30 via debugfs. 30 via debugfs.
31 31
32menu "I2C encoder or helper chips" 32menu "I2C encoder or helper chips"
33 depends on DRM 33 depends on DRM && I2C
34 34
35config DRM_I2C_CH7006 35config DRM_I2C_CH7006
36 tristate "Chrontel ch7006 TV encoder" 36 tristate "Chrontel ch7006 TV encoder"
37 default m if DRM_NOUVEAU 37 depends on DRM_NOUVEAU
38 default m
38 help 39 help
39 Support for Chrontel ch7006 and similar TV encoders, found 40 Support for Chrontel ch7006 and similar TV encoders, found
40 on some nVidia video cards. 41 on some nVidia video cards.
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index 320a14bceb99..aa2dfbc3e351 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -311,8 +311,10 @@ nouveau_bo_create_ttm_backend_entry(struct ttm_bo_device *bdev)
311 struct drm_device *dev = dev_priv->dev; 311 struct drm_device *dev = dev_priv->dev;
312 312
313 switch (dev_priv->gart_info.type) { 313 switch (dev_priv->gart_info.type) {
314#if __OS_HAS_AGP
314 case NOUVEAU_GART_AGP: 315 case NOUVEAU_GART_AGP:
315 return ttm_agp_backend_init(bdev, dev->agp->bridge); 316 return ttm_agp_backend_init(bdev, dev->agp->bridge);
317#endif
316 case NOUVEAU_GART_SGDMA: 318 case NOUVEAU_GART_SGDMA:
317 return nouveau_sgdma_init_ttm(dev); 319 return nouveau_sgdma_init_ttm(dev);
318 default: 320 default:
diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c
index 0cff7eb3690a..dacac9a0842a 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fence.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fence.c
@@ -205,7 +205,7 @@ nouveau_fence_wait(void *sync_obj, void *sync_arg, bool lazy, bool intr)
205 schedule_timeout(1); 205 schedule_timeout(1);
206 206
207 if (intr && signal_pending(current)) { 207 if (intr && signal_pending(current)) {
208 ret = -ERESTART; 208 ret = -ERESTARTSYS;
209 break; 209 break;
210 } 210 }
211 } 211 }
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
index 11f831f0ddc5..18fd8ac9fca7 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
@@ -342,8 +342,6 @@ retry:
342 } 342 }
343 343
344 ret = ttm_bo_wait_cpu(&nvbo->bo, false); 344 ret = ttm_bo_wait_cpu(&nvbo->bo, false);
345 if (ret == -ERESTART)
346 ret = -EAGAIN;
347 if (ret) 345 if (ret)
348 return ret; 346 return ret;
349 goto retry; 347 goto retry;
@@ -915,8 +913,6 @@ nouveau_gem_ioctl_cpu_prep(struct drm_device *dev, void *data,
915 goto out; 913 goto out;
916 914
917 ret = ttm_bo_wait_cpu(&nvbo->bo, no_wait); 915 ret = ttm_bo_wait_cpu(&nvbo->bo, no_wait);
918 if (ret == -ERESTART)
919 ret = -EAGAIN;
920 if (ret) 916 if (ret)
921 goto out; 917 goto out;
922 } 918 }
@@ -925,9 +921,6 @@ nouveau_gem_ioctl_cpu_prep(struct drm_device *dev, void *data,
925 ret = ttm_bo_wait(&nvbo->bo, false, false, no_wait); 921 ret = ttm_bo_wait(&nvbo->bo, false, false, no_wait);
926 } else { 922 } else {
927 ret = ttm_bo_synccpu_write_grab(&nvbo->bo, no_wait); 923 ret = ttm_bo_synccpu_write_grab(&nvbo->bo, no_wait);
928 if (ret == -ERESTART)
929 ret = -EAGAIN;
930 else
931 if (ret == 0) 924 if (ret == 0)
932 nvbo->cpu_filp = file_priv; 925 nvbo->cpu_filp = file_priv;
933 } 926 }
diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c
index 02755712ed3d..5158a12f7844 100644
--- a/drivers/gpu/drm/nouveau/nouveau_mem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_mem.c
@@ -407,6 +407,7 @@ uint64_t nouveau_mem_fb_amount(struct drm_device *dev)
407 return 0; 407 return 0;
408} 408}
409 409
410#if __OS_HAS_AGP
410static void nouveau_mem_reset_agp(struct drm_device *dev) 411static void nouveau_mem_reset_agp(struct drm_device *dev)
411{ 412{
412 uint32_t saved_pci_nv_1, saved_pci_nv_19, pmc_enable; 413 uint32_t saved_pci_nv_1, saved_pci_nv_19, pmc_enable;
@@ -432,10 +433,12 @@ static void nouveau_mem_reset_agp(struct drm_device *dev)
432 nv_wr32(dev, NV04_PBUS_PCI_NV_19, saved_pci_nv_19); 433 nv_wr32(dev, NV04_PBUS_PCI_NV_19, saved_pci_nv_19);
433 nv_wr32(dev, NV04_PBUS_PCI_NV_1, saved_pci_nv_1); 434 nv_wr32(dev, NV04_PBUS_PCI_NV_1, saved_pci_nv_1);
434} 435}
436#endif
435 437
436int 438int
437nouveau_mem_init_agp(struct drm_device *dev) 439nouveau_mem_init_agp(struct drm_device *dev)
438{ 440{
441#if __OS_HAS_AGP
439 struct drm_nouveau_private *dev_priv = dev->dev_private; 442 struct drm_nouveau_private *dev_priv = dev->dev_private;
440 struct drm_agp_info info; 443 struct drm_agp_info info;
441 struct drm_agp_mode mode; 444 struct drm_agp_mode mode;
@@ -471,6 +474,7 @@ nouveau_mem_init_agp(struct drm_device *dev)
471 dev_priv->gart_info.type = NOUVEAU_GART_AGP; 474 dev_priv->gart_info.type = NOUVEAU_GART_AGP;
472 dev_priv->gart_info.aper_base = info.aperture_base; 475 dev_priv->gart_info.aper_base = info.aperture_base;
473 dev_priv->gart_info.aper_size = info.aperture_size; 476 dev_priv->gart_info.aper_size = info.aperture_size;
477#endif
474 return 0; 478 return 0;
475} 479}
476 480
diff --git a/drivers/gpu/drm/nouveau/nv40_graph.c b/drivers/gpu/drm/nouveau/nv40_graph.c
index d3e0a2a6acf8..7e8547cb5833 100644
--- a/drivers/gpu/drm/nouveau/nv40_graph.c
+++ b/drivers/gpu/drm/nouveau/nv40_graph.c
@@ -252,8 +252,9 @@ nv40_grctx_init(struct drm_device *dev)
252 memcpy(pgraph->ctxprog, fw->data, fw->size); 252 memcpy(pgraph->ctxprog, fw->data, fw->size);
253 253
254 cp = pgraph->ctxprog; 254 cp = pgraph->ctxprog;
255 if (cp->signature != 0x5043564e || cp->version != 0 || 255 if (le32_to_cpu(cp->signature) != 0x5043564e ||
256 cp->length != ((fw->size - 7) / 4)) { 256 cp->version != 0 ||
257 le16_to_cpu(cp->length) != ((fw->size - 7) / 4)) {
257 NV_ERROR(dev, "ctxprog invalid\n"); 258 NV_ERROR(dev, "ctxprog invalid\n");
258 release_firmware(fw); 259 release_firmware(fw);
259 nv40_grctx_fini(dev); 260 nv40_grctx_fini(dev);
@@ -281,8 +282,9 @@ nv40_grctx_init(struct drm_device *dev)
281 memcpy(pgraph->ctxvals, fw->data, fw->size); 282 memcpy(pgraph->ctxvals, fw->data, fw->size);
282 283
283 cv = (void *)pgraph->ctxvals; 284 cv = (void *)pgraph->ctxvals;
284 if (cv->signature != 0x5643564e || cv->version != 0 || 285 if (le32_to_cpu(cv->signature) != 0x5643564e ||
285 cv->length != ((fw->size - 9) / 8)) { 286 cv->version != 0 ||
287 le32_to_cpu(cv->length) != ((fw->size - 9) / 8)) {
286 NV_ERROR(dev, "ctxvals invalid\n"); 288 NV_ERROR(dev, "ctxvals invalid\n");
287 release_firmware(fw); 289 release_firmware(fw);
288 nv40_grctx_fini(dev); 290 nv40_grctx_fini(dev);
@@ -294,8 +296,9 @@ nv40_grctx_init(struct drm_device *dev)
294 cp = pgraph->ctxprog; 296 cp = pgraph->ctxprog;
295 297
296 nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_INDEX, 0); 298 nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_INDEX, 0);
297 for (i = 0; i < cp->length; i++) 299 for (i = 0; i < le16_to_cpu(cp->length); i++)
298 nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_DATA, cp->data[i]); 300 nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_DATA,
301 le32_to_cpu(cp->data[i]));
299 302
300 pgraph->accel_blocked = false; 303 pgraph->accel_blocked = false;
301 return 0; 304 return 0;
@@ -329,8 +332,9 @@ nv40_grctx_vals_load(struct drm_device *dev, struct nouveau_gpuobj *ctx)
329 if (!cv) 332 if (!cv)
330 return; 333 return;
331 334
332 for (i = 0; i < cv->length; i++) 335 for (i = 0; i < le32_to_cpu(cv->length); i++)
333 nv_wo32(dev, ctx, cv->data[i].offset, cv->data[i].value); 336 nv_wo32(dev, ctx, le32_to_cpu(cv->data[i].offset),
337 le32_to_cpu(cv->data[i].value));
334} 338}
335 339
336/* 340/*