From: Christoph Bumiller <e0425955-oe7qfRrRQffzPE21tAIdciO7C/xPubJB@public.gmane.org>
To: Maarten Maathuis <madman2003-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 1/2] drm/nv50: align size of buffer object to the right boundaries.
Date: Sun, 27 Dec 2009 14:43:27 +0100 [thread overview]
Message-ID: <4B37647F.9030402@student.tuwien.ac.at> (raw)
In-Reply-To: <1261914064-3535-1-git-send-email-madman2003-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On 12/27/2009 12:41 PM, Maarten Maathuis wrote:
> - Depth and stencil buffers are supposed to be large enough in general.
>
> Signed-off-by: Maarten Maathuis <madman2003-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> drivers/gpu/drm/nouveau/nouveau_bo.c | 9 ++++-----
> 1 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
> index e342a41..9fc4bd6 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_bo.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
> @@ -65,8 +65,9 @@ nouveau_bo_fixup_align(struct drm_device *dev,
>
> /*
> * Some of the tile_flags have a periodic structure of N*4096 bytes,
> - * align to to that as well as the page size. Overallocate memory to
> - * avoid corruption of other buffer objects.
> + * align to to that as well as the page size. Align the size to the
> + * appropriate boundaries. This does imply that sizes are rounded up
> + * 3-7 pages, so make sure your "special" buffer sizes are large enough.
> */
No - 16x16 depth textures or whatever crazy idea some app might have
won't be large enough.
Taking care of size in userspace and of alignment in kernel ... not nice
to split in my opinion.
> if (dev_priv->card_type == NV_50) {
> uint32_t block_size = nouveau_mem_fb_amount(dev) >> 15;
> @@ -77,22 +78,20 @@ nouveau_bo_fixup_align(struct drm_device *dev,
> case 0x2800:
> case 0x4800:
> case 0x7a00:
> - *size = roundup(*size, block_size);
> if (is_power_of_2(block_size)) {
> - *size += 3 * block_size;
> for (i = 1; i < 10; i++) {
> *align = 12 * i * block_size;
> if (!(*align % 65536))
> break;
> }
> } else {
> - *size += 6 * block_size;
> for (i = 1; i < 10; i++) {
> *align = 8 * i * block_size;
> if (!(*align % 65536))
> break;
> }
> }
> + *size = roundup(*size, *align);
> break;
> default:
> break;
next prev parent reply other threads:[~2009-12-27 13:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-27 11:41 [PATCH 1/2] drm/nv50: align size of buffer object to the right boundaries Maarten Maathuis
[not found] ` <1261914064-3535-1-git-send-email-madman2003-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-12-27 11:41 ` [PATCH 2/2] drm/nv50: synchronize user channel after buffer object move on kernel channel Maarten Maathuis
2009-12-27 13:43 ` Christoph Bumiller [this message]
[not found] ` <4B37647F.9030402-oe7qfRrRQffzPE21tAIdciO7C/xPubJB@public.gmane.org>
2009-12-27 14:28 ` [PATCH 1/2] drm/nv50: align size of buffer object to the right boundaries Maarten Maathuis
[not found] ` <6d4bc9fc0912270628l4ccddb11ua1811be230bbb15d-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-12-27 21:36 ` Maarten Maathuis
-- strict thread matches above, loose matches on Subject: below --
2009-12-28 23:49 Maarten Maathuis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B37647F.9030402@student.tuwien.ac.at \
--to=e0425955-oe7qfrrrqffzpe21taidcio7c/xpubjb@public.gmane.org \
--cc=madman2003-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.