Lines Matching +full:decimation +full:- +full:ratio
1 // SPDX-License-Identifier: GPL-2.0-only
23 struct device *dev = &sc->pdev->dev; in sc_dump_regs()
25 #define DUMPREG(r) dev_dbg(dev, "%-35s %08x\n", #r, \ in sc_dump_regs()
26 ioread32(sc->base + CFG_##r)) in sc_dump_regs()
28 dev_dbg(dev, "SC Registers @ %pa:\n", &sc->res->start); in sc_dump_regs()
58 * set the horizontal scaler coefficients according to the ratio of output to
59 * input widths, after accounting for up to two levels of decimation
74 dst_w <<= 1; /* first level decimation */ in sc_set_hs_coeffs()
76 dst_w <<= 1; /* second level decimation */ in sc_set_hs_coeffs()
84 idx = HS_LT_9_16_SCALE + sixteenths - 8; in sc_set_hs_coeffs()
99 coeff_h += SC_NUM_TAPS_MEM_ALIGN - SC_H_NUM_TAPS; in sc_set_hs_coeffs()
102 sc->load_coeff_h = true; in sc_set_hs_coeffs()
107 * set the vertical scaler coefficients according to the ratio of output to
127 idx = VS_LT_9_16_SCALE + sixteenths - 8; in sc_set_vs_coeffs()
140 coeff_v += SC_NUM_TAPS_MEM_ALIGN - SC_V_NUM_TAPS; in sc_set_vs_coeffs()
143 sc->load_coeff_v = true; in sc_set_vs_coeffs()
151 struct device *dev = &sc->pdev->dev; in sc_config_scaler()
189 /* enable 2X or 4X decimation */ in sc_config_scaler()
201 lltmp = dst_w - 1; in sc_config_scaler()
202 lin_acc_inc = div64_u64(((u64)(src_w >> dcm_shift) - 1) << 24, lltmp); in sc_config_scaler()
206 dev_dbg(dev, "hs config: src_w = %d, dst_w = %d, decimation = %s, lin_acc_inc = %08x\n", in sc_config_scaler()
226 row_acc_init_rav -= 1024; in sc_config_scaler()
229 (1 + (row_acc_init_rav >> 1)) - in sc_config_scaler()
242 row_acc_inc = ((src_h - 1) << 16) / (dst_h - 1); in sc_config_scaler()
279 dev_dbg(&pdev->dev, "sc_create\n"); in sc_create()
281 sc = devm_kzalloc(&pdev->dev, sizeof(*sc), GFP_KERNEL); in sc_create()
283 dev_err(&pdev->dev, "couldn't alloc sc_data\n"); in sc_create()
284 return ERR_PTR(-ENOMEM); in sc_create()
287 sc->pdev = pdev; in sc_create()
289 sc->res = platform_get_resource_byname(pdev, IORESOURCE_MEM, res_name); in sc_create()
290 if (!sc->res) { in sc_create()
291 dev_err(&pdev->dev, "missing '%s' platform resources data\n", in sc_create()
293 return ERR_PTR(-ENODEV); in sc_create()
296 sc->base = devm_ioremap_resource(&pdev->dev, sc->res); in sc_create()
297 if (IS_ERR(sc->base)) in sc_create()
298 return ERR_CAST(sc->base); in sc_create()