mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 02:48:06 +02:00
panfrost: Support parameter queries for main planes
In order to return correct offsets, strides and possibly other
parameters. This is relevant for formats like NV12 and P010 where
the second plane, when produced by the V4L2 decoder, uses the
same FD like the first one, but with an offset.
Analogous to 7a7e577d.
Also use the new helper to get the number of planes.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10094
Cc: mesa-stable
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26109>
This commit is contained in:
parent
d679154dc0
commit
5f4253e096
1 changed files with 4 additions and 11 deletions
|
|
@ -41,6 +41,7 @@
|
|||
#include "util/u_drm.h"
|
||||
#include "util/u_gen_mipmap.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "util/u_resource.h"
|
||||
#include "util/u_surface.h"
|
||||
#include "util/u_transfer.h"
|
||||
#include "util/u_transfer_helper.h"
|
||||
|
|
@ -219,9 +220,8 @@ panfrost_resource_get_param(struct pipe_screen *pscreen,
|
|||
enum pipe_resource_param param, unsigned usage,
|
||||
uint64_t *value)
|
||||
{
|
||||
struct panfrost_resource *rsrc = (struct panfrost_resource *)prsc;
|
||||
struct pipe_resource *cur;
|
||||
unsigned count;
|
||||
struct panfrost_resource *rsrc =
|
||||
(struct panfrost_resource *)util_resource_at_index(prsc, plane);
|
||||
|
||||
switch (param) {
|
||||
case PIPE_RESOURCE_PARAM_STRIDE:
|
||||
|
|
@ -234,14 +234,7 @@ panfrost_resource_get_param(struct pipe_screen *pscreen,
|
|||
*value = rsrc->image.layout.modifier;
|
||||
return true;
|
||||
case PIPE_RESOURCE_PARAM_NPLANES:
|
||||
/* Panfrost doesn't directly support multi-planar formats,
|
||||
* but we should still handle this case for gbm users
|
||||
* that might want to use resources shared with panfrost
|
||||
* on video processing hardware that does.
|
||||
*/
|
||||
for (count = 0, cur = prsc; cur; cur = cur->next)
|
||||
count++;
|
||||
*value = count;
|
||||
*value = util_resource_num(prsc);
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue