All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/nouveau: fix TTM_PL_TT memtype on pre-nv50
@ 2014-02-16  4:27 Ilia Mirkin
       [not found] ` <1392524821-10358-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
  2014-02-16 10:43 ` Maarten Lankhorst
  0 siblings, 2 replies; 3+ messages in thread
From: Ilia Mirkin @ 2014-02-16  4:27 UTC (permalink / raw)
  To: Ben Skeggs, nouveau, dri-devel; +Cc: Maarten Lankhorst, Ronald

Commit a55409066 ("drm/nv50-: map TTM_PL_SYSTEM through a BAR for CPU
access") made it possible to work with tiled memory. However
mem->mm_node is not a nouveau_mem for AGP-using pre-NV50 cards, but a
drm_mm_node, as created by the ttm_bo_manager_func. As such, extend the
untiled check to explicitly include all pre-nv50 cards.

Reported-by: Ronald <ronald645@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74613
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
---

Hmmm... this seems like a really fragile semantic, I wonder if more
mem->mm_node usages have to be audited. But this one's quick and easy. I'd
rather see something a little more solid around dealing with these
differences, but not sure how without reading all the ttm gunk. Perhaps just
make sure it's always a nouveau_mem by wrapping the ttm_bo_manager logic?

 drivers/gpu/drm/nouveau/nouveau_bo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index 488686d..4aed171 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -1249,7 +1249,7 @@ nouveau_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem)
 			mem->bus.is_iomem = !dev->agp->cant_use_aperture;
 		}
 #endif
-		if (!node->memtype)
+		if (nv_device(drm->device)->card_type < NV_50 || !node->memtype)
 			/* untiled */
 			break;
 		/* fallthrough, tiled memory */
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/nouveau: fix TTM_PL_TT memtype on pre-nv50
       [not found] ` <1392524821-10358-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
@ 2014-02-16  9:29   ` Ronald
  0 siblings, 0 replies; 3+ messages in thread
From: Ronald @ 2014-02-16  9:29 UTC (permalink / raw)
  To: Ilia Mirkin
  Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Maarten Lankhorst,
	Ben Skeggs, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

2014-02-16 5:27 GMT+01:00 Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>:
> Commit a55409066 ("drm/nv50-: map TTM_PL_SYSTEM through a BAR for CPU
> access") made it possible to work with tiled memory. However
> mem->mm_node is not a nouveau_mem for AGP-using pre-NV50 cards, but a
> drm_mm_node, as created by the ttm_bo_manager_func. As such, extend the
> untiled check to explicitly include all pre-nv50 cards.
>
> Reported-by: Ronald <ronald645-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74613
> Signed-off-by: Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
> ---

Tested-by: Ronald Uitermark <ronald645-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

> Hmmm... this seems like a really fragile semantic, I wonder if more
> mem->mm_node usages have to be audited. But this one's quick and easy. I'd
> rather see something a little more solid around dealing with these
> differences, but not sure how without reading all the ttm gunk. Perhaps just
> make sure it's always a nouveau_mem by wrapping the ttm_bo_manager logic?
>
>  drivers/gpu/drm/nouveau/nouveau_bo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
> index 488686d..4aed171 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_bo.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
> @@ -1249,7 +1249,7 @@ nouveau_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem)
>                         mem->bus.is_iomem = !dev->agp->cant_use_aperture;
>                 }
>  #endif
> -               if (!node->memtype)
> +               if (nv_device(drm->device)->card_type < NV_50 || !node->memtype)
>                         /* untiled */
>                         break;
>                 /* fallthrough, tiled memory */
> --
> 1.8.3.2
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/nouveau: fix TTM_PL_TT memtype on pre-nv50
  2014-02-16  4:27 [PATCH] drm/nouveau: fix TTM_PL_TT memtype on pre-nv50 Ilia Mirkin
       [not found] ` <1392524821-10358-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
@ 2014-02-16 10:43 ` Maarten Lankhorst
  1 sibling, 0 replies; 3+ messages in thread
From: Maarten Lankhorst @ 2014-02-16 10:43 UTC (permalink / raw)
  To: Ilia Mirkin, Ben Skeggs, nouveau, dri-devel; +Cc: Maarten Lankhorst, Ronald

op 16-02-14 05:27, Ilia Mirkin schreef:
> Commit a55409066 ("drm/nv50-: map TTM_PL_SYSTEM through a BAR for CPU
> access") made it possible to work with tiled memory. However
> mem->mm_node is not a nouveau_mem for AGP-using pre-NV50 cards, but a
> drm_mm_node, as created by the ttm_bo_manager_func. As such, extend the
> untiled check to explicitly include all pre-nv50 cards.
>
> Reported-by: Ronald <ronald645@gmail.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74613
> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
> ---
>
> Hmmm... this seems like a really fragile semantic, I wonder if more
> mem->mm_node usages have to be audited. But this one's quick and easy. I'd
> rather see something a little more solid around dealing with these
> differences, but not sure how without reading all the ttm gunk. Perhaps just
> make sure it's always a nouveau_mem by wrapping the ttm_bo_manager logic?
>
>   drivers/gpu/drm/nouveau/nouveau_bo.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
> index 488686d..4aed171 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_bo.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
> @@ -1249,7 +1249,7 @@ nouveau_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem)
>   			mem->bus.is_iomem = !dev->agp->cant_use_aperture;
>   		}
>   #endif
> -		if (!node->memtype)
> +		if (nv_device(drm->device)->card_type < NV_50 || !node->memtype)
>   			/* untiled */
>   			break;
>   		/* fallthrough, tiled memory */
Acked-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-16 10:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-16  4:27 [PATCH] drm/nouveau: fix TTM_PL_TT memtype on pre-nv50 Ilia Mirkin
     [not found] ` <1392524821-10358-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
2014-02-16  9:29   ` Ronald
2014-02-16 10:43 ` Maarten Lankhorst

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.