@@ -99,7 +99,7 @@ static struct spl_rect calculate_plane_rec_in_timing_active(
99
99
*
100
100
* recout_x = 128 + round(plane_x * 2304 / 1920)
101
101
* recout_w = 128 + round((plane_x + plane_w) * 2304 / 1920) - recout_x
102
- * recout_y = 0 + round(plane_y * 1440 / 1280 )
102
+ * recout_y = 0 + round(plane_y * 1440 / 1200 )
103
103
* recout_h = 0 + round((plane_y + plane_h) * 1440 / 1200) - recout_y
104
104
*
105
105
* NOTE: fixed point division is not error free. To reduce errors
@@ -1746,6 +1746,32 @@ static void spl_set_isharp_data(struct dscl_prog_data *dscl_prog_data,
1746
1746
spl_set_blur_scale_data (dscl_prog_data , data );
1747
1747
}
1748
1748
1749
+ /* Calculate recout, scaling ratio, and viewport, then get optimal number of taps */
1750
+ static bool spl_calculate_number_of_taps (struct spl_in * spl_in , struct spl_scratch * spl_scratch , struct spl_out * spl_out ,
1751
+ bool * enable_easf_v , bool * enable_easf_h , bool * enable_isharp )
1752
+ {
1753
+ bool res = false;
1754
+
1755
+ memset (spl_scratch , 0 , sizeof (struct spl_scratch ));
1756
+ spl_scratch -> scl_data .h_active = spl_in -> h_active ;
1757
+ spl_scratch -> scl_data .v_active = spl_in -> v_active ;
1758
+
1759
+ // All SPL calls
1760
+ /* recout calculation */
1761
+ /* depends on h_active */
1762
+ spl_calculate_recout (spl_in , spl_scratch , spl_out );
1763
+ /* depends on pixel format */
1764
+ spl_calculate_scaling_ratios (spl_in , spl_scratch , spl_out );
1765
+ /* depends on scaling ratios and recout, does not calculate offset yet */
1766
+ spl_calculate_viewport_size (spl_in , spl_scratch );
1767
+
1768
+ res = spl_get_optimal_number_of_taps (
1769
+ spl_in -> basic_out .max_downscale_src_width , spl_in ,
1770
+ spl_scratch , & spl_in -> scaling_quality , enable_easf_v ,
1771
+ enable_easf_h , enable_isharp );
1772
+ return res ;
1773
+ }
1774
+
1749
1775
/* Calculate scaler parameters */
1750
1776
bool spl_calculate_scaler_params (struct spl_in * spl_in , struct spl_out * spl_out )
1751
1777
{
@@ -1760,23 +1786,9 @@ bool spl_calculate_scaler_params(struct spl_in *spl_in, struct spl_out *spl_out)
1760
1786
bool enable_isharp = false;
1761
1787
const struct spl_scaler_data * data = & spl_scratch .scl_data ;
1762
1788
1763
- memset (& spl_scratch , 0 , sizeof (struct spl_scratch ));
1764
- spl_scratch .scl_data .h_active = spl_in -> h_active ;
1765
- spl_scratch .scl_data .v_active = spl_in -> v_active ;
1766
-
1767
- // All SPL calls
1768
- /* recout calculation */
1769
- /* depends on h_active */
1770
- spl_calculate_recout (spl_in , & spl_scratch , spl_out );
1771
- /* depends on pixel format */
1772
- spl_calculate_scaling_ratios (spl_in , & spl_scratch , spl_out );
1773
- /* depends on scaling ratios and recout, does not calculate offset yet */
1774
- spl_calculate_viewport_size (spl_in , & spl_scratch );
1789
+ res = spl_calculate_number_of_taps (spl_in , & spl_scratch , spl_out ,
1790
+ & enable_easf_v , & enable_easf_h , & enable_isharp );
1775
1791
1776
- res = spl_get_optimal_number_of_taps (
1777
- spl_in -> basic_out .max_downscale_src_width , spl_in ,
1778
- & spl_scratch , & spl_in -> scaling_quality , & enable_easf_v ,
1779
- & enable_easf_h , & enable_isharp );
1780
1792
/*
1781
1793
* Depends on recout, scaling ratios, h_active and taps
1782
1794
* May need to re-check lb size after this in some obscure scenario
@@ -1824,3 +1836,20 @@ bool spl_calculate_scaler_params(struct spl_in *spl_in, struct spl_out *spl_out)
1824
1836
1825
1837
return res ;
1826
1838
}
1839
+
1840
+ /* External interface to get number of taps only */
1841
+ bool spl_get_number_of_taps (struct spl_in * spl_in , struct spl_out * spl_out )
1842
+ {
1843
+ bool res = false;
1844
+ bool enable_easf_v = false;
1845
+ bool enable_easf_h = false;
1846
+ bool enable_isharp = false;
1847
+ struct spl_scratch spl_scratch ;
1848
+ struct dscl_prog_data * dscl_prog_data = spl_out -> dscl_prog_data ;
1849
+ const struct spl_scaler_data * data = & spl_scratch .scl_data ;
1850
+
1851
+ res = spl_calculate_number_of_taps (spl_in , & spl_scratch , spl_out ,
1852
+ & enable_easf_v , & enable_easf_h , & enable_isharp );
1853
+ spl_set_taps_data (dscl_prog_data , data );
1854
+ return res ;
1855
+ }
0 commit comments