summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost/pan_sfbd.c
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-05-23 03:01:32 +0000
committerAlyssa Rosenzweig <[email protected]>2019-06-05 14:35:48 -0700
commit2adf35e4f50e0d8439ee12151bbb65427335625e (patch)
tree4d8e3ee80241d51ecdc65c4fd6f1f582ec7bf7d0 /src/gallium/drivers/panfrost/pan_sfbd.c
parentc94b70a1781b8fb65be24b7e3a72462426cd86c4 (diff)
panfrost: Don't flip scanout
The mesa/st flips the viewport, so we respect that rather than trying to flip the framebuffer itself and ignoring the viewport and using a messy heuristic. However, this brings an underlying disagreement about the interpretation of winding order to light. The blob uses a different strategy than Mesa for handling viewport Y flipping, so the meanings of the winding order bit are flipped for it. To keep things clean on our end, we rename to explicitly use Gallium (rather than flipped OpenGL) conventions. Fixes upside-down Xwayland/egl windows. v2: Adjust lowering configuration to correctly flip gl_PointCoord.y and gl_FragCoord.y. v1 was R-b'd by Tomeu, but then retracted due to these regressions which are not fixed. Suggested-by: Rob Clark <[email protected]> Signed-off-by: Alyssa Rosenzweig <[email protected]> Sort-of-reviewed-by: Tomeu Vizoso <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost/pan_sfbd.c')
-rw-r--r--src/gallium/drivers/panfrost/pan_sfbd.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/gallium/drivers/panfrost/pan_sfbd.c b/src/gallium/drivers/panfrost/pan_sfbd.c
index 4235c198199..6989cd925a8 100644
--- a/src/gallium/drivers/panfrost/pan_sfbd.c
+++ b/src/gallium/drivers/panfrost/pan_sfbd.c
@@ -87,8 +87,7 @@ panfrost_sfbd_clear(
static void
panfrost_sfbd_set_cbuf(
struct mali_single_framebuffer *fb,
- struct pipe_surface *surf,
- bool flip_y)
+ struct pipe_surface *surf)
{
struct panfrost_resource *rsrc = pan_resource(surf->texture);
@@ -97,15 +96,7 @@ panfrost_sfbd_set_cbuf(
fb->format = panfrost_sfbd_format(surf);
if (rsrc->bo->layout == PAN_LINEAR) {
- mali_ptr framebuffer = rsrc->bo->gpu;
-
- /* The default is upside down from OpenGL's perspective. */
- if (flip_y) {
- framebuffer += stride * (surf->texture->height0 - 1);
- stride = -stride;
- }
-
- fb->framebuffer = framebuffer;
+ fb->framebuffer = rsrc->bo->gpu;
fb->stride = stride;
} else {
fprintf(stderr, "Invalid render layout\n");
@@ -116,7 +107,7 @@ panfrost_sfbd_set_cbuf(
/* Creates an SFBD for the FRAGMENT section of the bound framebuffer */
mali_ptr
-panfrost_sfbd_fragment(struct panfrost_context *ctx, bool flip_y)
+panfrost_sfbd_fragment(struct panfrost_context *ctx)
{
struct panfrost_job *job = panfrost_get_job_for_fbo(ctx);
struct mali_single_framebuffer fb = panfrost_emit_sfbd(ctx);
@@ -125,7 +116,7 @@ panfrost_sfbd_fragment(struct panfrost_context *ctx, bool flip_y)
/* SFBD does not support MRT natively; sanity check */
assert(ctx->pipe_framebuffer.nr_cbufs == 1);
- panfrost_sfbd_set_cbuf(&fb, ctx->pipe_framebuffer.cbufs[0], flip_y);
+ panfrost_sfbd_set_cbuf(&fb, ctx->pipe_framebuffer.cbufs[0]);
if (ctx->pipe_framebuffer.zsbuf) {
/* TODO */