X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fpanfrost%2Finclude%2Fpanfrost-job.h;h=d9a3fe9327e9874379e532f072947c704330a72a;hb=fd81916ee5d9336e81d9f7598dc1c98b715f3358;hp=17ea869246e1285209dee60c9187c3464ae41841;hpb=fa14cdf6e488cc14ca5953389bbdba3b0b27daf6;p=mesa.git diff --git a/src/panfrost/include/panfrost-job.h b/src/panfrost/include/panfrost-job.h index 17ea869246e..d9a3fe9327e 100644 --- a/src/panfrost/include/panfrost-job.h +++ b/src/panfrost/include/panfrost-job.h @@ -31,14 +31,6 @@ #include #include -#define MALI_SHORT_PTR_BITS (sizeof(u64)*8) - -#define MALI_FBD_HIERARCHY_WEIGHTS 8 - -#define MALI_PAYLOAD_SIZE 256 - -typedef u32 mali_jd_core_req; - enum mali_job_type { JOB_NOT_STARTED = 0, JOB_TYPE_NULL = 1, @@ -70,7 +62,6 @@ enum mali_draw_mode { /* Applies to tiler_gl_enables */ - #define MALI_OCCLUSION_QUERY (1 << 3) #define MALI_OCCLUSION_PRECISE (1 << 4) @@ -78,20 +69,12 @@ enum mali_draw_mode { * In OpenGL, this would corresponds to glFrontFace(GL_CW). Mesa and the blob * disagree about how to do viewport flipping, so the blob actually sets this * for GL_CW but then has a negative viewport stride */ + #define MALI_FRONT_CCW_TOP (1 << 5) #define MALI_CULL_FACE_FRONT (1 << 6) #define MALI_CULL_FACE_BACK (1 << 7) -/* TODO: Might this actually be a finer bitfield? */ -#define MALI_DEPTH_STENCIL_ENABLE 0x6400 - -#define DS_ENABLE(field) \ - (field == MALI_DEPTH_STENCIL_ENABLE) \ - ? "MALI_DEPTH_STENCIL_ENABLE" \ - : (field == 0) ? "0" \ - : "0 /* XXX: Unknown, check hexdump */" - /* Used in stencil and depth tests */ enum mali_func { @@ -131,7 +114,7 @@ enum mali_alt_func { #define MALI_GET_DEPTH_FUNC(flags) ((flags >> 8) & 0x7) #define MALI_DEPTH_FUNC_MASK MALI_DEPTH_FUNC(0x7) -#define MALI_DEPTH_TEST (1 << 11) +#define MALI_DEPTH_WRITEMASK (1 << 11) /* Next flags to unknown2_4 */ #define MALI_STENCIL_TEST (1 << 0) @@ -434,6 +417,14 @@ union midgard_blend { }; }; +/* We need to load the tilebuffer to blend (i.e. the destination factor is not + * ZERO) */ + +#define MALI_BLEND_LOAD_TIB (0x1) + +/* A blend shader is used to blend this render target */ +#define MALI_BLEND_MRT_SHADER (0x2) + /* On MRT Midgard systems (using an MFBD), each render target gets its own * blend descriptor */ @@ -1382,9 +1373,10 @@ struct mali_payload_fragment { /* Flags apply to format. With just MSAA_A and MSAA_B, the framebuffer is * configured for 4x. With MSAA_8, it is configured for 8x. */ -#define MALI_FRAMEBUFFER_MSAA_8 (1 << 3) -#define MALI_FRAMEBUFFER_MSAA_A (1 << 4) -#define MALI_FRAMEBUFFER_MSAA_B (1 << 23) +#define MALI_SFBD_FORMAT_MSAA_8 (1 << 3) +#define MALI_SFBD_FORMAT_MSAA_A (1 << 4) +#define MALI_SFBD_FORMAT_MSAA_B (1 << 4) +#define MALI_SFBD_FORMAT_SRGB (1 << 5) /* Fast/slow based on whether all three buffers are cleared at once */ @@ -1434,6 +1426,32 @@ struct midgard_tiler_descriptor { u32 weights[8]; }; +enum mali_block_format { + MALI_BLOCK_TILED = 0x0, + MALI_BLOCK_UNKNOWN = 0x1, + MALI_BLOCK_LINEAR = 0x2, + MALI_BLOCK_AFBC = 0x3, +}; + +struct mali_sfbd_format { + /* 0x1 */ + unsigned unk1 : 6; + + /* mali_channel_swizzle */ + unsigned swizzle : 12; + + /* MALI_POSITIVE */ + unsigned nr_channels : 2; + + /* 0x4 */ + unsigned unk2 : 6; + + enum mali_block_format block : 2; + + /* 0xb */ + unsigned unk3 : 4; +}; + struct mali_single_framebuffer { u32 unknown1; u32 unknown2; @@ -1441,10 +1459,7 @@ struct mali_single_framebuffer { u64 zero1; u64 zero0; - /* Exact format is ironically not known, since EGL is finnicky with the - * blob. MSAA, colourspace, etc are configured here. */ - - u32 format; + struct mali_sfbd_format format; u32 clear_flags; u32 zero2; @@ -1455,7 +1470,10 @@ struct mali_single_framebuffer { u16 width; u16 height; - u32 zero3[8]; + u32 zero3[4]; + mali_ptr checksum; + u32 checksum_stride; + u32 zero5; /* By default, the framebuffer is upside down from OpenGL's * perspective. Set framebuffer to the end and negate the stride to @@ -1473,10 +1491,14 @@ struct mali_single_framebuffer { * disabled. */ mali_ptr depth_buffer; // not SAME_VA - u64 depth_buffer_enable; + u32 depth_stride_zero : 4; + u32 depth_stride : 28; + u32 zero7; mali_ptr stencil_buffer; // not SAME_VA - u64 stencil_buffer_enable; + u32 stencil_stride_zero : 4; + u32 stencil_stride : 28; + u32 zero8; u32 clear_color_1; // RGBA8888 from glClear, actually used by hardware u32 clear_color_2; // always equal, but unclear function? @@ -1511,13 +1533,6 @@ struct mali_compute_fbd { #define MALI_MFBD_FORMAT_MSAA (1 << 1) #define MALI_MFBD_FORMAT_SRGB (1 << 2) -enum mali_mfbd_block_format { - MALI_MFBD_BLOCK_TILED = 0x0, - MALI_MFBD_BLOCK_UNKNOWN = 0x1, - MALI_MFBD_BLOCK_LINEAR = 0x2, - MALI_MFBD_BLOCK_AFBC = 0x3, -}; - struct mali_rt_format { unsigned unk1 : 32; unsigned unk2 : 3; @@ -1525,7 +1540,7 @@ struct mali_rt_format { unsigned nr_channels : 2; /* MALI_POSITIVE */ unsigned unk3 : 5; - enum mali_mfbd_block_format block : 2; + enum mali_block_format block : 2; unsigned flags : 4; unsigned swizzle : 12;