* [PATCH 1/3] drm/ttm: fix missed conversion of set_pages_array_uc
@ 2018-08-01 5:49 Huang Rui
2018-08-01 5:49 ` [PATCH 2/3] drm/ttm: Add ttm_set_pages_wc and ttm_set_pages_uc helper Huang Rui
[not found] ` <1533102573-15365-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
0 siblings, 2 replies; 4+ messages in thread
From: Huang Rui @ 2018-08-01 5:49 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Huang Rui
This patch fixed the error when do not configure CONFIG_X86, otherwise, below
error will be encountered.
All errors (new ones prefixed by >>):
drivers/gpu/drm/ttm/ttm_page_alloc_dma.c: In function 'ttm_set_pages_caching':
>> drivers/gpu/drm/ttm/ttm_page_alloc_dma.c:272:7: error: implicit declaration of function 'set_pages_array_uc'; did you mean
+'ttm_set_pages_array_uc'? [-Werror=implicit-function-declaration]
r = set_pages_array_uc(pages, cpages);
^~~~~~~~~~~~~~~~~~
ttm_set_pages_array_uc
cc1: some warnings being treated as errors
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
---
drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
index 8304917..507be7a 100644
--- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
@@ -269,7 +269,7 @@ static int ttm_set_pages_caching(struct dma_pool *pool,
int r = 0;
/* Set page caching */
if (pool->type & IS_UC) {
- r = set_pages_array_uc(pages, cpages);
+ r = ttm_set_pages_array_uc(pages, cpages);
if (r)
pr_err("%s: Failed to set %d pages to uc!\n",
pool->dev_name, cpages);
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] drm/ttm: Add ttm_set_pages_wc and ttm_set_pages_uc helper
2018-08-01 5:49 [PATCH 1/3] drm/ttm: fix missed conversion of set_pages_array_uc Huang Rui
@ 2018-08-01 5:49 ` Huang Rui
[not found] ` <1533102573-15365-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
1 sibling, 0 replies; 4+ messages in thread
From: Huang Rui @ 2018-08-01 5:49 UTC (permalink / raw)
To: amd-gfx, dri-devel; +Cc: Huang Rui
These two helpers will be used on set page caching.
Signed-off-by: Huang Rui <ray.huang@amd.com>
---
include/drm/ttm/ttm_set_memory.h | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/include/drm/ttm/ttm_set_memory.h b/include/drm/ttm/ttm_set_memory.h
index a70723c..7c492b4 100644
--- a/include/drm/ttm/ttm_set_memory.h
+++ b/include/drm/ttm/ttm_set_memory.h
@@ -57,6 +57,18 @@ static inline int ttm_set_pages_wb(struct page *page, int numpages)
return set_pages_wb(page, numpages);
}
+static inline int ttm_set_pages_wc(struct page *page, int numpages)
+{
+ unsigned long addr = (unsigned long)page_address(page);
+
+ return set_memory_wc(addr, numpages);
+}
+
+static inline int ttm_set_pages_uc(struct page *page, int numpages)
+{
+ return set_pages_uc(page, numpages);
+}
+
#else /* for CONFIG_X86 */
#if IS_ENABLED(CONFIG_AGP)
@@ -123,6 +135,16 @@ static inline int ttm_set_pages_wb(struct page *page, int numpages)
#endif /* for CONFIG_AGP */
+static inline int ttm_set_pages_wc(struct page *page, int numpages)
+{
+ return 0;
+}
+
+static inline int ttm_set_pages_uc(struct page *page, int numpages)
+{
+ return 0;
+}
+
#endif /* for CONFIG_X86 */
#endif
--
2.7.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] drm/ttm: clean up non-x86 definitions on ttm_tt
[not found] ` <1533102573-15365-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
@ 2018-08-01 5:49 ` Huang Rui
2018-08-01 6:45 ` [PATCH 1/3] drm/ttm: fix missed conversion of set_pages_array_uc Christian König
1 sibling, 0 replies; 4+ messages in thread
From: Huang Rui @ 2018-08-01 5:49 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Huang Rui
All non-x86 definitions are moved to ttm_set_memory header, so remove it from
ttm_tt.c.
Signed-off-by: Huang Rui <ray.huang@amd.com>
---
drivers/gpu/drm/ttm/ttm_tt.c | 25 +++++++------------------
1 file changed, 7 insertions(+), 18 deletions(-)
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index a1e5439..e3a0691 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -38,9 +38,7 @@
#include <drm/drm_cache.h>
#include <drm/ttm/ttm_bo_driver.h>
#include <drm/ttm/ttm_page_alloc.h>
-#ifdef CONFIG_X86
-#include <asm/set_memory.h>
-#endif
+#include <drm/ttm/ttm_set_memory.h>
/**
* Allocates a ttm structure for the given BO.
@@ -115,10 +113,9 @@ static int ttm_sg_tt_alloc_page_directory(struct ttm_dma_tt *ttm)
return 0;
}
-#ifdef CONFIG_X86
-static inline int ttm_tt_set_page_caching(struct page *p,
- enum ttm_caching_state c_old,
- enum ttm_caching_state c_new)
+static int ttm_tt_set_page_caching(struct page *p,
+ enum ttm_caching_state c_old,
+ enum ttm_caching_state c_new)
{
int ret = 0;
@@ -129,26 +126,18 @@ static inline int ttm_tt_set_page_caching(struct page *p,
/* p isn't in the default caching state, set it to
* writeback first to free its current memtype. */
- ret = set_pages_wb(p, 1);
+ ret = ttm_set_pages_wb(p, 1);
if (ret)
return ret;
}
if (c_new == tt_wc)
- ret = set_memory_wc((unsigned long) page_address(p), 1);
+ ret = ttm_set_pages_wc(p, 1);
else if (c_new == tt_uncached)
- ret = set_pages_uc(p, 1);
+ ret = ttm_set_pages_uc(p, 1);
return ret;
}
-#else /* CONFIG_X86 */
-static inline int ttm_tt_set_page_caching(struct page *p,
- enum ttm_caching_state c_old,
- enum ttm_caching_state c_new)
-{
- return 0;
-}
-#endif /* CONFIG_X86 */
/*
* Change caching policy for the linear kernel map
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/3] drm/ttm: fix missed conversion of set_pages_array_uc
[not found] ` <1533102573-15365-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
2018-08-01 5:49 ` [PATCH 3/3] drm/ttm: clean up non-x86 definitions on ttm_tt Huang Rui
@ 2018-08-01 6:45 ` Christian König
1 sibling, 0 replies; 4+ messages in thread
From: Christian König @ 2018-08-01 6:45 UTC (permalink / raw)
To: Huang Rui, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Am 01.08.2018 um 07:49 schrieb Huang Rui:
> This patch fixed the error when do not configure CONFIG_X86, otherwise, below
> error will be encountered.
>
> All errors (new ones prefixed by >>):
>
> drivers/gpu/drm/ttm/ttm_page_alloc_dma.c: In function 'ttm_set_pages_caching':
>>> drivers/gpu/drm/ttm/ttm_page_alloc_dma.c:272:7: error: implicit declaration of function 'set_pages_array_uc'; did you mean
> +'ttm_set_pages_array_uc'? [-Werror=implicit-function-declaration]
> r = set_pages_array_uc(pages, cpages);
> ^~~~~~~~~~~~~~~~~~
> ttm_set_pages_array_uc
> cc1: some warnings being treated as errors
>
> Reported-by: kbuild test robot <lkp@intel.com>
> Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com> for the series.
> ---
> drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
> index 8304917..507be7a 100644
> --- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
> +++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
> @@ -269,7 +269,7 @@ static int ttm_set_pages_caching(struct dma_pool *pool,
> int r = 0;
> /* Set page caching */
> if (pool->type & IS_UC) {
> - r = set_pages_array_uc(pages, cpages);
> + r = ttm_set_pages_array_uc(pages, cpages);
> if (r)
> pr_err("%s: Failed to set %d pages to uc!\n",
> pool->dev_name, cpages);
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-08-01 6:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-01 5:49 [PATCH 1/3] drm/ttm: fix missed conversion of set_pages_array_uc Huang Rui
2018-08-01 5:49 ` [PATCH 2/3] drm/ttm: Add ttm_set_pages_wc and ttm_set_pages_uc helper Huang Rui
[not found] ` <1533102573-15365-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
2018-08-01 5:49 ` [PATCH 3/3] drm/ttm: clean up non-x86 definitions on ttm_tt Huang Rui
2018-08-01 6:45 ` [PATCH 1/3] drm/ttm: fix missed conversion of set_pages_array_uc Christian König
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.