Skip to content

Commit 0c2192b

Browse files
njhollinghurstnaushir
authored andcommitted
Remove some unused methods.
MergeConfig() was uncalled, probably broken on BE and potentially confusing on FE now that Prepare() can modify its output config. FrontEnd::SetOutputAXI() was uncalled, and changing these settings from their defaults ought to be deprecated. (Narrowly avoided removing SetHog(), as test code still calls it.)
1 parent 6d7e77e commit 0c2192b

File tree

4 files changed

+6
-153
lines changed

4 files changed

+6
-153
lines changed

src/libpisp/backend/backend.cpp

Lines changed: 0 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -14,71 +14,6 @@
1414

1515
using namespace libpisp;
1616

17-
namespace
18-
{
19-
20-
struct config_param
21-
{
22-
uint32_t dirty_flags_bayer;
23-
uint32_t dirty_flags_rgb;
24-
uint32_t dirty_flags_extra;
25-
std::size_t offset;
26-
std::size_t size;
27-
};
28-
29-
const config_param config_map[] = {
30-
// *_dirty_flag_extra types
31-
{ 0, 0, PISP_BE_DIRTY_GLOBAL, offsetof(pisp_be_config, global), sizeof(pisp_be_global_config) },
32-
{ 0, 0, PISP_BE_DIRTY_SH_FC_COMBINE, offsetof(pisp_be_config, sh_fc_combine), sizeof(pisp_be_sh_fc_combine_config) },
33-
{ 0, 0, PISP_BE_DIRTY_CROP, offsetof(pisp_be_config, crop), sizeof(pisp_be_crop_config) },
34-
35-
// *_dirty_flags_bayer types
36-
{ PISP_BE_BAYER_ENABLE_DECOMPRESS, 0, 0, offsetof(pisp_be_config, decompress), sizeof(pisp_decompress_config) },
37-
{ PISP_BE_BAYER_ENABLE_DPC, 0, 0, offsetof(pisp_be_config, dpc), sizeof(pisp_be_dpc_config) },
38-
{ PISP_BE_BAYER_ENABLE_GEQ, 0, 0, offsetof(pisp_be_config, geq), sizeof(pisp_be_geq_config) },
39-
{ PISP_BE_BAYER_ENABLE_TDN_INPUT, 0, 0, offsetof(pisp_be_config, tdn_input_format), sizeof(pisp_image_format_config) },
40-
{ PISP_BE_BAYER_ENABLE_TDN_DECOMPRESS, 0, 0, offsetof(pisp_be_config, tdn_decompress), sizeof(pisp_decompress_config) },
41-
{ PISP_BE_BAYER_ENABLE_TDN, 0, 0, offsetof(pisp_be_config, tdn), sizeof(pisp_be_tdn_config) },
42-
{ PISP_BE_BAYER_ENABLE_TDN_COMPRESS, 0, 0, offsetof(pisp_be_config, tdn_compress), sizeof(pisp_compress_config) },
43-
{ PISP_BE_BAYER_ENABLE_TDN_OUTPUT, 0, 0, offsetof(pisp_be_config, tdn_output_format), sizeof(pisp_image_format_config) },
44-
{ PISP_BE_BAYER_ENABLE_SDN, 0, 0, offsetof(pisp_be_config, sdn), sizeof(pisp_be_sdn_config) },
45-
{ PISP_BE_BAYER_ENABLE_BLC, 0, 0, offsetof(pisp_be_config, blc), sizeof(pisp_bla_config) },
46-
{ PISP_BE_BAYER_ENABLE_STITCH_COMPRESS, 0, 0, offsetof(pisp_be_config, stitch_compress), sizeof(pisp_compress_config) },
47-
{ PISP_BE_BAYER_ENABLE_STITCH_OUTPUT, 0, 0, offsetof(pisp_be_config, stitch_output_format), sizeof(pisp_image_format_config) },
48-
{ PISP_BE_BAYER_ENABLE_STITCH_INPUT, 0, 0, offsetof(pisp_be_config, stitch_input_format), sizeof(pisp_image_format_config) },
49-
{ PISP_BE_BAYER_ENABLE_STITCH_DECOMPRESS, 0, 0, offsetof(pisp_be_config, stitch_decompress), sizeof(pisp_decompress_config) },
50-
{ PISP_BE_BAYER_ENABLE_STITCH, 0, 0, offsetof(pisp_be_config, stitch), sizeof(pisp_be_stitch_config) },
51-
{ PISP_BE_BAYER_ENABLE_LSC, 0, 0, offsetof(pisp_be_config, lsc), sizeof(pisp_be_lsc_config) },
52-
{ PISP_BE_BAYER_ENABLE_WBG, 0, 0, offsetof(pisp_be_config, wbg), sizeof(pisp_wbg_config) },
53-
{ PISP_BE_BAYER_ENABLE_CDN, 0, 0, offsetof(pisp_be_config, cdn), sizeof(pisp_be_cdn_config) },
54-
{ PISP_BE_BAYER_ENABLE_CAC, 0, 0, offsetof(pisp_be_config, cac), sizeof(pisp_be_cac_config) },
55-
{ PISP_BE_BAYER_ENABLE_DEBIN, 0, 0, offsetof(pisp_be_config, debin), sizeof(pisp_be_debin_config) },
56-
{ PISP_BE_BAYER_ENABLE_TONEMAP, 0, 0, offsetof(pisp_be_config, tonemap), sizeof(pisp_be_tonemap_config) },
57-
{ PISP_BE_BAYER_ENABLE_DEMOSAIC, 0, 0, offsetof(pisp_be_config, demosaic), sizeof(pisp_be_demosaic_config) },
58-
59-
// *_dirty_flags_rgb types
60-
{ PISP_BE_RGB_ENABLE_CCM, 0, 0, offsetof(pisp_be_config, ccm), sizeof(pisp_be_ccm_config) },
61-
{ PISP_BE_RGB_ENABLE_SAT_CONTROL, 0, 0, offsetof(pisp_be_config, sat_control), sizeof(pisp_be_sat_control_config) },
62-
{ PISP_BE_RGB_ENABLE_YCBCR, 0, 0, offsetof(pisp_be_config, ycbcr), sizeof(pisp_be_ccm_config) },
63-
{ PISP_BE_RGB_ENABLE_SHARPEN, 0, 0, offsetof(pisp_be_config, sharpen), sizeof(pisp_be_sharpen_config) },
64-
{ PISP_BE_RGB_ENABLE_FALSE_COLOUR, 0, 0, offsetof(pisp_be_config, false_colour), sizeof(pisp_be_false_colour_config) },
65-
{ PISP_BE_RGB_ENABLE_YCBCR_INVERSE, 0, 0, offsetof(pisp_be_config, ycbcr_inverse), sizeof(pisp_be_ccm_config) },
66-
{ PISP_BE_RGB_ENABLE_GAMMA, 0, 0, offsetof(pisp_be_config, gamma), sizeof(pisp_be_gamma_config) },
67-
// Output 0
68-
{ PISP_BE_RGB_ENABLE_CSC0, 0, 0, offsetof(pisp_be_config, csc), sizeof(pisp_be_ccm_config) },
69-
{ PISP_BE_RGB_ENABLE_DOWNSCALE0, 0, 0, offsetof(pisp_be_config, downscale), sizeof(pisp_be_downscale_config) },
70-
{ PISP_BE_RGB_ENABLE_RESAMPLE0, 0, 0, offsetof(pisp_be_config, resample), sizeof(pisp_be_resample_config) },
71-
{ PISP_BE_RGB_ENABLE_OUTPUT0, 0, 0, offsetof(pisp_be_config, output_format), sizeof(pisp_be_output_format_config) },
72-
{ PISP_BE_RGB_ENABLE_HOG, 0, 0, offsetof(pisp_be_config, hog), sizeof(pisp_be_hog_config) },
73-
// Output 1
74-
{ PISP_BE_RGB_ENABLE_CSC1, 0, 0, offsetof(pisp_be_config, csc) + sizeof(pisp_be_ccm_config), sizeof(pisp_be_ccm_config) },
75-
{ PISP_BE_RGB_ENABLE_DOWNSCALE1, 0, 0, offsetof(pisp_be_config, downscale) + sizeof(pisp_be_downscale_config), sizeof(pisp_be_downscale_config) },
76-
{ PISP_BE_RGB_ENABLE_RESAMPLE1, 0, 0, offsetof(pisp_be_config, resample) + sizeof(pisp_be_resample_config), sizeof(pisp_be_resample_config) },
77-
{ PISP_BE_RGB_ENABLE_OUTPUT1, 0, 0, offsetof(pisp_be_config, output_format) + sizeof(pisp_be_output_format_config), sizeof(pisp_be_output_format_config) },
78-
};
79-
80-
} // namespace
81-
8217
BackEnd::BackEnd(Config const &config, PiSPVariant const &variant)
8318
: config_(config), variant_(variant), retile_(true), finalise_tiling_(true)
8419
{
@@ -475,26 +410,6 @@ void BackEnd::GetOutputFormat(unsigned int i, pisp_be_output_format_config &outp
475410
output_format = be_config_.output_format[i];
476411
}
477412

478-
void BackEnd::MergeConfig(const pisp_be_config &config)
479-
{
480-
for (auto const &param : config_map)
481-
{
482-
if ((param.dirty_flags_bayer & config.dirty_flags_bayer) || (param.dirty_flags_rgb & config.dirty_flags_rgb) ||
483-
(param.dirty_flags_extra & config.dirty_flags_extra))
484-
{
485-
const uint8_t *src = reinterpret_cast<const uint8_t *>(&config) + param.offset;
486-
uint8_t *dest = reinterpret_cast<uint8_t *>(&be_config_) + param.offset;
487-
488-
memcpy(dest, src, param.size);
489-
be_config_.dirty_flags_bayer |= param.dirty_flags_bayer;
490-
be_config_.dirty_flags_rgb |= param.dirty_flags_rgb;
491-
be_config_.dirty_flags_extra |= param.dirty_flags_extra;
492-
// Force a retile for now. This could become more granular.
493-
retile_ = true;
494-
}
495-
}
496-
}
497-
498413
void BackEnd::SetSmartResize(unsigned int i, BackEnd::SmartResize const &smart_resize)
499414
{
500415
PISP_ASSERT(i < variant_.BackEndNumBranches(0));

src/libpisp/backend/backend.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ class BackEnd
120120
void InitialiseSharpen(pisp_be_sharpen_config &sharpen, pisp_be_sh_fc_combine_config &shfc);
121121

122122
void Prepare(pisp_be_tiles_config *config);
123-
void MergeConfig(const pisp_be_config &config);
124123

125124
bool ComputeOutputImageFormat(unsigned int i, pisp_image_format_config &output_format,
126125
pisp_image_format_config const &input_format) const;

src/libpisp/frontend/frontend.cpp

Lines changed: 6 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -18,42 +18,6 @@ using namespace libpisp;
1818
namespace
1919
{
2020

21-
struct config_param
22-
{
23-
uint32_t dirty_flag;
24-
uint32_t dirty_flag_extra;
25-
std::size_t offset;
26-
std::size_t size;
27-
};
28-
29-
const config_param config_map[] = {
30-
// *_dirty_flag_extra types
31-
{ 0, PISP_FE_DIRTY_GLOBAL, offsetof(pisp_fe_config, global), sizeof(pisp_fe_global_config) },
32-
{ 0, PISP_FE_DIRTY_FLOATING, offsetof(pisp_fe_config, floating_stats), sizeof(pisp_fe_floating_stats_config) },
33-
{ 0, PISP_FE_DIRTY_OUTPUT_AXI, offsetof(pisp_fe_config, output_axi), sizeof(pisp_fe_output_axi_config) },
34-
// *_dirty_flag types
35-
{ PISP_FE_ENABLE_INPUT, 0, offsetof(pisp_fe_config, input), sizeof(pisp_fe_input_config) },
36-
{ PISP_FE_ENABLE_DECOMPRESS, 0, offsetof(pisp_fe_config, decompress), sizeof(pisp_decompress_config) },
37-
{ PISP_FE_ENABLE_DECOMPAND, 0, offsetof(pisp_fe_config, decompand), sizeof(pisp_fe_decompand_config) },
38-
{ PISP_FE_ENABLE_BLA, 0, offsetof(pisp_fe_config, bla), sizeof(pisp_bla_config) },
39-
{ PISP_FE_ENABLE_DPC, 0, offsetof(pisp_fe_config, dpc), sizeof(pisp_fe_dpc_config) },
40-
{ PISP_FE_ENABLE_STATS_CROP, 0, offsetof(pisp_fe_config, stats_crop), sizeof(pisp_fe_crop_config) },
41-
{ PISP_FE_ENABLE_BLC, 0, offsetof(pisp_fe_config, blc), sizeof(pisp_bla_config) },
42-
{ PISP_FE_ENABLE_CDAF_STATS, 0, offsetof(pisp_fe_config, cdaf_stats), sizeof(pisp_fe_cdaf_stats_config) },
43-
{ PISP_FE_ENABLE_AWB_STATS, 0, offsetof(pisp_fe_config, awb_stats), sizeof(pisp_fe_awb_stats_config) },
44-
{ PISP_FE_ENABLE_RGBY, 0, offsetof(pisp_fe_config, rgby), sizeof(pisp_fe_rgby_config) },
45-
{ PISP_FE_ENABLE_LSC, 0, offsetof(pisp_fe_config, lsc), sizeof(pisp_fe_lsc_config) },
46-
{ PISP_FE_ENABLE_AGC_STATS, 0, offsetof(pisp_fe_config, agc_stats), sizeof(pisp_agc_statistics) },
47-
{ PISP_FE_ENABLE_CROP0, 0, offsetof(pisp_fe_config, ch[0].crop), sizeof(pisp_fe_crop_config) },
48-
{ PISP_FE_ENABLE_DOWNSCALE0, 0, offsetof(pisp_fe_config, ch[0].downscale), sizeof(pisp_fe_downscale_config) },
49-
{ PISP_FE_ENABLE_COMPRESS0, 0, offsetof(pisp_fe_config, ch[0].compress), sizeof(pisp_compress_config) },
50-
{ PISP_FE_ENABLE_OUTPUT0, 0, offsetof(pisp_fe_config, ch[0].output), sizeof(pisp_fe_output_config) },
51-
{ PISP_FE_ENABLE_CROP1, 0, offsetof(pisp_fe_config, ch[1].crop), sizeof(pisp_fe_crop_config) },
52-
{ PISP_FE_ENABLE_DOWNSCALE1, 0, offsetof(pisp_fe_config, ch[1].downscale), sizeof(pisp_fe_downscale_config) },
53-
{ PISP_FE_ENABLE_COMPRESS1, 0, offsetof(pisp_fe_config, ch[1].compress), sizeof(pisp_compress_config) },
54-
{ PISP_FE_ENABLE_OUTPUT1, 0, offsetof(pisp_fe_config, ch[1].output), sizeof(pisp_fe_output_config) },
55-
};
56-
5721
inline uint32_t block_enable(uint32_t block, unsigned int branch)
5822
{
5923
return block << (4 * branch);
@@ -219,13 +183,12 @@ FrontEnd::FrontEnd(bool streaming, PiSPVariant const &variant, int align) : vari
219183
}
220184
else
221185
{
222-
pisp_fe_output_axi_config output_axi;
223-
output_axi.maxlen_flags = 0xaf;
224-
output_axi.cache_prot = 0x32;
225-
output_axi.qos = 0x8410;
226-
output_axi.thresh = 0x0140;
227-
output_axi.throttle = 0x4100;
228-
SetOutputAXI(output_axi);
186+
fe_config_.output_axi.maxlen_flags = 0xaf;
187+
fe_config_.output_axi.cache_prot = 0x32;
188+
fe_config_.output_axi.qos = 0x8410;
189+
fe_config_.output_axi.thresh = 0x0140;
190+
fe_config_.output_axi.throttle = 0x4100;
191+
fe_config_.dirty_flags_extra |= PISP_FE_DIRTY_OUTPUT_AXI;
229192
}
230193

231194
pisp_fe_global_config global;
@@ -395,28 +358,6 @@ void FrontEnd::SetOutputBuffer(unsigned int output_num, pisp_fe_output_buffer_co
395358
// Assume these always get written.
396359
}
397360

398-
void FrontEnd::SetOutputAXI(pisp_fe_output_axi_config const &output_axi)
399-
{
400-
fe_config_.output_axi = output_axi;
401-
fe_config_.dirty_flags_extra |= PISP_FE_DIRTY_OUTPUT_AXI;
402-
}
403-
404-
void FrontEnd::MergeConfig(const pisp_fe_config &config)
405-
{
406-
for (auto const &param : config_map)
407-
{
408-
if ((param.dirty_flag & config.dirty_flags) || (param.dirty_flag_extra & config.dirty_flags_extra))
409-
{
410-
const uint8_t *src = reinterpret_cast<const uint8_t *>(&config) + param.offset;
411-
uint8_t *dest = reinterpret_cast<uint8_t *>(&fe_config_) + param.offset;
412-
413-
memcpy(dest, src, param.size);
414-
fe_config_.dirty_flags |= param.dirty_flag;
415-
fe_config_.dirty_flags_extra |= param.dirty_flag_extra;
416-
}
417-
}
418-
}
419-
420361
void FrontEnd::Prepare(pisp_fe_config *config)
421362
{
422363
// Only finalise blocks that are dirty *and* enabled.

src/libpisp/frontend/frontend.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ class FrontEnd
5353
void SetOutputFormat(unsigned int output_num, pisp_image_format_config const &output_format);
5454
void SetOutputBuffer(unsigned int output_num, pisp_fe_output_buffer_config const &output_buffer);
5555
void SetOutputIntrLines(unsigned int output_num, int lines);
56-
void SetOutputAXI(pisp_fe_output_axi_config const &output_axi);
57-
void MergeConfig(const pisp_fe_config &config);
5856
void Prepare(pisp_fe_config *config);
5957

6058
void lock()

0 commit comments

Comments
 (0)