From: poma <pomidorabelisima-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
mesa-dev-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH mesa] nv30: Fix creation of scanout buffers
Date: Thu, 13 Aug 2015 15:40:38 +0200 [thread overview]
Message-ID: <55CC9E56.5090903@gmail.com> (raw)
In-Reply-To: <1439382297-5647-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
On 12.08.2015 14:24, Hans de Goede wrote:
> Scanout buffers on nv30 must always be non-swizzled and have special
> width alignment constraints.
>
> These constrains have been taken from the xf86-video-nouveau
> src/nv_accel_common.c: nouveau_allocate_surface() function.
>
> nouveau_allocate_surface() applies these width constraints only when a
> tiled attribute is set, which it sets for all surfaces allocated via
> dri, and this "tiling" is not the same as swizzling, scanout surfaces
> must be linear / have a uniform_pitch or only complete garbage is shown.
>
> This commit fixes dri3 on nv30 showing a garbled display, with dri3 the
> scanout buffers are allocated by mesa, rather then by the ddx, and the
> wrong stride of these buffers was causing the garbled display.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> src/gallium/drivers/nouveau/nv30/nv30_miptree.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/src/gallium/drivers/nouveau/nv30/nv30_miptree.c b/src/gallium/drivers/nouveau/nv30/nv30_miptree.c
> index c75b4b9..2276347 100644
> --- a/src/gallium/drivers/nouveau/nv30/nv30_miptree.c
> +++ b/src/gallium/drivers/nouveau/nv30/nv30_miptree.c
> @@ -28,6 +28,7 @@
> #include "util/u_surface.h"
>
> #include "nv_m2mf.xml.h"
> +#include "nv_object.xml.h"
> #include "nv30/nv30_screen.h"
> #include "nv30/nv30_context.h"
> #include "nv30/nv30_resource.h"
> @@ -362,6 +363,7 @@ nv30_miptree_create(struct pipe_screen *pscreen,
> blocksz = util_format_get_blocksize(pt->format);
>
> if ((pt->target == PIPE_TEXTURE_RECT) ||
> + (pt->bind & PIPE_BIND_SCANOUT) ||
> !util_is_power_of_two(pt->width0) ||
> !util_is_power_of_two(pt->height0) ||
> !util_is_power_of_two(pt->depth0) ||
> @@ -369,6 +371,14 @@ nv30_miptree_create(struct pipe_screen *pscreen,
> util_format_is_float(pt->format) || mt->ms_mode) {
> mt->uniform_pitch = util_format_get_nblocksx(pt->format, w) * blocksz;
> mt->uniform_pitch = align(mt->uniform_pitch, 64);
> + if (pt->bind & PIPE_BIND_SCANOUT) {
> + struct nv30_screen *screen = nv30_screen(pscreen);
> + int pitch_align = MAX2(
> + screen->eng3d->oclass >= NV40_3D_CLASS ? 1024 : 256,
> + /* round_down_pow2(mt->uniform_pitch / 4) */
> + 1 << (util_last_bit(mt->uniform_pitch / 4) - 1));
> + mt->uniform_pitch = align(mt->uniform_pitch, pitch_align);
> + }
> }
>
> if (!mt->uniform_pitch)
>
I patched mesa 10.6.4 with it, did not help to solve
https://bugs.freedesktop.org/show_bug.cgi?id=90871
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
prev parent reply other threads:[~2015-08-13 13:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-12 12:24 [PATCH mesa] nv30: Fix creation of scanout buffers Hans de Goede
[not found] ` <1439382297-5647-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-08-13 13:40 ` poma [this message]
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=55CC9E56.5090903@gmail.com \
--to=pomidorabelisima-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=mesa-dev-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@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.