Skip to content

Commit

Permalink
wip: Support new DRM UAPI v2
Browse files Browse the repository at this point in the history
Add initial support for the work-in-progress new DRM UAPI v2.
  • Loading branch information
digetx committed Feb 7, 2020
1 parent 036fb9a commit 0821a85
Show file tree
Hide file tree
Showing 7 changed files with 256 additions and 129 deletions.
8 changes: 4 additions & 4 deletions src/host1x-gr2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ int host1x_gr2d_clear_rect(struct tegra_stream *stream,
if (err)
return err;

err = tegra_stream_flush(stream);
err = tegra_stream_flush(stream, true);
if (err)
return err;

Expand Down Expand Up @@ -204,7 +204,7 @@ int host1x_gr2d_clear_rect_clipped(struct tegra_stream *stream,
if (err)
return err;

err = tegra_stream_flush(stream);
err = tegra_stream_flush(stream, true);
if (err)
return err;

Expand Down Expand Up @@ -444,7 +444,7 @@ int host1x_gr2d_blit(struct tegra_stream *stream,
if (err)
return err;

err = tegra_stream_flush(stream);
err = tegra_stream_flush(stream, true);
if (err)
return err;

Expand Down Expand Up @@ -705,7 +705,7 @@ int host1x_gr2d_surface_blit(struct tegra_stream *stream,
if (err)
return err;

err = tegra_stream_flush(stream);
err = tegra_stream_flush(stream, true);
if (err)
return err;

Expand Down
4 changes: 2 additions & 2 deletions src/host1x-gr3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ void host1x_gr3d_draw_primitives(struct tegra_stream *cmds,
* XXX: This requires proper waitcheck barrier, expect graphical
* glitches due to not properly prefetched vertex / tex data.
*/
tegra_stream_sync(cmds, DRM_TEGRA_SYNCPT_COND_RD_DONE);
tegra_stream_sync(cmds, DRM_TEGRA_SYNCPT_COND_RD_DONE, true);

tegra_stream_prep(cmds, 2);

Expand All @@ -520,7 +520,7 @@ void host1x_gr3d_draw_primitives(struct tegra_stream *cmds,
tegra_stream_push(cmds, HOST1X_OPCODE_INCR(TGR3D_DRAW_PRIMITIVES, 1));
tegra_stream_push(cmds, value);

tegra_stream_sync(cmds, DRM_TEGRA_SYNCPT_COND_OP_DONE);
tegra_stream_sync(cmds, DRM_TEGRA_SYNCPT_COND_OP_DONE, true);
}

static void host1x_gr3d_upload_program(struct tegra_stream *cmds,
Expand Down
1 change: 1 addition & 0 deletions src/host1x.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#define HOST1X_OPCODE_EXTEND(subop, value) \
((0xe << 28) | (((subop) & 0xf) << 24) | ((value) & 0xffffff))

#define HOST1X_CLASS_HOST1X 0x01
#define HOST1X_CLASS_GR2D 0x51
#define HOST1X_CLASS_GR2D_SB 0x52
#define HOST1X_CLASS_GR3D 0x60
Expand Down
8 changes: 4 additions & 4 deletions src/surface.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,8 @@ tegra_surface *alloc_surface(tegra_device *dev,
}
}

tegra_stream_init(dev->drm, dev->gr3d, &surf->stream_3d, 0);
tegra_stream_init(dev->drm, dev->gr2d, &surf->stream_2d, 0);
tegra_stream_create(&surf->stream_3d, dev);
tegra_stream_create(&surf->stream_2d, dev);
ref_device(dev);

return surf;
Expand Down Expand Up @@ -614,8 +614,8 @@ VdpStatus unref_surface(tegra_surface *surf)
DebugMsg("surface %u %p\n", surf->surface_id, surf);

dynamic_release_surface_data(surf);
tegra_stream_release(&surf->stream_3d);
tegra_stream_release(&surf->stream_2d);
tegra_stream_destroy(&surf->stream_3d);
tegra_stream_destroy(&surf->stream_2d);
unref_device(surf->dev);

set_surface(surf->surface_id, NULL);
Expand Down
2 changes: 1 addition & 1 deletion src/surface_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ static int blend_surface(tegra_device *dev,
goto out_unref;
}

err = tegra_stream_flush(stream);
err = tegra_stream_flush(stream, false);
if (err) {
goto out_unref;
}
Expand Down
Loading

0 comments on commit 0821a85

Please sign in to comment.