diff mbox

[V5,13/18] drm: Define SAREA_MAX for Loongson (PageSize = 16KB).

Message ID 1344677543-22591-14-git-send-email-chenhc@lemote.com (mailing list archive)
State New, archived
Headers show

Commit Message

Huacai Chen Aug. 11, 2012, 9:32 a.m. UTC
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Signed-off-by: Hongliang Tao <taohl@lemote.com>
Signed-off-by: Hua Yan <yanh@lemote.com>
Cc: dri-devel@lists.freedesktop.org
---
 include/drm/drm_sarea.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Comments

Ralf Baechle Aug. 15, 2012, 9:31 p.m. UTC | #1
On Sat, Aug 11, 2012 at 05:32:18PM +0800, Huacai Chen wrote:

> Subject: [PATCH V5 13/18] drm: Define SAREA_MAX for Loongson (PageSize = 16KB).

But your code doesn't define it just for Loongsson as the log message claims
but rather for all MIPS.

> diff --git a/include/drm/drm_sarea.h b/include/drm/drm_sarea.h
> index ee5389d..1d1a858 100644
> --- a/include/drm/drm_sarea.h
> +++ b/include/drm/drm_sarea.h
> @@ -37,6 +37,8 @@
>  /* SAREA area needs to be at least a page */
>  #if defined(__alpha__)
>  #define SAREA_MAX                       0x2000U
> +#elif defined(__mips__)
> +#define SAREA_MAX                       0x4000U

How about replacing this whole #ifdef mess with something like:

#include <linux/kernel.h>
#include <asm/page.h>

/* Intel 830M driver needs at least 8k SAREA */
#define SAREA_MAX	max(PAGE_SIZE, 0x2000U)

MIPS also uses 64K page size and your patch as posted would break with 64k
pages.

  Ralf
Huacai Chen Aug. 16, 2012, 12:43 a.m. UTC | #2
On Thu, Aug 16, 2012 at 5:31 AM, Ralf Baechle <ralf@linux-mips.org> wrote:
> On Sat, Aug 11, 2012 at 05:32:18PM +0800, Huacai Chen wrote:
>
>> Subject: [PATCH V5 13/18] drm: Define SAREA_MAX for Loongson (PageSize = 16KB).
>
> But your code doesn't define it just for Loongsson as the log message claims
> but rather for all MIPS.
>
>> diff --git a/include/drm/drm_sarea.h b/include/drm/drm_sarea.h
>> index ee5389d..1d1a858 100644
>> --- a/include/drm/drm_sarea.h
>> +++ b/include/drm/drm_sarea.h
>> @@ -37,6 +37,8 @@
>>  /* SAREA area needs to be at least a page */
>>  #if defined(__alpha__)
>>  #define SAREA_MAX                       0x2000U
>> +#elif defined(__mips__)
>> +#define SAREA_MAX                       0x4000U
>
> How about replacing this whole #ifdef mess with something like:
>
> #include <linux/kernel.h>
> #include <asm/page.h>
>
> /* Intel 830M driver needs at least 8k SAREA */
> #define SAREA_MAX       max(PAGE_SIZE, 0x2000U)
>
> MIPS also uses 64K page size and your patch as posted would break with 64k
> pages.
Yes, I think this is better. Thank you.
>
>   Ralf
Matt Turner Aug. 16, 2012, 1:58 a.m. UTC | #3
On Sat, Aug 11, 2012 at 2:32 AM, Huacai Chen <chenhuacai@gmail.com> wrote:
> Signed-off-by: Huacai Chen <chenhc@lemote.com>
> Signed-off-by: Hongliang Tao <taohl@lemote.com>
> Signed-off-by: Hua Yan <yanh@lemote.com>
> Cc: dri-devel@lists.freedesktop.org
> ---
>  include/drm/drm_sarea.h |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/include/drm/drm_sarea.h b/include/drm/drm_sarea.h
> index ee5389d..1d1a858 100644
> --- a/include/drm/drm_sarea.h
> +++ b/include/drm/drm_sarea.h
> @@ -37,6 +37,8 @@
>  /* SAREA area needs to be at least a page */
>  #if defined(__alpha__)
>  #define SAREA_MAX                       0x2000U
> +#elif defined(__mips__)
> +#define SAREA_MAX                       0x4000U
>  #elif defined(__ia64__)
>  #define SAREA_MAX                       0x10000U       /* 64kB */
>  #else
> --
> 1.7.7.3

SAREA is a DRI-1 concept. The Radeon drivers you're using is DRI-2, so
what do you need this for? All the DRI-1 drivers have been removed
from Mesa, so I think the answer is nothing.
Huacai Chen Aug. 16, 2012, 3:20 a.m. UTC | #4
On Thu, Aug 16, 2012 at 9:58 AM, Matt Turner <mattst88@gmail.com> wrote:
> On Sat, Aug 11, 2012 at 2:32 AM, Huacai Chen <chenhuacai@gmail.com> wrote:
>> Signed-off-by: Huacai Chen <chenhc@lemote.com>
>> Signed-off-by: Hongliang Tao <taohl@lemote.com>
>> Signed-off-by: Hua Yan <yanh@lemote.com>
>> Cc: dri-devel@lists.freedesktop.org
>> ---
>>  include/drm/drm_sarea.h |    2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/include/drm/drm_sarea.h b/include/drm/drm_sarea.h
>> index ee5389d..1d1a858 100644
>> --- a/include/drm/drm_sarea.h
>> +++ b/include/drm/drm_sarea.h
>> @@ -37,6 +37,8 @@
>>  /* SAREA area needs to be at least a page */
>>  #if defined(__alpha__)
>>  #define SAREA_MAX                       0x2000U
>> +#elif defined(__mips__)
>> +#define SAREA_MAX                       0x4000U
>>  #elif defined(__ia64__)
>>  #define SAREA_MAX                       0x10000U       /* 64kB */
>>  #else
>> --
>> 1.7.7.3
>
> SAREA is a DRI-1 concept. The Radeon drivers you're using is DRI-2, so
> what do you need this for? All the DRI-1 drivers have been removed
> from Mesa, so I think the answer is nothing.

This patch will be drop, thank you.
diff mbox

Patch

diff --git a/include/drm/drm_sarea.h b/include/drm/drm_sarea.h
index ee5389d..1d1a858 100644
--- a/include/drm/drm_sarea.h
+++ b/include/drm/drm_sarea.h
@@ -37,6 +37,8 @@ 
 /* SAREA area needs to be at least a page */
 #if defined(__alpha__)
 #define SAREA_MAX                       0x2000U
+#elif defined(__mips__)
+#define SAREA_MAX                       0x4000U
 #elif defined(__ia64__)
 #define SAREA_MAX                       0x10000U	/* 64kB */
 #else