1 /* SPDX-License-Identifier: GPL-2.0-only OR MIT */ 2 /* Copyright (c) 2023 Imagination Technologies Ltd. */ 3 4 #ifndef PVR_ROGUE_FWIF_CLIENT_CHECK_H 5 #define PVR_ROGUE_FWIF_CLIENT_CHECK_H 6 7 #include <linux/build_bug.h> 8 9 #define OFFSET_CHECK(type, member, offset) \ 10 static_assert(offsetof(type, member) == (offset), \ 11 "offsetof(" #type ", " #member ") incorrect") 12 13 #define SIZE_CHECK(type, size) \ 14 static_assert(sizeof(type) == (size), #type " is incorrect size") 15 16 OFFSET_CHECK(struct rogue_fwif_geom_regs, vdm_ctrl_stream_base, 0); 17 OFFSET_CHECK(struct rogue_fwif_geom_regs, tpu_border_colour_table, 8); 18 OFFSET_CHECK(struct rogue_fwif_geom_regs, vdm_draw_indirect0, 16); 19 OFFSET_CHECK(struct rogue_fwif_geom_regs, vdm_draw_indirect1, 24); 20 OFFSET_CHECK(struct rogue_fwif_geom_regs, ppp_ctrl, 28); 21 OFFSET_CHECK(struct rogue_fwif_geom_regs, te_psg, 32); 22 OFFSET_CHECK(struct rogue_fwif_geom_regs, tpu, 36); 23 OFFSET_CHECK(struct rogue_fwif_geom_regs, vdm_context_resume_task0_size, 40); 24 OFFSET_CHECK(struct rogue_fwif_geom_regs, vdm_context_resume_task3_size, 44); 25 OFFSET_CHECK(struct rogue_fwif_geom_regs, pds_ctrl, 48); 26 OFFSET_CHECK(struct rogue_fwif_geom_regs, view_idx, 52); 27 OFFSET_CHECK(struct rogue_fwif_geom_regs, pds_coeff_free_prog, 56); 28 SIZE_CHECK(struct rogue_fwif_geom_regs, 64); 29 30 OFFSET_CHECK(struct rogue_fwif_dummy_rgnhdr_init_geom_regs, te_psgregion_addr, 0); 31 SIZE_CHECK(struct rogue_fwif_dummy_rgnhdr_init_geom_regs, 8); 32 33 OFFSET_CHECK(struct rogue_fwif_cmd_geom, cmd_shared, 0); 34 OFFSET_CHECK(struct rogue_fwif_cmd_geom, regs, 16); 35 OFFSET_CHECK(struct rogue_fwif_cmd_geom, flags, 80); 36 OFFSET_CHECK(struct rogue_fwif_cmd_geom, partial_render_geom_frag_fence, 84); 37 OFFSET_CHECK(struct rogue_fwif_cmd_geom, dummy_rgnhdr_init_geom_regs, 96); 38 OFFSET_CHECK(struct rogue_fwif_cmd_geom, brn61484_66333_live_rt, 104); 39 SIZE_CHECK(struct rogue_fwif_cmd_geom, 112); 40 41 OFFSET_CHECK(struct rogue_fwif_frag_regs, usc_pixel_output_ctrl, 0); 42 OFFSET_CHECK(struct rogue_fwif_frag_regs, usc_clear_register, 4); 43 OFFSET_CHECK(struct rogue_fwif_frag_regs, isp_bgobjdepth, 36); 44 OFFSET_CHECK(struct rogue_fwif_frag_regs, isp_bgobjvals, 40); 45 OFFSET_CHECK(struct rogue_fwif_frag_regs, isp_aa, 44); 46 OFFSET_CHECK(struct rogue_fwif_frag_regs, isp_xtp_pipe_enable, 48); 47 OFFSET_CHECK(struct rogue_fwif_frag_regs, isp_ctl, 52); 48 OFFSET_CHECK(struct rogue_fwif_frag_regs, tpu, 56); 49 OFFSET_CHECK(struct rogue_fwif_frag_regs, event_pixel_pds_info, 60); 50 OFFSET_CHECK(struct rogue_fwif_frag_regs, pixel_phantom, 64); 51 OFFSET_CHECK(struct rogue_fwif_frag_regs, view_idx, 68); 52 OFFSET_CHECK(struct rogue_fwif_frag_regs, event_pixel_pds_data, 72); 53 OFFSET_CHECK(struct rogue_fwif_frag_regs, brn65101_event_pixel_pds_data, 76); 54 OFFSET_CHECK(struct rogue_fwif_frag_regs, isp_oclqry_stride, 80); 55 OFFSET_CHECK(struct rogue_fwif_frag_regs, isp_zls_pixels, 84); 56 OFFSET_CHECK(struct rogue_fwif_frag_regs, rgx_cr_blackpearl_fix, 88); 57 OFFSET_CHECK(struct rogue_fwif_frag_regs, isp_scissor_base, 96); 58 OFFSET_CHECK(struct rogue_fwif_frag_regs, isp_dbias_base, 104); 59 OFFSET_CHECK(struct rogue_fwif_frag_regs, isp_oclqry_base, 112); 60 OFFSET_CHECK(struct rogue_fwif_frag_regs, isp_zlsctl, 120); 61 OFFSET_CHECK(struct rogue_fwif_frag_regs, isp_zload_store_base, 128); 62 OFFSET_CHECK(struct rogue_fwif_frag_regs, isp_stencil_load_store_base, 136); 63 OFFSET_CHECK(struct rogue_fwif_frag_regs, fb_cdc_zls, 144); 64 OFFSET_CHECK(struct rogue_fwif_frag_regs, pbe_word, 152); 65 OFFSET_CHECK(struct rogue_fwif_frag_regs, tpu_border_colour_table, 344); 66 OFFSET_CHECK(struct rogue_fwif_frag_regs, pds_bgnd, 352); 67 OFFSET_CHECK(struct rogue_fwif_frag_regs, pds_bgnd_brn65101, 376); 68 OFFSET_CHECK(struct rogue_fwif_frag_regs, pds_pr_bgnd, 400); 69 OFFSET_CHECK(struct rogue_fwif_frag_regs, isp_dummy_stencil_store_base, 424); 70 OFFSET_CHECK(struct rogue_fwif_frag_regs, isp_dummy_depth_store_base, 432); 71 OFFSET_CHECK(struct rogue_fwif_frag_regs, rgnhdr_single_rt_size, 440); 72 OFFSET_CHECK(struct rogue_fwif_frag_regs, rgnhdr_scratch_offset, 444); 73 SIZE_CHECK(struct rogue_fwif_frag_regs, 448); 74 75 OFFSET_CHECK(struct rogue_fwif_cmd_frag, cmd_shared, 0); 76 OFFSET_CHECK(struct rogue_fwif_cmd_frag, regs, 16); 77 OFFSET_CHECK(struct rogue_fwif_cmd_frag, flags, 464); 78 OFFSET_CHECK(struct rogue_fwif_cmd_frag, zls_stride, 468); 79 OFFSET_CHECK(struct rogue_fwif_cmd_frag, sls_stride, 472); 80 OFFSET_CHECK(struct rogue_fwif_cmd_frag, execute_count, 476); 81 SIZE_CHECK(struct rogue_fwif_cmd_frag, 480); 82 83 OFFSET_CHECK(struct rogue_fwif_compute_regs, tpu_border_colour_table, 0); 84 OFFSET_CHECK(struct rogue_fwif_compute_regs, cdm_cb_queue, 8); 85 OFFSET_CHECK(struct rogue_fwif_compute_regs, cdm_cb_base, 16); 86 OFFSET_CHECK(struct rogue_fwif_compute_regs, cdm_cb, 24); 87 OFFSET_CHECK(struct rogue_fwif_compute_regs, cdm_ctrl_stream_base, 32); 88 OFFSET_CHECK(struct rogue_fwif_compute_regs, cdm_context_state_base_addr, 40); 89 OFFSET_CHECK(struct rogue_fwif_compute_regs, tpu, 48); 90 OFFSET_CHECK(struct rogue_fwif_compute_regs, cdm_resume_pds1, 52); 91 OFFSET_CHECK(struct rogue_fwif_compute_regs, cdm_item, 56); 92 OFFSET_CHECK(struct rogue_fwif_compute_regs, compute_cluster, 60); 93 OFFSET_CHECK(struct rogue_fwif_compute_regs, tpu_tag_cdm_ctrl, 64); 94 SIZE_CHECK(struct rogue_fwif_compute_regs, 72); 95 96 OFFSET_CHECK(struct rogue_fwif_cmd_compute, common, 0); 97 OFFSET_CHECK(struct rogue_fwif_cmd_compute, regs, 8); 98 OFFSET_CHECK(struct rogue_fwif_cmd_compute, flags, 80); 99 OFFSET_CHECK(struct rogue_fwif_cmd_compute, num_temp_regions, 84); 100 OFFSET_CHECK(struct rogue_fwif_cmd_compute, stream_start_offset, 88); 101 OFFSET_CHECK(struct rogue_fwif_cmd_compute, execute_count, 92); 102 SIZE_CHECK(struct rogue_fwif_cmd_compute, 96); 103 104 OFFSET_CHECK(struct rogue_fwif_transfer_regs, isp_bgobjvals, 0); 105 OFFSET_CHECK(struct rogue_fwif_transfer_regs, usc_pixel_output_ctrl, 4); 106 OFFSET_CHECK(struct rogue_fwif_transfer_regs, usc_clear_register0, 8); 107 OFFSET_CHECK(struct rogue_fwif_transfer_regs, usc_clear_register1, 12); 108 OFFSET_CHECK(struct rogue_fwif_transfer_regs, usc_clear_register2, 16); 109 OFFSET_CHECK(struct rogue_fwif_transfer_regs, usc_clear_register3, 20); 110 OFFSET_CHECK(struct rogue_fwif_transfer_regs, isp_mtile_size, 24); 111 OFFSET_CHECK(struct rogue_fwif_transfer_regs, isp_render_origin, 28); 112 OFFSET_CHECK(struct rogue_fwif_transfer_regs, isp_ctl, 32); 113 OFFSET_CHECK(struct rogue_fwif_transfer_regs, isp_xtp_pipe_enable, 36); 114 OFFSET_CHECK(struct rogue_fwif_transfer_regs, isp_aa, 40); 115 OFFSET_CHECK(struct rogue_fwif_transfer_regs, event_pixel_pds_info, 44); 116 OFFSET_CHECK(struct rogue_fwif_transfer_regs, event_pixel_pds_code, 48); 117 OFFSET_CHECK(struct rogue_fwif_transfer_regs, event_pixel_pds_data, 52); 118 OFFSET_CHECK(struct rogue_fwif_transfer_regs, isp_render, 56); 119 OFFSET_CHECK(struct rogue_fwif_transfer_regs, isp_rgn, 60); 120 OFFSET_CHECK(struct rogue_fwif_transfer_regs, frag_screen, 64); 121 OFFSET_CHECK(struct rogue_fwif_transfer_regs, pds_bgnd0_base, 72); 122 OFFSET_CHECK(struct rogue_fwif_transfer_regs, pds_bgnd1_base, 80); 123 OFFSET_CHECK(struct rogue_fwif_transfer_regs, pds_bgnd3_sizeinfo, 88); 124 OFFSET_CHECK(struct rogue_fwif_transfer_regs, isp_mtile_base, 96); 125 OFFSET_CHECK(struct rogue_fwif_transfer_regs, pbe_wordx_mrty, 104); 126 SIZE_CHECK(struct rogue_fwif_transfer_regs, 176); 127 128 OFFSET_CHECK(struct rogue_fwif_cmd_transfer, common, 0); 129 OFFSET_CHECK(struct rogue_fwif_cmd_transfer, regs, 8); 130 OFFSET_CHECK(struct rogue_fwif_cmd_transfer, flags, 184); 131 SIZE_CHECK(struct rogue_fwif_cmd_transfer, 192); 132 133 #endif /* PVR_ROGUE_FWIF_CLIENT_CHECK_H */ 134