All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nouveau/vieux: only advertise supported texture formats
@ 2012-04-30 17:16 Lucas Stach
       [not found] ` <1335806214-13903-1-git-send-email-dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org>
  2012-04-30 18:08 ` [Nouveau] " Francisco Jerez
  0 siblings, 2 replies; 7+ messages in thread
From: Lucas Stach @ 2012-04-30 17:16 UTC (permalink / raw)
  To: nouveau; +Cc: mesa-dev

Fixes an assertion seen by users.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Tested-by: JohnDoe_71Rus on irc
---
 src/mesa/drivers/dri/nouveau/nouveau_context.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c
index 4845767..46c0d70 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_context.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c
@@ -117,6 +117,15 @@ nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen,
 	nouveau_span_functions_init(ctx);
 	_mesa_allow_light_in_model(ctx, GL_FALSE);
 
+	/* only advertise supported texture formats */
+	memset(&ctx->TextureFormatSupported, 0,
+	       sizeof(ctx->TextureFormatSupported));
+	ctx->TextureFormatSupported[MESA_FORMAT_XRGB8888] = true;
+	ctx->TextureFormatSupported[MESA_FORMAT_ARGB8888] = true;
+	ctx->TextureFormatSupported[MESA_FORMAT_RGB565] = true;
+	ctx->TextureFormatSupported[MESA_FORMAT_Z16] = true;
+	ctx->TextureFormatSupported[MESA_FORMAT_Z24_S8] = true;
+
 	/* Allocate a hardware channel. */
 	ret = nouveau_object_new(&context_dev(ctx)->object, 0xbeef0000,
 				 NOUVEAU_FIFO_CHANNEL_CLASS,
-- 
1.7.10

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

* Re: [PATCH] nouveau/vieux: only advertise supported texture formats
       [not found] ` <1335806214-13903-1-git-send-email-dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org>
@ 2012-04-30 17:54   ` Christoph Bumiller
       [not found]     ` <1335809942.9221.13.camel@tellur>
  0 siblings, 1 reply; 7+ messages in thread
From: Christoph Bumiller @ 2012-04-30 17:54 UTC (permalink / raw)
  To: Lucas Stach
  Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	mesa-dev-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 30.04.2012 19:16, Lucas Stach wrote:
> Fixes an assertion seen by users.
>
> Signed-off-by: Lucas Stach <dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org>
> Tested-by: JohnDoe_71Rus on irc
> ---
>  src/mesa/drivers/dri/nouveau/nouveau_context.c |    9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c
> index 4845767..46c0d70 100644
> --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c
> +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c
> @@ -117,6 +117,15 @@ nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen,
>  	nouveau_span_functions_init(ctx);
>  	_mesa_allow_light_in_model(ctx, GL_FALSE);
>  
> +	/* only advertise supported texture formats */
> +	memset(&ctx->TextureFormatSupported, 0,
> +	       sizeof(ctx->TextureFormatSupported));
> +	ctx->TextureFormatSupported[MESA_FORMAT_XRGB8888] = true;
> +	ctx->TextureFormatSupported[MESA_FORMAT_ARGB8888] = true;
> +	ctx->TextureFormatSupported[MESA_FORMAT_RGB565] = true;
> +	ctx->TextureFormatSupported[MESA_FORMAT_Z16] = true;
> +	ctx->TextureFormatSupported[MESA_FORMAT_Z24_S8] = true;
> +

But it also seems to support ARGB1555, L8, A8 and I8, see
nouveau_choose_tex_format ...

>  	/* Allocate a hardware channel. */
>  	ret = nouveau_object_new(&context_dev(ctx)->object, 0xbeef0000,
>  				 NOUVEAU_FIFO_CHANNEL_CLASS,

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

* Re: [Nouveau] [PATCH] nouveau/vieux: only advertise supported texture formats
  2012-04-30 17:16 [PATCH] nouveau/vieux: only advertise supported texture formats Lucas Stach
       [not found] ` <1335806214-13903-1-git-send-email-dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org>
@ 2012-04-30 18:08 ` Francisco Jerez
       [not found]   ` <1335810158.9221.16.camel@tellur>
  1 sibling, 1 reply; 7+ messages in thread
From: Francisco Jerez @ 2012-04-30 18:08 UTC (permalink / raw)
  To: Lucas Stach; +Cc: nouveau, mesa-dev


[-- Attachment #1.1.1: Type: text/plain, Size: 1516 bytes --]

Lucas Stach <dev@lynxeye.de> writes:

> Fixes an assertion seen by users.
>
> Signed-off-by: Lucas Stach <dev@lynxeye.de>
> Tested-by: JohnDoe_71Rus on irc
> ---
>  src/mesa/drivers/dri/nouveau/nouveau_context.c |    9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c
> index 4845767..46c0d70 100644
> --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c
> +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c
> @@ -117,6 +117,15 @@ nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen,
>  	nouveau_span_functions_init(ctx);
>  	_mesa_allow_light_in_model(ctx, GL_FALSE);
>  
> +	/* only advertise supported texture formats */
> +	memset(&ctx->TextureFormatSupported, 0,
> +	       sizeof(ctx->TextureFormatSupported));
> +	ctx->TextureFormatSupported[MESA_FORMAT_XRGB8888] = true;
> +	ctx->TextureFormatSupported[MESA_FORMAT_ARGB8888] = true;
> +	ctx->TextureFormatSupported[MESA_FORMAT_RGB565] = true;
> +	ctx->TextureFormatSupported[MESA_FORMAT_Z16] = true;
> +	ctx->TextureFormatSupported[MESA_FORMAT_Z24_S8] = true;
> +
Hi Lucas,

It's not obvious to me how this works.  AFAIK nouveau doesn't make use
of this array.  And even if it did, the texture formats you're listing
aren't the supported ones.

>  	/* Allocate a hardware channel. */
>  	ret = nouveau_object_new(&context_dev(ctx)->object, 0xbeef0000,
>  				 NOUVEAU_FIFO_CHANNEL_CLASS,

[-- Attachment #1.2: Type: application/pgp-signature, Size: 229 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

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

* Re: [PATCH] nouveau/vieux: only advertise supported texture formats
       [not found]   ` <1335810158.9221.16.camel@tellur>
@ 2012-04-30 18:26     ` Lucas Stach
  2012-04-30 19:42     ` Francisco Jerez
  1 sibling, 0 replies; 7+ messages in thread
From: Lucas Stach @ 2012-04-30 18:26 UTC (permalink / raw)
  To: Francisco Jerez; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

And I managed to hit "reply privately" two times in a row. -.-

Am Montag, den 30.04.2012, 20:22 +0200 schrieb Lucas Stach:
> Am Montag, den 30.04.2012, 20:08 +0200 schrieb Francisco Jerez:
> > Lucas Stach <dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org> writes:
> > 
> > > Fixes an assertion seen by users.
> > >
> > > Signed-off-by: Lucas Stach <dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org>
> > > Tested-by: JohnDoe_71Rus on irc
> > > ---
> > >  src/mesa/drivers/dri/nouveau/nouveau_context.c |    9 +++++++++
> > >  1 file changed, 9 insertions(+)
> > >
> > > diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c
> > > index 4845767..46c0d70 100644
> > > --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c
> > > +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c
> > > @@ -117,6 +117,15 @@ nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen,
> > >  	nouveau_span_functions_init(ctx);
> > >  	_mesa_allow_light_in_model(ctx, GL_FALSE);
> > >  
> > > +	/* only advertise supported texture formats */
> > > +	memset(&ctx->TextureFormatSupported, 0,
> > > +	       sizeof(ctx->TextureFormatSupported));
> > > +	ctx->TextureFormatSupported[MESA_FORMAT_XRGB8888] = true;
> > > +	ctx->TextureFormatSupported[MESA_FORMAT_ARGB8888] = true;
> > > +	ctx->TextureFormatSupported[MESA_FORMAT_RGB565] = true;
> > > +	ctx->TextureFormatSupported[MESA_FORMAT_Z16] = true;
> > > +	ctx->TextureFormatSupported[MESA_FORMAT_Z24_S8] = true;
> > > +
> > Hi Lucas,
> > 
> > It's not obvious to me how this works.  AFAIK nouveau doesn't make use
> > of this array.  And even if it did, the texture formats you're listing
> > aren't the supported ones.
> 
> Hello Francisco,
> 
> The core mesa code decides what texture formats to advertise based on
> this array. And obviously someone thought it would be a good idea to
> init this array to "everything supported" if the driver doesn't
> overrides this.
> 
> I opted to only advertise renderable texture formats, for reasons
> explained in my mail a minute ago.
> 
> -- Lucas
> > 
> > >  	/* Allocate a hardware channel. */
> > >  	ret = nouveau_object_new(&context_dev(ctx)->object, 0xbeef0000,
> > >  				 NOUVEAU_FIFO_CHANNEL_CLASS,
> 

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

* Re: [PATCH] nouveau/vieux: only advertise supported texture formats
       [not found]     ` <1335809942.9221.13.camel@tellur>
@ 2012-04-30 18:27       ` Lucas Stach
  0 siblings, 0 replies; 7+ messages in thread
From: Lucas Stach @ 2012-04-30 18:27 UTC (permalink / raw)
  To: Christoph Bumiller; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

And I managed to hit "reply privately" two times in a row. -.-

Am Montag, den 30.04.2012, 20:19 +0200 schrieb Lucas Stach:
> Am Montag, den 30.04.2012, 19:54 +0200 schrieb Christoph Bumiller:
> > On 30.04.2012 19:16, Lucas Stach wrote:
> > > Fixes an assertion seen by users.
> > >
> > > Signed-off-by: Lucas Stach <dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org>
> > > Tested-by: JohnDoe_71Rus on irc
> > > ---
> > >  src/mesa/drivers/dri/nouveau/nouveau_context.c |    9 +++++++++
> > >  1 file changed, 9 insertions(+)
> > >
> > > diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c
> > > index 4845767..46c0d70 100644
> > > --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c
> > > +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c
> > > @@ -117,6 +117,15 @@ nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen,
> > >  	nouveau_span_functions_init(ctx);
> > >  	_mesa_allow_light_in_model(ctx, GL_FALSE);
> > >  
> > > +	/* only advertise supported texture formats */
> > > +	memset(&ctx->TextureFormatSupported, 0,
> > > +	       sizeof(ctx->TextureFormatSupported));
> > > +	ctx->TextureFormatSupported[MESA_FORMAT_XRGB8888] = true;
> > > +	ctx->TextureFormatSupported[MESA_FORMAT_ARGB8888] = true;
> > > +	ctx->TextureFormatSupported[MESA_FORMAT_RGB565] = true;
> > > +	ctx->TextureFormatSupported[MESA_FORMAT_Z16] = true;
> > > +	ctx->TextureFormatSupported[MESA_FORMAT_Z24_S8] = true;
> > > +
> > 
> > But it also seems to support ARGB1555, L8, A8 and I8, see
> > nouveau_choose_tex_format ...
> 
> Right, but I have no idea if we are able to render to those formats,
> which seems unlikely. Sadly I see no way to specify a texture format
> only for sampling in TextureFormatSupported, that's why I opted for the
> safe option here. We may have to revisit this at the latest when
> considering the S3TC work.
> 
> In any case this patch fixes an actual problem, which breaks every
> application that doesn't by luck choose one of the safe formats, so I
> would really like to see this patch pushed, even if it's only a stop
> gap.
> 
> -- Lucas
> > 
> > >  	/* Allocate a hardware channel. */
> > >  	ret = nouveau_object_new(&context_dev(ctx)->object, 0xbeef0000,
> > >  				 NOUVEAU_FIFO_CHANNEL_CLASS,
> > 
> 

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

* Re: [PATCH] nouveau/vieux: only advertise supported texture formats
       [not found]   ` <1335810158.9221.16.camel@tellur>
  2012-04-30 18:26     ` Lucas Stach
@ 2012-04-30 19:42     ` Francisco Jerez
       [not found]       ` <87vckhvwee.fsf-sGOZH3hwPm2sTnJN9+BGXg@public.gmane.org>
  1 sibling, 1 reply; 7+ messages in thread
From: Francisco Jerez @ 2012-04-30 19:42 UTC (permalink / raw)
  To: Lucas Stach; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1.1: Type: text/plain, Size: 1423 bytes --]

Lucas Stach <dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org> writes:

> Am Montag, den 30.04.2012, 20:08 +0200 schrieb Francisco Jerez:
>> Lucas Stach <dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org> writes:
>>[...]
>> > +	/* only advertise supported texture formats */
>> > +	memset(&ctx->TextureFormatSupported, 0,
>> > +	       sizeof(ctx->TextureFormatSupported));
>> > +	ctx->TextureFormatSupported[MESA_FORMAT_XRGB8888] = true;
>> > +	ctx->TextureFormatSupported[MESA_FORMAT_ARGB8888] = true;
>> > +	ctx->TextureFormatSupported[MESA_FORMAT_RGB565] = true;
>> > +	ctx->TextureFormatSupported[MESA_FORMAT_Z16] = true;
>> > +	ctx->TextureFormatSupported[MESA_FORMAT_Z24_S8] = true;
>> > +
>> Hi Lucas,
>> 
>> It's not obvious to me how this works.  AFAIK nouveau doesn't make use
>> of this array.  And even if it did, the texture formats you're listing
>> aren't the supported ones.
>
> Hello Francisco,
>
> The core mesa code decides what texture formats to advertise based on
> this array.

Are you sure?  TextureFormatSupported doesn't seem to have any effect
except in drivers that use mesa's default for the ChooseTextureFormat
hook.

> And obviously someone thought it would be a good idea to
> init this array to "everything supported" if the driver doesn't
> overrides this.
>
> I opted to only advertise renderable texture formats, for reasons
> explained in my mail a minute ago.

[-- Attachment #1.2: Type: application/pgp-signature, Size: 229 bytes --]

[-- Attachment #2: Type: text/plain, Size: 181 bytes --]

_______________________________________________
Nouveau mailing list
Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

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

* Re: [PATCH] nouveau/vieux: only advertise supported texture formats
       [not found]       ` <87vckhvwee.fsf-sGOZH3hwPm2sTnJN9+BGXg@public.gmane.org>
@ 2012-04-30 19:54         ` Lucas Stach
  0 siblings, 0 replies; 7+ messages in thread
From: Lucas Stach @ 2012-04-30 19:54 UTC (permalink / raw)
  To: Francisco Jerez; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Am Montag, den 30.04.2012, 21:42 +0200 schrieb Francisco Jerez:
> Lucas Stach <dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org> writes:
> 
> > Am Montag, den 30.04.2012, 20:08 +0200 schrieb Francisco Jerez:
> >> Lucas Stach <dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org> writes:
> >>[...]
> >> > +	/* only advertise supported texture formats */
> >> > +	memset(&ctx->TextureFormatSupported, 0,
> >> > +	       sizeof(ctx->TextureFormatSupported));
> >> > +	ctx->TextureFormatSupported[MESA_FORMAT_XRGB8888] = true;
> >> > +	ctx->TextureFormatSupported[MESA_FORMAT_ARGB8888] = true;
> >> > +	ctx->TextureFormatSupported[MESA_FORMAT_RGB565] = true;
> >> > +	ctx->TextureFormatSupported[MESA_FORMAT_Z16] = true;
> >> > +	ctx->TextureFormatSupported[MESA_FORMAT_Z24_S8] = true;
> >> > +
> >> Hi Lucas,
> >> 
> >> It's not obvious to me how this works.  AFAIK nouveau doesn't make use
> >> of this array.  And even if it did, the texture formats you're listing
> >> aren't the supported ones.
> >
> > Hello Francisco,
> >
> > The core mesa code decides what texture formats to advertise based on
> > this array.
> 
> Are you sure?  TextureFormatSupported doesn't seem to have any effect
> except in drivers that use mesa's default for the ChooseTextureFormat
> hook.

I'm not able to test it myself, as I don't have any vieux hardware, but
I made sure that the patch got tested by the reporter of the bug [1],
before posting it to the list.

[1] https://bugs.freedesktop.org/show_bug.cgi?id=49148
> 
> > And obviously someone thought it would be a good idea to
> > init this array to "everything supported" if the driver doesn't
> > overrides this.
> >
> > I opted to only advertise renderable texture formats, for reasons
> > explained in my mail a minute ago.

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

end of thread, other threads:[~2012-04-30 19:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-30 17:16 [PATCH] nouveau/vieux: only advertise supported texture formats Lucas Stach
     [not found] ` <1335806214-13903-1-git-send-email-dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org>
2012-04-30 17:54   ` Christoph Bumiller
     [not found]     ` <1335809942.9221.13.camel@tellur>
2012-04-30 18:27       ` Lucas Stach
2012-04-30 18:08 ` [Nouveau] " Francisco Jerez
     [not found]   ` <1335810158.9221.16.camel@tellur>
2012-04-30 18:26     ` Lucas Stach
2012-04-30 19:42     ` Francisco Jerez
     [not found]       ` <87vckhvwee.fsf-sGOZH3hwPm2sTnJN9+BGXg@public.gmane.org>
2012-04-30 19:54         ` Lucas Stach

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.