Common code will soon call job-frontend specific helpers for anything
that's not common to CSF/JM. Let's provide a JOBX() macro that does
the correct prefixing based on the PAN_ARCH value.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
Before we start adding CSF support, let's move every JM-specific bits
out of pan_cmdstream.c.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
In order to be able to split the code into separate files, we need to
share some common definitions. Create a pan_cmdstream.h file containing
some structs and helpers.
This file is meant to be included from per-gen source files.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
Prefix them with jm_ so we can easily specialize things for CSF.
panfrost_batch_submit_ioctl is renamed into jm_submit_jc() which
reflects the fact the ioctl() submits one job chain at a time, and
panfrost_batch_submit_jobs() is renamed jm_submit_batch() because it's
shorter and is descriptive enough.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
This function is JM-specific, let's prefix it accordingly.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
Prefix with jm_ so we know this is JM-specific, and emit_shader_env()
to make it clear this is the shader environment descriptor we
emit here.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
Tiler descriptor emission will be different on CSF, so let's just
prefix the function with jm_, and pick a shorter name without bifrost
in it (the function is already conditionally defined if PAN_ARCH >= 6,
which means bifrost or later).
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
We always pass a non-zero vertex_count. Let's get rid of this argument
and unconditionally emit the heap descriptor.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
Create a jm_launch_xfb() helper that's called from panfrost_launch_xfb()
so we can later specialize things for CSF.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
Create a jm_luanch_grid() helper that's called from
panfrost_launch_grid_on_batch() so we can later specialize things for
CSF.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
This seems a bit silly, but is needed if we want to move JM/CSF job
emission to their own file without having to pull the
panfrost_emit_shared_memory() function there. It also allows us to
get rid of the thread_storage argument passed to panfrost_emit_shader().
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
Add a jm_launch_draw() helper taking care of the JM descriptor emission,
and call it from panfrost_direct_draw().
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
Re-order things in panfrost_direct_draw() so we have all non-HW specific
stuff done first, and then the descriptor emission.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
Makes panfrost_direct_draw() shorter and thus easier to read.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
Not strictly needed for CSF, but anything we can do to make
panfrost_direct_draw() shorter is good to take.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
First of all, we want to prefix those with jm_, so we can later add
CSF-specific job emission helpers. We also take this as an opportunity
to clarify what these helpers emit exactly: the draw section of a job
descriptor (suffixed with _draw) or the job descriptor itself (suffixed
with _job).
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
Add a jm_emit_fragment_job() helper that does the fragment job emission
so we can re-use the rest of emit_fragment_job() for CSF too.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
Prefix the function with jm_, so it's clear its JM-specific helper.
While at it, replace emit by push, since the descriptor emission
happens before that, all this function does is pushing jobs to the
job chain.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
In preparation of CSF support addition, we move any JM related bits out
of panfrost_batch into a panfrost_jm_batch struct that's embedded in
panfrost_batch inside an anonymous union. This way, we can easily
specialize things for CSF without polluting the panfrost_batch object
with CSF-specific fields.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
We will use those when adding CSF support.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
We will use the new panfrost_vertex_attribute_stride() when adding CSF
support.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
Factor out the logic so we can use the helper when adding CSF support.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>