diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-08-20 11:06:07 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-08-21 08:40:53 -0700 |
commit | c9b623355822129a42c4a64b3310c246bf359721 (patch) | |
tree | 0c3959329ab7cc2436659d41c36e61b2a726b765 /src/panfrost/include | |
parent | 4aeb6944623fa10dc7084113283c7e58484e0d6f (diff) |
pan/decode: Validate AFBC fields are zero when AFBC is disabled
There is no "chunknown" structure; that part of the union is an artefact
from falsely believing vertex/tiler MFBDs could have render targets
attached (they can't). These are just plain old AFBC fields, and if
there is no AFBC, it's error to set these field.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost/include')
-rw-r--r-- | src/panfrost/include/panfrost-job.h | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/src/panfrost/include/panfrost-job.h b/src/panfrost/include/panfrost-job.h index e08aac9c73a..ffcfd67bab6 100644 --- a/src/panfrost/include/panfrost-job.h +++ b/src/panfrost/include/panfrost-job.h @@ -1522,27 +1522,21 @@ struct bifrost_render_target { u64 zero1; - union { - struct { - /* Stuff related to ARM Framebuffer Compression. When AFBC is enabled, - * there is an extra metadata buffer that contains 16 bytes per tile. - * The framebuffer needs to be the same size as before, since we don't - * know ahead of time how much space it will take up. The - * framebuffer_stride is set to 0, since the data isn't stored linearly - * anymore. - */ - - mali_ptr metadata; - u32 stride; // stride in units of tiles - u32 unk; // = 0x20000 - } afbc; - - struct { - /* Heck if I know */ - u64 unk; - mali_ptr pointer; - } chunknown; - }; + struct { + /* Stuff related to ARM Framebuffer Compression. When AFBC is enabled, + * there is an extra metadata buffer that contains 16 bytes per tile. + * The framebuffer needs to be the same size as before, since we don't + * know ahead of time how much space it will take up. The + * framebuffer_stride is set to 0, since the data isn't stored linearly + * anymore. + * + * When AFBC is disabled, these fields are zero. + */ + + mali_ptr metadata; + u32 stride; // stride in units of tiles + u32 unk; // = 0x20000 + } afbc; mali_ptr framebuffer; |