/*
* Copyright (C) 2017 Jernej Skrabec <jernej.skrabec@siol.net>
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
#ifndef _SUN8I_VI_SCALER_H_
#define _SUN8I_VI_SCALER_H_
#include <drm/drm_fourcc.h>
#include "sun8i_mixer.h"
#define DE2_VI_SCALER_UNIT_BASE 0 x20000
#define DE2_VI_SCALER_UNIT_SIZE 0 x20000
#define DE3_VI_SCALER_UNIT_BASE 0 x20000
#define DE3_VI_SCALER_UNIT_SIZE 0 x08000
/* this two macros assumes 16 fractional bits which is standard in DRM */
#define SUN8I_VI_SCALER_SCALE_MIN 1
#define SUN8I_VI_SCALER_SCALE_MAX ((1 UL << 20 ) - 1 )
#define SUN8I_VI_SCALER_SCALE_FRAC 20
#define SUN8I_VI_SCALER_PHASE_FRAC 20
#define SUN8I_VI_SCALER_COEFF_COUNT 32
#define SUN8I_VI_SCALER_SIZE(w, h) (((h) - 1 ) << 16 | ((w) - 1 ))
#define SUN8I_SCALER_VSU_CTRL(base) ((base) + 0 x0)
#define SUN50I_SCALER_VSU_SCALE_MODE(base) ((base) + 0 x10)
#define SUN50I_SCALER_VSU_DIR_THR(base) ((base) + 0 x20)
#define SUN50I_SCALER_VSU_EDGE_THR(base) ((base) + 0 x24)
#define SUN50I_SCALER_VSU_EDSCL_CTRL(base) ((base) + 0 x28)
#define SUN50I_SCALER_VSU_ANGLE_THR(base) ((base) + 0 x2c)
#define SUN8I_SCALER_VSU_OUTSIZE(base) ((base) + 0 x40)
#define SUN8I_SCALER_VSU_YINSIZE(base) ((base) + 0 x80)
#define SUN8I_SCALER_VSU_YHSTEP(base) ((base) + 0 x88)
#define SUN8I_SCALER_VSU_YVSTEP(base) ((base) + 0 x8c)
#define SUN8I_SCALER_VSU_YHPHASE(base) ((base) + 0 x90)
#define SUN8I_SCALER_VSU_YVPHASE(base) ((base) + 0 x98)
#define SUN8I_SCALER_VSU_CINSIZE(base) ((base) + 0 xc0)
#define SUN8I_SCALER_VSU_CHSTEP(base) ((base) + 0 xc8)
#define SUN8I_SCALER_VSU_CVSTEP(base) ((base) + 0 xcc)
#define SUN8I_SCALER_VSU_CHPHASE(base) ((base) + 0 xd0)
#define SUN8I_SCALER_VSU_CVPHASE(base) ((base) + 0 xd8)
#define SUN8I_SCALER_VSU_YHCOEFF0(base, i) ((base) + 0 x200 + 0 x4 * (i))
#define SUN8I_SCALER_VSU_YHCOEFF1(base, i) ((base) + 0 x300 + 0 x4 * (i))
#define SUN8I_SCALER_VSU_YVCOEFF(base, i) ((base) + 0 x400 + 0 x4 * (i))
#define SUN8I_SCALER_VSU_CHCOEFF0(base, i) ((base) + 0 x600 + 0 x4 * (i))
#define SUN8I_SCALER_VSU_CHCOEFF1(base, i) ((base) + 0 x700 + 0 x4 * (i))
#define SUN8I_SCALER_VSU_CVCOEFF(base, i) ((base) + 0 x800 + 0 x4 * (i))
#define SUN8I_SCALER_VSU_CTRL_EN BIT(0 )
#define SUN8I_SCALER_VSU_CTRL_COEFF_RDY BIT(4 )
#define SUN50I_SCALER_VSU_SUB_ZERO_DIR_THR(x) (((x) << 24 ) & 0 xFF)
#define SUN50I_SCALER_VSU_ZERO_DIR_THR(x) (((x) << 16 ) & 0 xFF)
#define SUN50I_SCALER_VSU_HORZ_DIR_THR(x) (((x) << 8 ) & 0 xFF)
#define SUN50I_SCALER_VSU_VERT_DIR_THR(x) ((x) & 0 xFF)
#define SUN50I_SCALER_VSU_SCALE_MODE_UI 0
#define SUN50I_SCALER_VSU_SCALE_MODE_NORMAL 1
#define SUN50I_SCALER_VSU_SCALE_MODE_ED_SCALE 2
#define SUN50I_SCALER_VSU_EDGE_SHIFT(x) (((x) << 16 ) & 0 xF)
#define SUN50I_SCALER_VSU_EDGE_OFFSET(x) ((x) & 0 xFF)
#define SUN50I_SCALER_VSU_ANGLE_SHIFT(x) (((x) << 16 ) & 0 xF)
#define SUN50I_SCALER_VSU_ANGLE_OFFSET(x) ((x) & 0 xFF)
void sun8i_vi_scaler_enable(struct sun8i_mixer *mixer, int layer, bool enable);
void sun8i_vi_scaler_setup(struct sun8i_mixer *mixer, int layer,
u32 src_w, u32 src_h, u32 dst_w, u32 dst_h,
u32 hscale, u32 vscale, u32 hphase, u32 vphase,
const struct drm_format_info *format);
#endif
Messung V0.5 in Prozent C=95 H=92 G=93
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet am 2026-06-08)
¤
*© Formatika GbR, Deutschland