diff mbox

[1/3] drm/ttm: add set_pages_wb for handling page order more than zero

Message ID 1511351069-4757-1-git-send-email-Hongbo.He@amd.com (mailing list archive)
State New, archived
Headers show

Commit Message

He, Hongbo Nov. 22, 2017, 11:44 a.m. UTC
Change-Id: Idf5ccb579d264b343199d8b8344bddeec2c0019f
Signed-off-by: Roger He <Hongbo.He@amd.com>
---
 drivers/gpu/drm/ttm/ttm_page_alloc.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Chris Wilson Nov. 22, 2017, 11:50 a.m. UTC | #1
Quoting Roger He (2017-11-22 11:44:27)
> Change-Id: Idf5ccb579d264b343199d8b8344bddeec2c0019f
> Signed-off-by: Roger He <Hongbo.He@amd.com>
> ---
>  drivers/gpu/drm/ttm/ttm_page_alloc.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c
> index a8b2bfa..cdbb731 100644
> --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
> +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
> @@ -223,6 +223,17 @@ static struct kobj_type ttm_pool_kobj_type = {
>  static struct ttm_pool_manager *_manager;
>  
>  #ifndef CONFIG_X86
> +static int set_pages_wb(struct page *page, int numpages)
> +{
> +#if IS_ENABLED(CONFIG_AGP)
> +       int i;
> +
> +       for (i = 0; i < numpages; i++)
> +               unmap_page_from_agp(page++);
> +#endif
> +       return 0;
> +}
> +
>  static int set_pages_array_wb(struct page **pages, int addrinarray)

Both of these are shadowing exports from arch/x86, probably not the
wisest choice of names.
-Chris
Christian König Nov. 22, 2017, 11:53 a.m. UTC | #2
Am 22.11.2017 um 12:44 schrieb Roger He:
> Change-Id: Idf5ccb579d264b343199d8b8344bddeec2c0019f
> Signed-off-by: Roger He <Hongbo.He@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com> for the whole 
series.

> ---
>   drivers/gpu/drm/ttm/ttm_page_alloc.c | 11 +++++++++++
>   1 file changed, 11 insertions(+)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c
> index a8b2bfa..cdbb731 100644
> --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
> +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
> @@ -223,6 +223,17 @@ static struct kobj_type ttm_pool_kobj_type = {
>   static struct ttm_pool_manager *_manager;
>   
>   #ifndef CONFIG_X86
> +static int set_pages_wb(struct page *page, int numpages)
> +{
> +#if IS_ENABLED(CONFIG_AGP)
> +	int i;
> +
> +	for (i = 0; i < numpages; i++)
> +		unmap_page_from_agp(page++);
> +#endif
> +	return 0;
> +}
> +
>   static int set_pages_array_wb(struct page **pages, int addrinarray)
>   {
>   #if IS_ENABLED(CONFIG_AGP)
Christian König Nov. 22, 2017, 11:54 a.m. UTC | #3
Am 22.11.2017 um 12:50 schrieb Chris Wilson:
> Quoting Roger He (2017-11-22 11:44:27)
>> Change-Id: Idf5ccb579d264b343199d8b8344bddeec2c0019f
>> Signed-off-by: Roger He <Hongbo.He@amd.com>
>> ---
>>   drivers/gpu/drm/ttm/ttm_page_alloc.c | 11 +++++++++++
>>   1 file changed, 11 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c
>> index a8b2bfa..cdbb731 100644
>> --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
>> +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
>> @@ -223,6 +223,17 @@ static struct kobj_type ttm_pool_kobj_type = {
>>   static struct ttm_pool_manager *_manager;
>>   
>>   #ifndef CONFIG_X86
>> +static int set_pages_wb(struct page *page, int numpages)
>> +{
>> +#if IS_ENABLED(CONFIG_AGP)
>> +       int i;
>> +
>> +       for (i = 0; i < numpages; i++)
>> +               unmap_page_from_agp(page++);
>> +#endif
>> +       return 0;
>> +}
>> +
>>   static int set_pages_array_wb(struct page **pages, int addrinarray)
> Both of these are shadowing exports from arch/x86, probably not the
> wisest choice of names.

That is intended, please note the "#ifndef CONFIG_X86".

Basically TTM provides the same function for other architectures that we 
have for X86.

Christian.

> -Chris
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c
index a8b2bfa..cdbb731 100644
--- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
@@ -223,6 +223,17 @@  static struct kobj_type ttm_pool_kobj_type = {
 static struct ttm_pool_manager *_manager;
 
 #ifndef CONFIG_X86
+static int set_pages_wb(struct page *page, int numpages)
+{
+#if IS_ENABLED(CONFIG_AGP)
+	int i;
+
+	for (i = 0; i < numpages; i++)
+		unmap_page_from_agp(page++);
+#endif
+	return 0;
+}
+
 static int set_pages_array_wb(struct page **pages, int addrinarray)
 {
 #if IS_ENABLED(CONFIG_AGP)