texture dimension limits in ddx
in nv10_exa.c :check_texture does :
if (w > 2046 || h > 2046)
NOUVEAU_FALLBACK("picture too large, %dx%d\n", w, h);
check_render_target does :
if (w > 4096 || h > 4096)
return FALSE;So we have different size limits for the source and the destination ?
Another thing is that nv20 uses nv10_exa.c code, and the limit in check_texture could be increased for nv20 according to curro :
01:03 < curro_> shining: btw, about the 2048x2048 fallback, i'm quite sure it's wrong for nv2x
01:05 < curro_> shining: it can do 4096x4096 with no problems, IIRC
And finally I saw that nouveau_exa_init does this :
if (pNv->Architecture >= NV_ARCH_50) {
exa->maxX = 8192;
exa->maxY = 8192;
} else
if (pNv->Architecture >= NV_ARCH_20) {
exa->maxX = 4096;
exa->maxY = 4096;
} else {
exa->maxX = 2048;
exa->maxY = 2048;
}But these 3 values are hardcoded everywhere in the code.
It might not be possible to use exa->maxX/Y directly as some functions like check_texture / check_render_target above don't seem to have access to them.
Maybe some constants could be defined instead and used everywhere ? #define NV04_MAX 2048
#define NV20_MAX 4096
#define NV50_MAX 8192
or something.
Quoted 29 lines · Xavier Chantry
in
nv10_exa.c:check_texturedoes :
if (w > 2046 || h > 2046)
NOUVEAU_FALLBACK("picture too large, %dx%d\n", w, h);check_render_targetdoes :
if (w > 4096 || h > 4096)
return FALSE;So we have different size limits for the source and the destination ?
Another thing is that nv20 uses
nv10_exa.ccode, and the limit incheck_texturecould be increased for nv20 according to curro :
01:03 <curro_> shining: btw, about the 2048x2048 fallback, i'm quite sure it's wrong for nv2x
01:05 <curro_> shining: it can do 4096x4096 with no problems, IIRCAnd finally I saw that
nouveau_exa_initdoes this :
if (pNv->Architecture>=NV_ARCH_50) {exa->maxX= 8192;
exa->maxY = 8192;
} else
if (pNv->Architecture>=NV_ARCH_20) {exa->maxX= 4096;
exa->maxY = 4096;
} else {
exa->maxX = 2048;
exa->maxY = 2048;
}
Quoted 10 lines
But these 3 values are hardcoded everywhere in the code.
It might not be possible to use exa->maxX/Y directly as some functions likecheck_texture/check_render_targetabove don't seem to have access to them.
Maybe some constants could be defined instead and used everywhere ? #defineNV04_MAX2048
#defineNV20_MAX4096
#defineNV50_MAX8192
or something.
Or to put this another way, I would like to give a name to all the values below. Actually nouveau_xv.c already defines some constants, but I have no idea if it would make any sense to use them in the other source files.
src/nouveau_exa.c: exa->maxX = 8192;src/nouveau_exa.c: exa->maxY = 8192;src/nouveau_exa.c: exa->maxX = 4096;src/nouveau_exa.c: exa->maxY = 4096;src/nouveau_exa.c: exa->maxX = 2048;src/nouveau_exa.c: exa->maxY = 2048;
src/nouveau_xv.c:#define IMAGE_MAX_W 2046
src/nouveau_xv.c:#define IMAGE_MAX_H 2046
src/nouveau_xv.c:#define TEX_IMAGE_MAX_W 4096
src/nouveau_xv.c:#define TEX_IMAGE_MAX_H 4096
src/nv10_exa.c: if (w > 2046 || h > 2046) src/nv10_exa.c: if (w > 4096 || h > 4096)
src/nv30_exa.c: if ((w > 4096) || (h > 4096))src/nv30_exa.c: int w=4096;src/nv30_exa.c: int h=4096;src/nv30_exa.c: int pitch=4096*4;src/nv30_xv_tex.c: if (drw_w > 4096 || drw_h > 4096) {src/nv40_exa.c: if ((w > 4096) || (h > 4096))src/nv40_xv_tex.c: if (drw_w > 4096 || drw_h > 4096) {src/nv50_exa.c: if (ppict->pDrawable->width > 8192 ||src/nv50_exa.c: ppict->pDrawable->height > 8192)src/nv50_exa.c: if (ppict->pDrawable->width > 8192 ||src/nv50_exa.c: ppict->pDrawable->height > 8192)src/vl_hwmc.c: 2048,src/vl_hwmc.c: 2048,src/vl_hwmc.c: 2048,src/vl_hwmc.c: 2048,
Quoted 64 lines · Xavier Chantry
Quoted 29 lines · Xavier Chantry
in
nv10_exa.c:check_texturedoes :if (w > 2046 || h > 2046) NOUVEAU_FALLBACK("picture too large, %dx%d\n", w, h); check_render_target does : if (w > 4096 || h > 4096) return FALSE;So we have different size limits for the source and the destination ?
Another thing is that nv20 uses
nv10_exa.ccode, and the limit incheck_texturecould be increased for nv20 according to curro :
01:03 <curro_> shining: btw, about the 2048x2048 fallback, i'm quite sure it's wrong for nv2x
01:05 <curro_> shining: it can do 4096x4096 with no problems, IIRCAnd finally I saw that
nouveau_exa_initdoes this :if (pNv->Architecture >= NV_ARCH_50) { exa->maxX = 8192; exa->maxY = 8192; } else if (pNv->Architecture >= NV_ARCH_20) { exa->maxX = 4096; exa->maxY = 4096; } else { exa->maxX = 2048; exa->maxY = 2048; }Quoted 10 lines
But these 3 values are hardcoded everywhere in the code.
It might not be possible to use exa->maxX/Y directly as some functions likecheck_texture/check_render_targetabove don't seem to have access to them.
Maybe some constants could be defined instead and used everywhere ? #defineNV04_MAX2048
#defineNV20_MAX4096
#defineNV50_MAX8192
or something.Or to put this another way, I would like to give a name to all the values below. Actually
nouveau_xv.calready defines some constants, but I have no idea if it would make any sense to use them in the other source files.src/nouveau_exa.c: exa->maxX = 8192; src/nouveau_exa.c: exa->maxY = 8192; src/nouveau_exa.c: exa->maxX = 4096; src/nouveau_exa.c: exa->maxY = 4096; src/nouveau_exa.c: exa->maxX = 2048; src/nouveau_exa.c: exa->maxY = 2048;src/nouveau_xv.c:#define
IMAGE_MAX_W2046
src/nouveau_xv.c:#defineIMAGE_MAX_H2046
src/nouveau_xv.c:#defineTEX_IMAGE_MAX_W4096
src/nouveau_xv.c:#defineTEX_IMAGE_MAX_H4096src/nv10_exa.c: if (w > 2046 || h > 2046) src/nv10_exa.c: if (w > 4096 || h > 4096) src/nv30_exa.c: if ((w > 4096) || (h > 4096)) src/nv30_exa.c: int w=4096; src/nv30_exa.c: int h=4096; src/nv30_exa.c: int pitch=4096*4; src/nv30_xv_tex.c: if (drw_w > 4096 || drw_h > 4096) { src/nv40_exa.c: if ((w > 4096) || (h > 4096)) src/nv40_xv_tex.c: if (drw_w > 4096 || drw_h > 4096) {
Quoted 8 lines
src/nv50_exa.c: if (ppict->pDrawable->width > 8192 || src/nv50_exa.c: ppict->pDrawable->height > 8192) src/nv50_exa.c: if (ppict->pDrawable->width > 8192 || src/nv50_exa.c: ppict->pDrawable->height > 8192) src/vl_hwmc.c: 2048, src/vl_hwmc.c: 2048, src/vl_hwmc.c: 2048, src/vl_hwmc.c: 2048,
It makes sense to clean this up if you're up to it. Some are max texture sizes and others are max render target sizes like you said. If you can figure out the limits of the various HW classes you can substitute them into the code. Just remember, if a surface is both a texture and a render target you'll have to use the smaller of the two limits.
Maybe it makes sense to add it to nouveau_class.h if it's not already there in some form so it can be used everywhere.
The value in vl_hwmc.c is for XvMC surfaces, which are used both as textures and RTs and I just chose the a small reasonable value, it's not based on any HW limits.