.. | .. |
---|
46 | 46 | return feature; |
---|
47 | 47 | } |
---|
48 | 48 | |
---|
| 49 | +static bool rga_check_csc_constant(const struct rga_hw_data *data, struct rga_req *rga_base, |
---|
| 50 | + uint32_t mode, uint32_t flag) |
---|
| 51 | +{ |
---|
| 52 | + if (mode & flag) |
---|
| 53 | + return true; |
---|
| 54 | + |
---|
| 55 | + if ((rga_base->full_csc.flag & 0x1) && (data->feature & RGA_FULL_CSC)) |
---|
| 56 | + return true; |
---|
| 57 | + |
---|
| 58 | + return false; |
---|
| 59 | +} |
---|
| 60 | + |
---|
| 61 | +static bool rga_check_csc(const struct rga_hw_data *data, struct rga_req *rga_base) |
---|
| 62 | +{ |
---|
| 63 | + switch (rga_base->yuv2rgb_mode) { |
---|
| 64 | + case 0x1: |
---|
| 65 | + return rga_check_csc_constant(data, rga_base, |
---|
| 66 | + data->csc_y2r_mode, RGA_MODE_CSC_BT601L); |
---|
| 67 | + case 0x2: |
---|
| 68 | + return rga_check_csc_constant(data, rga_base, |
---|
| 69 | + data->csc_y2r_mode, RGA_MODE_CSC_BT601F); |
---|
| 70 | + case 0x3: |
---|
| 71 | + return rga_check_csc_constant(data, rga_base, |
---|
| 72 | + data->csc_y2r_mode, RGA_MODE_CSC_BT709); |
---|
| 73 | + case 0x1 << 2: |
---|
| 74 | + return rga_check_csc_constant(data, rga_base, |
---|
| 75 | + data->csc_r2y_mode, RGA_MODE_CSC_BT601F); |
---|
| 76 | + case 0x2 << 2: |
---|
| 77 | + return rga_check_csc_constant(data, rga_base, |
---|
| 78 | + data->csc_r2y_mode, RGA_MODE_CSC_BT601L); |
---|
| 79 | + case 0x3 << 2: |
---|
| 80 | + return rga_check_csc_constant(data, rga_base, |
---|
| 81 | + data->csc_r2y_mode, RGA_MODE_CSC_BT709); |
---|
| 82 | + default: |
---|
| 83 | + break; |
---|
| 84 | + } |
---|
| 85 | + |
---|
| 86 | + if ((rga_base->full_csc.flag & 0x1)) { |
---|
| 87 | + if (data->feature & RGA_FULL_CSC) |
---|
| 88 | + return true; |
---|
| 89 | + else |
---|
| 90 | + return false; |
---|
| 91 | + } |
---|
| 92 | + |
---|
| 93 | + return true; |
---|
| 94 | +} |
---|
| 95 | + |
---|
49 | 96 | static bool rga_check_resolution(const struct rga_rect_range *range, int width, int height) |
---|
50 | 97 | { |
---|
51 | 98 | if (width > range->max.width || height > range->max.height) |
---|
.. | .. |
---|
324 | 371 | continue; |
---|
325 | 372 | } |
---|
326 | 373 | |
---|
| 374 | + if (!rga_check_csc(data, rga_base)) { |
---|
| 375 | + if (DEBUGGER_EN(MSG)) |
---|
| 376 | + pr_info("core = %d, break on rga_check_csc", |
---|
| 377 | + scheduler->core); |
---|
| 378 | + continue; |
---|
| 379 | + } |
---|
| 380 | + |
---|
327 | 381 | optional_cores |= scheduler->core; |
---|
328 | 382 | } |
---|
329 | 383 | |
---|