Viktor Novotný
2010-Nov-16 22:22 UTC
[Nouveau] [PATCH] dri/nouveau: Clean up magic numbers in get_rt_format
From: Viktor Novotn? <noviktor at seznam.cz> Signed-off-by: Viktor Novotn? <noviktor at seznam.cz> --- Hi, since the switch to rnn headers was pushed(thank you, curro), here is a patch that I inteded to submit first, but somehow ended making the switch. It is just a small clean up. Regards Viktor src/mesa/drivers/dri/nouveau/nv04_state_fb.c | 6 +++--- src/mesa/drivers/dri/nouveau/nv10_state_fb.c | 10 +++++----- src/mesa/drivers/dri/nouveau/nv20_state_fb.c | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_fb.c b/src/mesa/drivers/dri/nouveau/nv04_state_fb.c index 730f91f..854571d 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_state_fb.c +++ b/src/mesa/drivers/dri/nouveau/nv04_state_fb.c @@ -36,11 +36,11 @@ get_rt_format(gl_format format) { switch (format) { case MESA_FORMAT_XRGB8888: - return 0x05; + return NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_X8R8G8B8_X8R8G8B8; case MESA_FORMAT_ARGB8888: - return 0x08; + return NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_A8R8G8B8; case MESA_FORMAT_RGB565: - return 0x03; + return NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_R5G6B5; default: assert(0); } diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c index 056054e..0505547 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c @@ -37,15 +37,15 @@ get_rt_format(gl_format format) { switch (format) { case MESA_FORMAT_XRGB8888: - return 0x05; + return NV10_3D_RT_FORMAT_COLOR_X8R8G8B8; case MESA_FORMAT_ARGB8888: - return 0x08; + return NV10_3D_RT_FORMAT_COLOR_A8R8G8B8; case MESA_FORMAT_RGB565: - return 0x03; + return NV10_3D_RT_FORMAT_COLOR_R5G6B5; case MESA_FORMAT_Z16: - return 0x10; + return NV10_3D_RT_FORMAT_DEPTH_Z16; case MESA_FORMAT_Z24_S8: - return 0x0; + return NV10_3D_RT_FORMAT_DEPTH_Z24S8; default: assert(0); } diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_fb.c b/src/mesa/drivers/dri/nouveau/nv20_state_fb.c index 8cabb55..cbde74e 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_state_fb.c +++ b/src/mesa/drivers/dri/nouveau/nv20_state_fb.c @@ -37,15 +37,15 @@ get_rt_format(gl_format format) { switch (format) { case MESA_FORMAT_XRGB8888: - return 0x05; + return NV20_3D_RT_FORMAT_COLOR_X8R8G8B8; case MESA_FORMAT_ARGB8888: - return 0x08; + return NV20_3D_RT_FORMAT_COLOR_A8R8G8B8; case MESA_FORMAT_RGB565: - return 0x03; + return NV20_3D_RT_FORMAT_COLOR_R5G6B5; case MESA_FORMAT_Z16: - return 0x10; + return NV20_3D_RT_FORMAT_DEPTH_Z16; case MESA_FORMAT_Z24_S8: - return 0x20; + return NV20_3D_RT_FORMAT_DEPTH_Z24S8; default: assert(0); } -- 1.7.3.2
Francisco Jerez
2010-Nov-19 18:06 UTC
[Nouveau] [PATCH] dri/nouveau: Clean up magic numbers in get_rt_format
Viktor Novotn? <noviktor at seznam.cz> writes:> From: Viktor Novotn? <noviktor at seznam.cz> > > Signed-off-by: Viktor Novotn? <noviktor at seznam.cz> > --- > Hi, > > since the switch to rnn headers was pushed(thank you, curro), here is a patch > that I inteded to submit first, but somehow ended making the switch. > It is just a small clean up. > > Regards > Viktor > > src/mesa/drivers/dri/nouveau/nv04_state_fb.c | 6 +++--- > src/mesa/drivers/dri/nouveau/nv10_state_fb.c | 10 +++++----- > src/mesa/drivers/dri/nouveau/nv20_state_fb.c | 10 +++++----- > 3 files changed, 13 insertions(+), 13 deletions(-) > > diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_fb.c b/src/mesa/drivers/dri/nouveau/nv04_state_fb.c > index 730f91f..854571d 100644 > --- a/src/mesa/drivers/dri/nouveau/nv04_state_fb.c > +++ b/src/mesa/drivers/dri/nouveau/nv04_state_fb.c > @@ -36,11 +36,11 @@ get_rt_format(gl_format format) > { > switch (format) { > case MESA_FORMAT_XRGB8888: > - return 0x05; > + return NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_X8R8G8B8_X8R8G8B8; > case MESA_FORMAT_ARGB8888: > - return 0x08; > + return NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_A8R8G8B8; > case MESA_FORMAT_RGB565: > - return 0x03; > + return NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_R5G6B5; > default: > assert(0); > } > diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c > index 056054e..0505547 100644 > --- a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c > +++ b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c > @@ -37,15 +37,15 @@ get_rt_format(gl_format format) > { > switch (format) { > case MESA_FORMAT_XRGB8888: > - return 0x05; > + return NV10_3D_RT_FORMAT_COLOR_X8R8G8B8; > case MESA_FORMAT_ARGB8888: > - return 0x08; > + return NV10_3D_RT_FORMAT_COLOR_A8R8G8B8; > case MESA_FORMAT_RGB565: > - return 0x03; > + return NV10_3D_RT_FORMAT_COLOR_R5G6B5; > case MESA_FORMAT_Z16: > - return 0x10; > + return NV10_3D_RT_FORMAT_DEPTH_Z16; > case MESA_FORMAT_Z24_S8: > - return 0x0; > + return NV10_3D_RT_FORMAT_DEPTH_Z24S8; > default: > assert(0); > } > diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_fb.c b/src/mesa/drivers/dri/nouveau/nv20_state_fb.c > index 8cabb55..cbde74e 100644 > --- a/src/mesa/drivers/dri/nouveau/nv20_state_fb.c > +++ b/src/mesa/drivers/dri/nouveau/nv20_state_fb.c > @@ -37,15 +37,15 @@ get_rt_format(gl_format format) > { > switch (format) { > case MESA_FORMAT_XRGB8888: > - return 0x05; > + return NV20_3D_RT_FORMAT_COLOR_X8R8G8B8; > case MESA_FORMAT_ARGB8888: > - return 0x08; > + return NV20_3D_RT_FORMAT_COLOR_A8R8G8B8; > case MESA_FORMAT_RGB565: > - return 0x03; > + return NV20_3D_RT_FORMAT_COLOR_R5G6B5; > case MESA_FORMAT_Z16: > - return 0x10; > + return NV20_3D_RT_FORMAT_DEPTH_Z16; > case MESA_FORMAT_Z24_S8: > - return 0x20; > + return NV20_3D_RT_FORMAT_DEPTH_Z24S8; > default: > assert(0); > }Thanks, pushed. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 229 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/nouveau/attachments/20101119/009d3a8b/attachment.pgp>