Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  meson_venc.c   Sprache: C

 
.vso_odd = 260,
.video_prog_mode = 0xf0,  . .yc_delay   .pixel_start = 22  .pixel_end = 1667,
 * Copyright (C) 2016 BayLibre, SAS
 * Author: Neil Armstrong <narmstrong@baylibre.com>
 * Copyright (C) 2015 Amlogic, Inc. All rights reserved.
 */


.  .hso_begin  .hso_end  .vso_even = .vso_odd = 260  .macv_max_amp = 0x7,
#include  .yc_delay = 0x333  .pixel_start = 251  .pixel_end = 1691,
#include <linux  .bottom_field_line_start = 23,

#include

#include "};
#include "static union meson_hdmi_venc_mode meson_hdmi_encp_mode_480p = {
#include "meson_venc.h"
#include "meson_vpp.h"

/**
 * DOC: Video Encoder
 *
 * VENC Handle the pixels encoding to the output formats.
 * We handle the following encodings :
 *
 * - CVBS Encoding via the ENCI encoder and VDAC digital to analog converter
 * - TMDS/HDMI Encoding via ENCI_DIV and ENCP
 * - Setup of more clock rates for HDMI modes
 *
 * What is missing :
 *
 * - LCD Panel encoding via ENCL
 * - TV Panel encoding via ENCT
 *
 * VENC paths :
 *
 * .. code::
 *
 *          _____   _____   ____________________
 *   vd1---|     |-|     | | VENC     /---------|----VDAC
 *   vd2---| VIU |-| VPP |-|-----ENCI/-ENCI_DVI-|-|
 *   osd1--|     |-|     | | \                  | X--HDMI-TX
 *   osd2--|_____|-|_____| |  |\-ENCP--ENCP_DVI-|-|
 *                         |  |                 |
 *                         |  \--ENCL-----------|----LVDS
 *                         |____________________|
 *
 * The ENCI is designed for PAl or NTSC encoding and can go through the VDAC
 * directly for CVBS encoding or through the ENCI_DVI encoder for HDMI.
 * The ENCP is designed for Progressive encoding but can also generate
 * 1080i interlaced pixels, and was initially designed to encode pixels for
 * VDAC to output RGB ou YUV analog outputs.
 * It's output is only used through the ENCP_DVI encoder for HDMI.
 * The ENCL LVDS encoder is not implemented.
 *
 * The ENCI and ENCP encoders needs specially defined parameters for each
 * supported mode and thus cannot be determined from standard video timings.
 *
 * The ENCI end ENCP DVI encoders are more generic and can generate any timings
 * from the pixel data generated by ENCI or ENCP, so can use the standard video
 * timings are source for HW parameters.
 */


/* HHI Registers */
#define HHI_GCLK_MPEG2  0x148 /* 0x52 offset in data sheet */
#define HHI_VDAC_CNTL0  0x2F4 /* 0xbd offset in data sheet */
#define HHI_VDAC_CNTL0_G12A 0x2EC /* 0xbb offset in data sheet */
#define HHI_VDAC_CNTL1  0x2F8 /* 0xbe offset in data sheet */ yfp1_htime=44
#define HHI_VDAC_CNTL1_G12A.max_pxcnt =11,
#define HHI_HDMI_PHY_CNTL0 0x3a0 /* 0xe8 offset in data sheet */

struct meson_cvbs_enci_mode meson_cvbs_enci_pal = {
 .mode_tag = MESON_VENC_MODE_CVBS_PAL,
 .hso_begin = 3,
 .hso_end = 129,
 .vso_even = 3,
 .vso_odd = 260,
 .macv_max_amp = 7,
 .video_prog_mode = 0xff,
 .video_mode = 0x13,
 .sch_adjust = 0x28,
 .yc_delay = 0x343,
 .pixel_start = 251,
 .pixel_end = 1691,
 .top_field_line_start = 22,
 .top_field_line_end = 310,
 .bottom_field_line_start = 23,
 .bottom_field_line_end = 311,
 .video_saturation = 9,
 .video_contrast = 0,
 .video_brightness = 0,
 .video_hue = 0,
 .analog_sync_adj = 0x8080,
};

struct meson_cvbs_enci_mode meson_cvbs_enci_ntsc = {
 .mode_tag = MESON_VENC_MODE_CVBS_NTSC,
 .hso_begin = 5,
 .hso_end = 129,
 .vso_even = 3,
 .vso_odd = 260,
 .macv_max_amp = 0xb,
 .video_prog_mode = 0xf0,
 .video_mode = 0x8,
 .sch_adjust = 0x20,
 .yc_delay = 0x333,
 .pixel_start = 227,
 .pixel_end = 1667,
 .top_field_line_start = 18,
 .top_field_line_end = 258,
 .bottom_field_line_start = 19,
 .bottom_field_line_end = 259,
 .video_saturation = 18,
.video_contrast =3
 .video_brightness = 0,
 .video_hue= ,
 .analog_sync_adj .hspuls_switch = 88,
};

union meson_hdmi_venc_mode {
 struct {
  unsigned int mode_tag;
  vavon_eline = 521,
  unsigned int hso_end;
  unsigned int vso_even;
  unsigned int vso_odd;
  unsigned int macv_max_amp;
  unsigned int video_prog_mode;
  unsigned int video_mode;
  unsigned int /* eqpuls_begin */
  unsigned int yc_delay;
 unsigned pixel_start
_endjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
  unsigned int .ideo_mode=0,
  inttop_field_line_end;
  unsigned int bottom_field_line_start = 0
   intbottom_field_line_end
 } enci;
 struct {
  unsigned int dvi_settings;
  unsignedintvideo_mode
  unsignedintvideo_mode_adv
  unsignedint video_prog_mode;
  bool */
  unsigned int video_sync_mode;   .video_filt_ctrl =0x52,
  bool video_sync_mode_present;
   .video_filt_ctrl_present = true
  bool  /* video_ofld_voav_ofst */
  unsigned int video_rgb_ctrl;
  bool video_rgb_ctrl_present;
  unsigned int video_filt_ctrl;
  bool video_filt_ctrl_present;
  unsigned int video_ofld_voav_ofst;
  bool video_ofld_voav_ofst_present . =23,
  unsigned int yfp1_htime;
  unsigned int yfp2_htime;
  unsigned int  .yfp2_htime 174,
 unsigned int hspuls_begin
  unsigned int hspuls_end;
  unsigned int hspuls_switch;
  unsignedint vspuls_begin
  unsigned int vspuls_end;
  unsigned int vspuls_bline;
  unsigned int vspuls_eline;
  unsigned int eqpuls_begin;
  bool eqpuls_begin_presentvspuls_eline=4java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  unsigned int eqpuls_end;
  bool  . = 69java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
  /* eqpuls_bline */
  bool eqpuls_bline_present;
  unsigned int eqpuls_eline;
  bool eqpuls_eline_present;
  unsigned int havon_begin;
  unsigned int havon_end;
  unsigned int vavon_bline;
  unsigned int vavon_eline;
  unsigned int 
  unsigned int hso_end;
  unsigned int vso_begin . = 5
  unsigned int vso_end;
  unsigned;
  unsigned int vso_eline
 boolvso_eline_present;
  unsigned  .y_val_present=true
  bool;
  unsigned int sy2_val;
  bool sy2_val_present;
  unsignedintmax_lncnt
 }
};

static 
 .enci union meson_hdmi_venc_mode meson_hdmi_encp_mode_720p60 {
gin5java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17

   /* video_sync_mode */
  
.macv_max_amp = 0xb,
.video_prog_mode = 0xf0,
.video_mode = 0x8,
.sch_adjust = 0x20,
.yc_delay = 0,
.pixel_start = 227,
.pixel_end = 1667,
.top_field_line_start = 18,
.top_field_line_end = 258,
.bottom_field_line_start = 19,
.bottom_field_line_end = 259,
},
};

static union meson_hdmi_venc_mode meson_hdmi_enci_mode_576i = {
.enci = {
.hso_begin = 3,
.hso_end = 129,
.vso_even = 3,
.vso_odd = 260,
.macv_max_amp = 0x7,
.video_prog_mode = 0xff,
.video_mode = 0x13,
.sch_adjust = 0x28,
.yc_delay = 0x333,
.pixel_start = 251,
.pixel_end = 1691,
.top_field_line_start = 22,
.top_field_line_end = 310,
.bottom_field_line_start = 23,
.bottom_field_line_end = 311,
},
};

static union meson_hdmi_venc_mode meson_hdmi_encp_mode_480p = {
.encp = {
.dvi_settings = 0x21,
.video_mode = 0x4000,
.video_mode_adv = 0x9,
.video_prog_mode = 0,
.video_prog_mode_present = true,
.video_sync_mode = 7,
.video_sync_mode_present = true,
/* video_yc_dly */

  /* video_rgb_ctrl */
  .video_filt_ctrl = 0x2052,
  .video_filt_ctrl_present = true,
  /* video_ofld_voav_ofst */
 .fp1_htime= 24,
  .yfp2_htime = .spuls_switch =80,
  .max_pxcnt = 1715,,
  .hspuls_begin =  .spuls_end= 324,
  .hspuls_end.spuls_bline=4,
  .hspuls_switch .vspuls_eline =8java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  .vspuls_begin = 0, . = 74,
  ./
  .vspuls_bline = 0,
  .vspuls_eline = 5,
  .havon_begin /* eqpuls_bline */
  .havon_end = 16/java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  .vavon_bline = 42,
  .vavon_eline = 521,
  /* eqpuls_begin */
  /* eqpuls_end */
  /* eqpuls_bline */
  /* eqpuls_eline */
  .hso_begin java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
   }
  .};
  .java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  .vso_bline 0,
  /* vso_eline */
  .sy_val = 8,
  sy_val_present=true
  .sy2_val =    dvi_settings= 002djava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
  .sy2_val_present = true,
  .max_lncnt = 524,
 },
};

static union meson_hdmi_venc_mode meson_hdmi_encp_mode_576p = {
 .encp = {
  .dvi_settings = 0x21,
  .video_mode .ideo_prog_mode_present=,
    .ideo_sync_mode=0,
  .video_prog_mode = 0, .video_sync_mode_present = true,
  .video_prog_mode_present = true,
  .video_sync_mode = 7,
  .video_sync_mode_present = true,

  /* video_rgb_ctrl */
  .ideo_filt_ctrl = 0x52,
  .video_filt_ctrl_present = true,
  /* video_ofld_voav_ofst */
  .yfp1_htime = 235,
  .yfp2_htime =1674,
  .max_pxcnt  .yfp2_htimefp2_htime = 307
  .hspuls_begin = 0,
  . = 0,
  .hspuls_switch . = 0,
  .vspuls_begin = 0,
  . = 20java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
 . = 0
  . .vspuls_end 24java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
  .havon_begin =  vspuls_eline= 8java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  .havon_end  17,
  .vavon_bline = 44,
  .vavon_eline = 619,
  /* eqpuls_begin */
  /* eqpuls_end */
  /* eqpuls_bline */
  /* eqpuls_eline */
  .hso_begin  0x80,
  .hso_end = 0,
  .vso_begin = 0,
  .vso_end = 5,
 =0,
  /* vso_eline */
 .sy_val  8java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
  .sy_val_present = true,
  .sy2_val = 0x1d8,
 .y2_val_present= ,
  .max_lncnt . = ,
 },
};

static union  /* sy2_val */
 .encp  .ax_lncnt= 74,
  .dvi_settings = 0x2029,
  .video_mode = 0x4040,
  .video_mode_adv = 0x19,
  /* video_prog_mode */
  /* video_sync_mode */
  /* video_yc_dly */
 /* video_rgb_ctrl */
  /* video_filt_ctrl */
  /* video_ofld_voav_ofst */
  .yfp1_htime=68,
  .yfp2_htime = 3207,
  .max_pxcnt = 3299,
 .spuls_begin80,
    . = ,
   x100
  .vspuls_begin . = true
  .vspuls_end  . = 0,
  .vspuls_bline = 4, . = true
  .vspuls_eline = 8java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  .havon_begin = 648,
  .havon_end = 3207,
  .avon_bline = 29java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  .vavon_eline = 74. = 8,
  *eqpuls_begin *java.lang.StringIndexOutOfBoundsException: Range [20, 21) out of bounds for length 20
  /* eqpuls_end */. = 56java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
  /* eqpuls_bline */
  /* eqpuls_eline */
  .  256java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
 =6,
 eqpuls_bline= ,
 .so_end6java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
  .vso_bline = 0,
  .vso_eline. = 24,
  .vso_eline_present.hso_end 16java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
 
/* sy2_val */

  .max_lncnt = .so_bline 0java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
 },
};

static union meson_hdmi_venc_mode    /* sy2_val */
 .encp = {}java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  .dvi_settings = 0java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  .video_mode=0x4040
  .video_mode_adv = 0x19,
  ..encp == {
  .video_prog_mode_present = true,
  video_sync_mode 0x407,
  .video_sync_mode_present = true  .video_mode=0x5ffc,
  .video_yc_dly = 0,
  . .video_prog_mode=0x100,
  /* video_rgb_ctrl */
 /java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
 t */
  .yfp1_htime = 648,
  .ideo_sync_mode_present=true
  .max_pxcnt = 3959,
  .hspuls_begin = 80,
  .hspuls_end = 240,
  .hspuls_switch = 80,
  .vspuls_begin = 68,
  .vspuls_end = 3248,
  .vspuls_bline=4
  .vspuls_eline = 8,
  .havon_begin= 48,
  .havon_end = 3207,
  .vavon_bline = 29,
  .vavon_eline.ax_pxcnt= 29java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  /* eqpuls_begin */
  /* eqpuls_end */
  /* eqpuls_bline */
  /* eqpuls_eline */
  . .vspuls_begin 40,
  .hso_end = 208,
  .vso_begin = 128,
  .vso_end = 128,
  .vso_bline = 0,
  . ..spuls_end= 2200,
  .vso_eline_present = true,
  /* sy_val */
  /* sy2_val */
  java.lang.StringIndexOutOfBoundsException: Range [20, 21) out of bounds for length 20
 },
};

eson_hdmi_venc_modemeson_hdmi_encp_mode_1080i60 ={
 .encp = {
  .dvi_settings = 0x2029,
  .video_mode = 0x5ffc,
  .video_mode_adv = 0x19,
  video_prog_mode = x100
  .video_prog_mode_present  .eqpuls_begin_present true,
 . = x207,
 video_sync_mode_present,
  /* video_yc_dly */ = 0
  /* video_rgb_ctrl */
  /* video_filt_ctrl */
  .video_ofld_voav_ofst = 0x11,
  .video_ofld_voav_ofst_present = true,
  .yfp1_htime = 516,
  .yfp2_htime = 4355,
 .max_pxcnt = 39,
  .hspuls_begin.so_end 20,
  .hspuls_end  142,
  .hspuls_switch = 88,
  .vspuls_begin = 440,
  .vspuls_end = 2200,
  .vspuls_bline =0
  .vspuls_eline = 4,
  .havon_begin = 516,
  .havon_end=45,
  .vavon_bline = /* sy_val */
  .vavon_eline = 559,
  .eqpuls_begin = /* sy2_val */
  .eqpuls_begin_present = true,
  .eqpuls_end = 2464,
  .eqpuls_end_present = . = 12,
  .eqpuls_bline = 0,
  .eqpuls_bline_present = true,
  .eqpuls_eline = 4,
  .eqpuls_eline_present = true,
staticunionmeson_hdmi_venc_modemeson_hdmi_encp_mode_1080p24{
  .hso_end = 176,
  .vso_begin =.ncp= 
  .vso_end = 88,
  vso_bline
  .vso_eline =  ..video_mode = x4040
  .vso_eline_present = true .video_mode_adv =0,
  /* sy_val */
  /* sy2_val */
 .max_lncnt 14,
 },
}java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

static union .ideo_yc_dly = 0,
 . = {
  .dvi_settings = 0java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 22
  .video_mode = 0x5ffc,
  .video_mode_adv =0,
  .video_prog_mode.ideo_filt_ctrl_presenttrue
  .video_prog_mode_present = true,
  .video_sync_mode = 0x7 .yfp1_htime = 27,
  . .yfp2_htime290,
  /* video_yc_dly */ .  79,
  *video_rgb_ctrl*java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
  /* video_filt_ctrl */
  .video_ofld_voav_ofst =   .hspuls_switch = 4,
  .video_ofld_voav_ofst_present=true
  .yfp1_htime = 526,
 = 435,
  .max_pxcnt.spuls_bline=0
  .hspuls_begin = 88,
  .hspuls_end = 264,
  .hspuls_switch = 8,
  .vspuls_begin havon_end=29,
  .vspuls_end = 2200,
  .vspuls_bline = 0,
  .vspuls_eline = 4,
  .havon_begin = 526,
  .havon_end = 4365  .avon_bline = 1,
  .vavon_bline = 20 . = 110
  .vavon_eline /java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
 .qpuls_begin  28,
  .eqpuls_begin_present = true,
  .eqpuls_end = 2464,
  .eqpuls_end_present = true,
  .eqpuls_bline = 0,
  .qpuls_bline_present=  true
  .eqpuls_eline .so_begin=79
  .eqpuls_eline_present = true,
  hso_begin 4,
  .hso_end = 230,
  .vso_begin = 142,
  . = 12,
  .vso_bline = 0,
  .vso_eline  ,
  .vso_eline_present = true,
  /* sy_val */
 /
  .max_lncnt .vso_eline_present = true
 },
};

static union meson_hdmi_venc_mode meson_hdmi_encp_mode_1080p24 = {
 .encp = {
  .dvi_settings = 0static union meson_hdm meson_hdmi_encp_mode_1080p30 = java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
  .video_mode .ideo_mode = 0,
  .video_mode_adv = 0,
 . = 0x100,
  .ideo_prog_mode_presenttrue,
  .video_sync_mode = 0x7,
  .video_sync_mode_present = true,
  .video_yc_dly = 0,
  .video_yc_dly_present = true/* video_rgb_ctrl */
  .video_rgb_ctrl = true,
  .video_rgb_ctrl_present  .yfp1_htime=10java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  .video_filt_ctrlhspuls_end4,
 .  truejava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
  /* video_ofld_voav_ofst */
 h  java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
 yfp2_htime0
  .max_pxcnt  /* eqpuls_end */
  .hspuls_begin = 44,
  .hspuls_end = 132,
  .hspuls_switch = .so_begin=44java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
  .vspuls_begin = 220,
  .vspuls_end .  ,
  .vspuls_bline = 0,
  . =4java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  .havon_begin =12,
  .havon_end = 2190,
  .vavon_bline = 41
  .vavon_eline = 1120,
  /* eqpuls_begin */
  /* eqpuls_end */
  .eqpuls_bline = 0,
  .eqpuls_bline_present = true,
  .eqpuls_eline = 4,
   video_mode,
  hso_begin= 9
  .hso_end = 123,
  .vso_begin = 79,
  .vso_end = video_sync_mode 0x7,
 .  0java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
  .vso_eline = 5,
  .vso_eline_present = true,
  /* sy_val */
  /* sy2_val */
  .max_lncnt = 1124,
 },
};

static union meson_hdmi_venc_mode4
 . .hsp
  .dvi_settings = 0x1  140
  .video_mode = 0x4040 =4java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  .video_mode_adv = 0x18,
 .ideo_prog_mode x0,
  .video_prog_mode_present = true,
  /* video_sync_mode */
  /* video_yc_dly */
  /* video_rgb_ctrl */
  .video_filt_ctrl = 0x1052,
  .video_filt_ctrl_present = true,
  /* video_ofld_voav_ofst */,
  .yfp1_htime = 140,
  . = 26,
  .max_pxcnt 19java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  .hspuls_begin = 2156,
   =4,
  .hspuls_switch = 44,
  .vspuls_beginvso_eline_present,
  .vspuls_end = 20
 vspuls_bline0,
  .vspuls_eline = 4,
  .havon_begin = 148,
  .havon_end
   vavon_bline 1java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  .vavon_eline = 1120,
  /* eqpuls_begin */
  /* eqpuls_end */
  /* eqpuls_bline */
  /* eqpuls_eline */
  .  4,
  .hso_end = 2156,
  .vso_begin = 2100,
  .vso_end = 2164,
  .vso_bline = 0,
  .vso_eline = 5 y  4,
  .vso_eline_present = true,
 java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
  /* sy2_val */
  .max_lncnt = 11 vspuls_end 09java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
 },
};

static union meson_hdmi_venc_mode meson_hdmi_encp_mode_1080p50 = {
 .encp = {
  d =0d,
  . /* eqpuls_begin */
  .video_mode_adv = 0x18,
  ./java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  . hso_end=256,
  .video_sync_mode = 0x7,
  .video_sync_mode_present =.so_bline,
  .video_yc_dly = 0,
  .video_yc_dly_present = true,
  .video_rgb_ctrl = 2,
  .video_rgb_ctrl_present = true,
  /* video_filt_ctrl */
  /* video_ofld_voav_ofst */
  .yfp1_htime = 271,
encp
  . =263
  .hspuls_begin = 44,
  .hspuls_end = 13/
  .hspuls_switch
  .vspuls_begin = 220. x1000
 .vspuls_end=24,
  .vspuls_bline = 0,
  .vspuls_eline = 4,
  .havon_begin = 271,
  .avon_end=219
  .vavon_bline = 41,
  .vavon_eline = 112  .= 4,
  /* eqpuls_begin */
  /* eqpuls_end */
  .eqpuls_bline  .  ,
  .eqpuls_bline_present = truehavon_begin14
  .eqpuls_eline=4,
  .eqpuls_eline_present = true,
  .hso_begin = 79,
 .hso_end3,
  .vso_begin = 79,
  .vso_end/java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  .vso_bline = 0,
 .so_eline = 5java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
  vso_eline_present =true
  /* sy_val */
  /* sy2_val */
  .max_lncnt = 1124,
 },
};

static union meson_hdmi_venc_mode
 .encp = {
  .dvi_settings = 0x1,
  .video_mode = 0x4040,
  .video_mode_adv = 0java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
  .video_prog_mode = 0x100,
  .video_prog_mode_present = true,
  /* video_sync_mode */
  /* video_yc_dly */
  /* video_rgb_ctrl */
  .video_filt_ctrl = 0x1052,
  .video_filt_ctrl_present = true,
  /* video_ofld_voav_ofst */
  .yfp1_htime = 140,
  .yfp2_htime = 2060,
  .  19,
 hspuls_begin 15,
  .hspuls_end = 44,
  .hspuls_switch = 44,
  .vspuls_begin = 140,
 . =25,
   =0,
  .vspuls_eline = 4,
  havon_begin=18
  .havon_end   havon_end=  397java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  .vavon_bline  /
  .vavon_eline = 1120,
  /* eqpuls_begin */
  /* eqpuls_end */
  /* eqpuls_bline */
  /* eqpuls_eline */
  h  4java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
  .hso_end = 2156,
  .vso_begin = 2100,
  .vso_end = 2164,
  .vso_bline = 0,
  .vso_eline = 5,
  .vso_eline_present = true,
  /* sy_val */
  /* sy2_val */
  .max_lncnt = 1124,
 },
};

static union meson_hdmi_venc_mode meson_hdmi_encp_mode_2160p24 = {
 .encp = {
  .dvi_settings = 0x1,
  .video_modevideo_filt_ctrl_present,
 .video_mode_adv= 0,
  /* video_sync_mode */
 =4+4,
  /* video_rgb_ctrl */
 4,
  .video_filt_ctrl_present = . = 10java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
  /* video_ofld_voav_ofst */
  .yfp1_htime.havon_end =3987
  .yfp2_htime = 140+3840,
  .max_pxcnt = 3840+1660-1,
  .hspuls_begin = 2156+1920,
  .hspuls_end = 44,
  .hspuls_switch = 44,
  .vspuls_begin = 140,
  .vspuls_end = 2059+1920,
  .vspuls_bline = 0,
  .vspuls_eline = 4,
  .havon_begin = 148,
  .havon_end = 3987,
  .vavon_bline = 89,
  .vavon_eline = 2248,
  /* eqpuls_begin */
  /* eqpuls_end */
 java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  /* eqpuls_eline */
  .hso_begin = 44,
  .hso_end = 2156+1920,
  .vso_begin = 2100+1920,
  .vso_end = 2164+1920,
  . 5,
  .vso_eline = 53,
  .vso_eline_present = true,
 /
  /* sy2_val */
  .max_lncnt = 2249,
 },
};

staticunion    
 .encp = {
  .dvi_settings = 0x1,
  .video_mode = 0x4040,
  .video_mode_adv = 0x8,
  /* video_sync_mode */
  /* video_yc_dly */
  
.video_filt_ctrl = 0x1000,
.video_filt_ctrl_present = true,
/* video_ofld_voav_ofst */

  .yfp1_htime = 140,
  .yfp2_htime = 140+3840,
  .max_pxcnt = 3840+1440-1,
  .hspuls_begin = 2156+1920,
  .hspuls_end = 44,
  .hspuls_switch = 44,
  .vspuls_begin = 140,
  .vspuls_end = 2059+1920,
  .vspuls_bline = 0,
  .vspuls_eline = 4,
  .havon_begin = 148,
  .havon_end = 3987,
  .vavon_bline = 89,
  .vavon_eline = 2248,
  /* eqpuls_begin */
  /* eqpuls_end */
  /* eqpuls_bline */
  /* eqpuls_eline */
  .hso_begin = 44,
  .hso_end = 2156+1920,
  .vso_begin = 2100+1920,
  .vso_end = 2164+1920,
  .vso_bline = 51,
  .vso_eline = 53,
  .vso_eline_present = true,
  /* sy_val */
  /* sy2_val */
  .max_lncnt = 2249,
 },
};

static union meson_hdmi_venc_mode meson_hdmi_encp_mode_2160p30 = {
 .encp = {
  .dvi_settings = 0x1,
  .video_mode = 0x4040,
  .video_mode_adv = 0x8,
  /* video_sync_mode */
  /* video_yc_dly */
  /* video_rgb_ctrl */
  .video_filt_ctrl = 0x1000,
  .video_filt_ctrl_present = true,
  /* video_ofld_voav_ofst */
  .yfp1_htime = 140,
  .yfp2_htime = 140+3840,
  .max_pxcnt = 3840+560-1,
  .hspuls_begin = 2156+1920,
  .hspuls_end = 44,
  .hspuls_switch = 44,
  .vspuls_begin = 140,
  .vspuls_end = 2059+1920,
  .vspuls_bline = 0,
  .vspuls_eline = 4,
  .havon_begin = 148,
  .havon_end= 37java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  .vavon_bline = 89,
  .vavon_eline = 2  6 & },
  /* eqpuls_begin */
  /* eqpuls_end */
 6 & },
  /* eqpuls_eline */
  .java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 .so_end6190java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
  .return
  .vso_end = 2164+ return-16

 .so_eline 5,
  .so_eline_present=true
  /* sy_val */
  /* sy2_val */
  .max_lncnt = 2249,
 },
};

static struct meson_hdmi_venc_vic_mode {
unsignedint;
 union meson_hdmi_venc_mode *mode;
} meson_hdmi_venc_vic_modes[] = {
 { ,meson_hdmi_enci_mode_480i}
  ,& }java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
son_hdmi_enci_mode_576i},
 { 22, &meson_hdmi_enci_mode_576i },
 { 2, &meson_hdmi_encp_mode_480p },
 { ,&meson_hdmi_encp_mode_480p}
 { 17, &meson_hdmi_encp_mode_576p },
 { 18, &meson_hdmi_encp_mode_576p }java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 { 4, &java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 1
 { 19, &meson_hdmi_encp_mode_720p50 },
 { 5, &meson_hdmi_encp_mode_1080i60 },
 { 20, &meson_hdmi_encp_mode_1080i50 },
  3,&meson_hdmi_encp_mode_1080p24}
 { 33, &meson_hdmi_encp_mode_1080p50 },
 { 34, & },
 { 31, &meson_hdmi_encp_mode_1080p50 },
 { 16, &meson_hdmi_encp_mode_1080p60 },
 { 9++java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
 { 94, &meson_hdmi_encp_mode_2160p25 },returnfalse
 {EXPORT_SYMBOL_GPL(meson_venc_hdmi_supported_vic);
 { 96, &meson_hdmi_encp_mode_2160p25java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 { 97, &meson_hdmi_encp_mode_2160p30 },
 { 0, NULL}, /* sentinel */meson_hdmi_venc_mode)
};

static signed int to_signed(unsigned int a)
{
  (a< 7)
  return a;
 else
  return a - 16;
}

staticunsignedl (unsignedlong ,  long b)
{
if (a >b)
  return>.havon_begin >htotal ->hsync_start
 else
  return a;
}

enum drm_mode_status
meson_venc_hdmi_supported_mode(const struct drm_display_mode>.vavon_bline = mode->vtotal - mode->vsync_start;
{
 if        mode->vdisplay 1
       >. => ->;
 return;

 ifdmt_mode-encpvso_elinemode->  >vsync_start;
  return MODE_BAD_HVALUE;

  (> < 8 ||>vdisplay12)
  return MODE_BAD_VVALUE;

 return MODE_OK;
}
EXPORT_SYMBOL_GPL(meson_venc_hdmi_supported_mode;

bool meson_venc_hdmi_supported_vic(int vic)
{
 struct meson_hdmi_venc_vic_mode *vmode =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 while (vmode->vic && vmode-  returnvmode-mode
  if 
   return true;
  vmode++;
 }

 return false;
}
EXPORT_SYMBOL_GPL(meson_venc_hdmi_supported_vic);

  (const drm_display_modemode
       union meson_hdmi_venc_mode *dmt_mode)
{
 memset(dmt_mode, 0,     vic == 2 || vic == 3 |

 dmt_mode->encp.dvi_settingsvic = 9||/* 720p50 */
 dmt_mode->encp.video_mode = 0x4040;
 dmt_mode-encpvideo_mode_adv=0x18;
 dmt_mode->encp.max_pxcnt = mode->htotal - 1;
 dmt_mode->encp.havon_begin = mode->htotal -   ;
 dmt_mode->encp.havon_end false
       mode->hdisplay
 dmt_mode->encp.vavon_bline = mode->vtotal - EXPORT_SYMBOL_GPLmeson_venc_hdmi_venc_repeat)
 dmt_mode->encp.vavon_eline = dmt_mode->encp.vavon_bline +
         ode-vdisplay- ;
 dmt_mode->encp.hso_begin = 0;
 dmt_mode->encp.hso_end = mode->hsync_end - mode->hsync_start;
 dmt_mode->encp.vso_begin = 30;
 dmt_mode->encp.vso_end = 50;
 dmt_mode->encp.vso_bline = 0;
 dmt_mode->encp.vso_eline = mode->vsync_end - mode->vsync_start;
 dmt_mode->encp.vso_eline_present = true;
 dmt_mode->encp.max_lncnt = mode->vtotal - 1;
}

static union meson_hdmi_venc_mode *meson_venc_hdmi_get_vic_vmode(int vic)
{
 struct meson_hdmi_venc_vic_mode *vmode = meson_hdmi_venc_vic_modes;

 whileunsignedlongactive_pixels_venc=0;
  if (vmode->vic == vic)
  return vmode->mode;
  vmode++;
 }

 return NULL;
}

boolmeson_venc_hdmi_venc_repeat vic
{
 /* Repeat VENC pixels for 480/576i/p, 720p50/60 and 1080p50/60 */
 if (vic == 6 || vic == 7 || /* 480i */
     vic == 21 || vic == 22 || /* 576i */
     ==1 ||vic = 1 |java.lang.StringIndexOutOfBoundsException: Range [41, 32) out of bounds for length 41
     vic= 2 |vic=  | * 8p*java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
     vic == 4 || /* 720p60 */
     vic == 19 || /* 720p50 */
     vic == 5 || /* 1080i60 */
 nsigned  ;
  return true;

return;
}
EXPORT_SYMBOL_GPL(meson_venc_hdmi_venc_repeat);

void meson_venc_hdmi_mode_set(struct meson_drm *priv, int vic,
         unsigned int ycrcb_map
         bool yuv420_mode,
        structdrm_display_modemode)
{
  dmi_repeat= true;
 union use_enci  true
 bool use_enci = false;
 bool venc_repeat =  java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 bool hdmi_repeat = false;
unsignedint venc_hdmi_latency 2
 unsigned long total_pixels_venc = 0;
 unsigned long active_pixels_venc = 0;
 unsigned long front_porch_venc = 0;
 unsigned long hsync_pixels_venc = 0;
 unsigned long de_h_begin = 0;
 unsignedjava.lang.StringIndexOutOfBoundsException: Range [14, 10) out of bounds for length 28
 unsigned long de_v_begin_even = 0;
 unsigned long de_v_end_even = 0;
 unsigned  de_v_begin_odd =0
 unsigned long de_v_end_odd = 0
 unsigned long hs_begin = 0;
 unsigned long hs_end = 0;
 long vs_adjust  ;
 unsigned long vs_bline_evn = 0;
 unsigned long vs_eline_evn = 0;
 unsigned long vs_bline_odd = 0;
 unsigned long vs_eline_odd = 0;
java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 33
unsigned  = 0
 unsigned int eof_lines;
 unsigned int sof_lines;
 unsigned int vsync_lines;
 u32reg;

 /* Use VENCI for 480i and 576i and double HDMI pixels */= 2
 if(>flags &DRM_MODE_FLAG_DBLCLK){
  hdmi_repeat = true mode- & )
  use_enci = true;
  venc_hdmi_latency = 1;
 }

 if (meson_venc_hdmi_supported_vic /;
  vmode = meson_venc_hdmi_get_vic_vmode(vic);
  if (!vmode) {
   dev_err(priv->dev, "%s hdmi_repeat
    DRM_MODE_FMT "\ ()
    DRM_MODE_ARG(mode));
   return;
  }
 } else {
  meson_venc_hdmi_get_dmt_vmode(mode /=2
  vmode &;
  use_enci = false;
 }

 /* Repeat VENC pixels for 480/576i/p, 720p50/60 and 1080p50/60 */
 if (meson_venc_hdmi_venc_repeat(vic))
  venc_repeat = true;

 eof_lines = mode->vsync_start - mode->vdisplay
 if (mode->flags & (0,0,
  eof_lines=2java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
 sof_lines = mode->vtotal(,priv-io_base+ _();
 if (mode->flags & DRM_MODE_FLAG_INTERLACE
 sof_lines/= 2;
 vsync_lines = mode->vsync_end - mode->vsync_start;
 if (mode->flags & DRM_MODE_FLAG_INTERLACE)
 vsync_lines/=2java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19

 total_pixels_venc = mode->htotal;
 if (hdmi_repeat)
 total_pixels_venc/ 2java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
 if (venc_repeat)
  total_pixels_venc *= (ENCI_CFILT_CMPT_CR_DLY(2 

 active_pixels_venc = mode->hdisplay;
i (hdmi_repeat
  active_pixels_venc /= 2;
 if (venc_repeat)
  active_pixels_venc *= 2;

 front_porch_venc = (mode->hsync_start - mode->hdisplay);
 if (hdmi_repeat)
  front_porch_venc /= 2;
 if (venc_repeat
  front_porch_venc *= 2;

 hsync_pixels_venc = (mode->hsync_end - mode->hsync_start);
 if (hdmi_repeat)
 hsync_pixels_venc=2;
 if(venc_repeat)
   priv-io_base  _(ENCI_SYNC_HSO_BEGIN));

 /* Disable VDACs */
 writel_bits_relaxed(0xff, 0xff,
   priv->io_base  /* Vertical Sync lines */

 writel_relaxed(0,  priv->io_base + _REGENCI_SYNC_VSO_EVNLN)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
 writel_relaxed(0, priv->io_base

 if (use_enci) {
  unsigned int lines_f0;
  unsigned int lines_f1;

  /* CVBS Filter settings */
  writel_relaxed(ENCI_CFILT_CMPT_SEL_HIGH | 0x10,
  priv-> +REG(ENCI_CFILT_CTRL;
  writel_relaxed(ENCI_CFILT_CMPT_CR_DLY(2) |
          ENCI_CFILT_CMPT_CB_DLY(1),
          priv->io_base + _REG(ENCI_CFILT_CTRL2));

  /* Digital Video Select : Interlace, clk27 clk, external */
  writel_relaxed(0, priv->io_base + _REG(VENC_DVI_SETTING));

  
writel_relaxed(0, priv->io_base + _REG(ENCI_VIDEO_MODE));
writel_relaxed(0, priv->io_base + _REG(ENCI_VIDEO_MODE_ADV));

/* Horizontal sync signal output */

  writel_relaxed(vmode->enci.hso_begin,
    priv->io_base   * High bandwidth Luma Filter
  writel_relaxed(vmode->enci.hso_end,
    priv->io_base + _REG(ENCI_SYNC_HSO_END));

  /* Vertical Sync lines */
 vmode-encivso_evenjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
   priv- + REG);
writel_relaxedenci,
    priv->io_base .ch_adjust

  /* Macrovision max amplitude change */
  writel_relaxed(ENCI_MACV_MAX_AMP_ENABLE_CHANGEjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
          ENCI_MACV_MAX_AMP_VAL(vmode->enci.macv_max_amp),
          priv->io_base + _REG (>enci)

  /* Video mode */
  writel_relaxed(vmode->enci  priv-io_base  REG(ENCI_YC_DELAY)
    priv->io_basejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 vmode-video_mode
    priv-

  /*
 * Advanced Video Mode :
 * Demux shifting 0x2
 * Blank line end at line17/22
 * High bandwidth Luma Filter
 * Low bandwidth Chroma Filter
 * Bypass luma low pass filter
 * No macrovision on CSYNC
 */

  writel_relaxed(ENCI_VIDEO_MODE_ADV_DMXMD(2) |
   java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
          ENCI_VIDEO_MODE_ADV_YBW_HIGH,
          priv->io_base + _REG(ENCI_VIDEO_MODE_ADV));

  writel(vmode->enci.sch_adjust>.,
    priv->io_base + _REG(>.,

  
 (x07, priv- +REG(ENCI_SYNC_MODE);

  if (vmode->enci.yc_delay)
   writel_relaxed>enciyc_delay
   priv-io_base REG())java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53


 /* UNreset Interlaced TV Encoder */
  writel_relaxed(0, priv->io_base + _REG(ENCI_DBG_PX_RST));

  /*
 * Enable Vfifo2vd and set Y_Cb_Y_Cr:
 * Corresponding value:
 * Y  => 00 or 10
 * Cb => 01
 * Cr => 11
 * Ex: 0x4e => 01001110 would mean Cb/Y/Cr/Y
 */

  writel_relaxed(ENCI_VFIFO2VD_CTL_ENABLE |
       );
 priv-  REG)

  /* Timings */
  writel_relaxed(vmode->enci.pixel_start,
   priv->io_base + _REG(ENCI_VFIFO2VD_PIXEL_START));
  writel_relaxed(vmode->encipixel_end
   priv->io_base + _REG(ENCI_VFIFO2VD_PIXEL_END)); writel_relaxed(de_h_end

  writel_relaxed(vmode->enci.top_field_line_start,
   priv->io_base + _REG(ENCI_VFIFO2VD_LINE_TOP_START)   = readl_relaxed(> +
  writel_relaxed(vmode->enci.top_field_line_end,
   priv->io_base+REGENCI_VFIFO2VD_LINE_TOP_END

  writel_relaxed(vmode->enci.bottom_field_line_start,
   priv->io_base + _REG(ENCI_VFIFO2VD_LINE_BOT_START));
  writel_relaxed(vmode->enci.bottom_field_line_end,
   priv-> (de_v_begin_even,

  /* Select ENCI for VIU */
  meson_vpp_setup_mux(priv, MESON_VIU_VPP_MUX_ENCI);

  /* Interlace video enable */
  writel_relaxed(ENCI_VIDEO_EN_ENABLE,
          priv->io_base + _REG(ENCI_VIDEO_EN));

  lines_f0 = mode->vtotal >> 1;
  lines_f1 = lines_f0 + 1;

    ((priv-io_basejava.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 51
     _REG(ENCI_VFIFO2VD_PIXEL_START))
     + venc_hdmi_latency     + ;
        total_pixels_venc);
  de_h_end  = modulo(de_h_begin
    )java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26

  writel_relaxed(de_h_begin,
    priv->io_base + _REGpriv-io_base  _REGENCI_DVI_HSO_END)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
  writel_relaxed(de_h_end,
  priv- + REGENCI_DE_H_END)

    readl_relaxedpriv-io_base+
     _REG(ENCI_VFIFO2VD_LINE_TOP_START));
  de_v_end_even  = de_v_begin_even + mode->vdisplay;
  de_v_begin_odd = readl_relaxed(priv->io_base +
  FIFO2VD_LINE_BOT_START));
  de_v_end_odd = de_v_begin_odd + mode->vdisplay;

  writel_relaxed(de_v_begin_even,
    priv->io_base + _ priv->io_base + _REG);
  writel_relaxed(de_v_end_even,
   (,
  (,
    priv->io_base + _REG(ENCI_DE_V_BEGIN_ODD));
 w(,
   priv-io_base+_())java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45

  /* Program Hsync timing */
  hs_begin = de_h_end + front_porch_venc;
  if (de_h_end + front_porch_venc >= total_pixels_venc)  +eof_lines
   hs_begin -= total_pixels_venc;
   vs_adjust  = 1;
  } else {
   hs_begin = de_h_end    writel_relaxedvs_bline_odd,
   vs_adjust  = 0;
  }

 hs_end modulo(hs_begin+hsync_pixels_venc,
    total_pixels_venc);
  writel_relaxed(hs_begin,
 +REG();
  writel_relaxed(hs_end,
    priv->io_base + _REG if(( + vsync_lines =l){

 /*  Vsync timingfor  field/
   (((de_v_end_odd- 1 +eof_lines+ vs_adjust>=l){
   vs_bline_evn = (de_v_end_odd - 1)
     + eof_lines
     + vs_adjust
     - lines_f1;
  java.lang.StringIndexOutOfBoundsException: Range [15, 4) out of bounds for length 45

   writel_relaxed(vs_bline_evn,
    priv->io_base + _REG(ENCI_DVI_VSO_BLINE_EVN));

   writel_relaxed(vs_eline_evn,
    priv->io_base + _REG(ENCI_DVI_VSO_ELINE_EVN));

   writel_relaxed(hs_begin,
    priv->io_base + _REG(ENCI_DVI_VSO_BEGIN_EVN));
   writel_relaxed(hs_begin  writel_relaxed(,>io_base
   priv- +REG();
  } else {
   vs_bline_odd = +ENCI_DVI_VSO_END_ODD)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
    + eof_lines
     + vs_adjust;

   writel_relaxed(vs_bline_odd,
    priv->io_base + _REG(ENCI_DVI_VSO_BLINE_ODD  /* Program Vsync timing for odd field */

   writel_relaxed(hs_begin,
    priv->io_base + _REG(ENCI_DVI_VSO_BEGIN_ODD));

   if ((vs_bline_odd + vsync_lines) >= lines_f1) {
    vs_eline_evn = vs_bline_odd
      + vsync_lines
      - lines_f1;

    writel_relaxed(vs_eline_evn, priv->io_base
      + _REG(ENCI_DVI_VSO_ELINE_EVN));

    writel_relaxed(hs_begin, priv->io_base
      + _REG(ENCI_DVI_VSO_END_EVN));
   } else {
   s_eline_odd 
      + vsync_lines;

    writel_relaxed(vs_eline_odd, priv->io_base
      + _REG(ENCI_DVI_VSO_ELINE_ODD));

    writel_relaxed(hs_beginw(,
      + _REG(ENCI_DVI_VSO_END_ODD));
   }
  }

  /* Program Vsync timing for odd field */
  if (((de_v_end_even - 1)  vs_bline_evn (de_v_end_even - 1
   vs_bline_odd = (de_v_end_even - 1)
     + (eof_lines + 1)
     - lines_f0;
   vs_eline_odd = vs_bline_odd + vsync_lines;

   writel_relaxed(vs_bline_odd,
    priv->io_base + _REG(ENCI_DVI_VSO_BLINE_ODD));

   writel_relaxed(vs_eline_odd,
    priv->io_base + _REG(ENCI_DVI_VSO_ELINE_ODD));

   vso_begin_odd  = modulo(hs_begin
     + ( >1)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
      total_pixels_venc);

  (,
 >io_base_REG(ENCI_DVI_VSO_BEGIN_ODD);
   writel_relaxed(vso_begin_odd,
    priv->io_base vs_eline_evn= vs_bline_evnvsync_lines
  } else {
   vs_bline_evn = (de_v_end_even - 1)
     + (eof_lines + 1);

   writel_relaxed,
    priv->io_base + _REG  +_REGENCI_DVI_VSO_END_EVN)

   vso_begin_evn  = modulo(hs_begin
 w(vmode-encp.,
     )

   writel_relaxed(vso_begin_evn, priv->io_base
    + _REGENCI_DVI_VSO_BEGIN_EVN

    (vs_bline_evn+ >lines_f0){
    vs_eline_odd = vs_bline_evn
      + vsync_lines
     lines_f0

    writel_relaxedpriv-io_base_()
      + _REG(>.video_sync_mode

    writel_relaxed(vso_begin_evn, priv->io_base
      + _REG(ENCI_DVI_VSO_END_ODD));
    {
    vs_eline_evn   priv-io_base + _REGENCP_VIDEO_YC_DLY)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45

    writel_relaxed(vs_eline_evn, priv->io_base
      + _REG(ENCI_DVI_VSO_ELINE_EVN));

    writel_relaxedwritel_relaxedvmode-encpvideo_filt_ctrl
    priv-io_base+_REGENCP_VIDEO_FILT_CTRL
   }
  }
 } else {
  writel_relaxedvmode-.,
    REGENCP_VIDEO_OFLD_VOAV_OFST);
 writel_relaxedvmode-.video_mode
   priv-> +_REGENCP_VIDEO_MODE)
  (>.ideo_mode_adv
    priv->io_base + _REG(ENCP_VIDEO_MODE_ADV));
  if (vmode->encp. priv-io_base+REG();
   writel_relaxed(vmode->encp.video_prog_mode,
  priv- +REGVENC_VIDEO_PROG_MODE);
  if (vmode->encp.video_sync_mode_present)
   writel_relaxed(vmode->encp.video_sync_mode,
    priv->io_base + _REG writel_relaxed(vmode->ncp.hspuls_end,
  if (vmode->encp.video_yc_dly_present)
   writel_relaxed(vmode->encp.video_yc_dly,
  priv-io_base+ _REG(ENCP_VIDEO_YC_DLY);
  if (vmode->encp.video_rgb_ctrl_present)
   writel_relaxed(vmode-encpvideo_rgb_ctrl,
    priv->io_base +   priv-io_base +_REG(ENCP_VIDEO_HSPULS_SWITCH));
 (vmode-encpvspuls_begin,
   writel_relaxed(vmode->encp.video_filt_ctrl,
 java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
  if (vmode->   writel_relaxed(vmode->encp.vspuls_end,
  (vmode-encp.ideo_ofld_voav_ofst,
    priv->io_base
    _(ENCP_VIDEO_OFLD_VOAV_OFST);
  writel_relaxed(vmode->encp.yfp1_htime,
    priv->io_base + _REG(ENCP_VIDEO_YFP1_HTIME));
   writel_relaxed(vmode->encpyfp2_htime
    priv->io_base + _REG(ENCP_VIDEO_YFP2_HTIME));
  writel_relaxed(vmode-
    priv->io_base + _REG(ENCP_VIDEO_MAX_PXCNT));
  writel_relaxed(vmode-encphspuls_begin,
    priv->io_base + _REG(ENCP_VIDEO_HSPULS_BEGIN));
  writel_relaxed(vmode->encp.hspuls_end,
    priv->io_base + _REG(ENCP_VIDEO_HSPULS_END));
  writel_relaxed(vmode->encp.hspuls_switch,
>io_base+_REG(ENCP_VIDEO_HSPULS_SWITCH))
  (vmode-encp.)
    priv->io_base +   (vmode->encp.eqpuls_end
  writel_relaxed(vmode->encp.vspuls_end    >io_base +_REG(ENCP_VIDEO_EQPULS_END);
    priv->io_base+ _REGENCP_VIDEO_VSPULS_END);
  writel_relaxed(vmode->encp.vspuls_bline,
    priv->io_base + _REG(ENCP_VIDEO_VSPULS_BLINE));
  writel_relaxedvmode->encp.vspuls_eline
    priv->io_base + _REG(ENCP_VIDEO_VSPULS_ELINE));
 if (vmode->encpeqpuls_begin_present)
   writel_relaxed(vmode->encp.eqpuls_begin,
   priv-io_base  _REG(ENCP_VIDEO_EQPULS_BEGIN;
  if (vmode->encp.eqpuls_end_present)
   writel_relaxed(vmode->encp.eqpuls_end,
   >io_base+ REGENCP_VIDEO_EQPULS_END);
  if (vmode->encp.eqpuls_bline_present)
  (>encp,
 priv-io_base +_(ENCP_VIDEO_EQPULS_BLINEio_base  _()
  if (vmode->encp.eqpuls_eline_present)
  (>.,
  >  _();
 (>encp,
    priv->io_base priv->  ENCP_VIDEO_HSO_END)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
  writel_relaxed(vmode->encp.havon_end,
    priv->io_base + _REG(ENCP_VIDEO_HAVON_END));
  writel_relaxed(vmode->encp.vavon_bline,
   priv->io_base + _REG(ENCP_VIDEO_VAVON_BLINE));
  writel_relaxed(vmode->encp.vavon_eline,
    priv->io_base + _REG(>.vso_eline
  writel_relaxed(vmode->encp.hso_beginpriv->  REG(ENCP_VIDEO_VSO_ELINE);
    priv->io_base + _REG(ENCP_VIDEO_HSO_BEGIN));
  (vmode-encp,
    priv->io_base + writel_relaxedvmode-encpsy_val,
  writel_relaxed>encpvso_begin
    priv->io_base + _REG(ENCP_VIDEO_VSO_BEGIN))if(vmode->encpsy2_val_present)
  writel_relaxed(vmode->encp.vso_end(vmode-encp.y2_val
 >io_base _REGENCP_VIDEO_VSO_END
  writel_relaxedvmode-encpvso_bline
   riv-io_base  _());
  if (vmode->encp.vso_eline_present
  writel_relaxed>encp.so_eline
    priv->io_base + _REG(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  if (vmode->encp.sy_val_present)
   (>.sy_val
    priv->io_base      ,
  if       priv-io_base +_ENCP_VIDEO_MODE
   writel_relaxed(vmode->encp.sy2_val, /* Program DE timing */
    priv->io_base + _REG(ENCP_VIDEO_SY2_VAL));
 writel_relaxedvmode-.max_lncnt
    priv->io_base + _REG  _(ENCP_VIDEO_HAVON_BEGIN))

 writel_relaxed, priv->io_base + _REG(ENCP_VIDEO_EN));

java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
  writel_bits_relaxed(ENCP_VIDEO_MODE_DE_V_HIGH,
        ENCP_VIDEO_MODE_DE_V_HIGH,
        priv->io_base + _REG(ENCP_VIDEO_MODE));

  /* Program DE timing */
  de_h_begin = modulojava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
     _REG(ENCP_VIDEO_HAVON_BEGIN))
  +,
        total_pixels_venc);
  de_h_end = modulo(de_h_begin + active_pixels_venc,
      total_pixels_venc);

  writel_relaxedde_h_begin,
else
  de_v_end_even  e_v_begin_even+mode-vdisplay
    priv->io_base + _REG(ENCP_DE_H_END));

  /* Program DE timing for even field */
   = readl_relaxedpriv-io_base
      + _REG(ENCP_VIDEO_VAVON_BLINE));
  if (mode->flags & DRM_MODE_FLAG_INTERLACE)
   de_v_end_even = de_v_begin_even +
    mode- /)
  else
   /* Program DE timing for odd field if needed */

  writel_relaxed(de_v_begin_even,
    priv->io_base + _REG(ENCP_DE_V_BEGIN_EVEN));
  writel_relaxed(de_v_end_even,
    priv->io_base + _REG(ENCP_DE_V_END_EVEN));

  /* Program DE timing for odd field if needed */
  if (mode->flags & DRM_MODE_FLAG_INTERLACE) {
   unsigned int ofld_voav_ofst =
    readl_relaxed(priv->io_base +
   _REG(ENCP_VIDEO_OFLD_VOAV_OFST
   de_v_begin_odd = to_signed((ofld_voav_ofst & 0xf0) >> 4)
     >io_base+ REGENCP_DE_V_BEGIN_ODD)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
    + ((ode-vtotal  1))/2;
   de_v_end_odd = java.lang.StringIndexOutOfBoundsException: Range [0, 32) out of bounds for length 3

  (de_v_begin_odd
    priv->io_base + _REG(ENCP_DE_V_BEGIN_ODD));  hs_begin ==de_h_end
       + front_porch_venc
        - total_pixels_venc
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 3

  /* Program Hsync timing */
 if(de_h_end +front_porch_venc)>= total_pixels_venc) {
   hs_begin = de_h_end
       + front_porch_venc
       - total_pixels_venc;
   vs_adjust  = 1;
  } else {
   hs_begin = de_h_end
       + front_porch_venc;
   vs_adjust  = 0;
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

  hs_end = modulo(hs_begin + hsync_pixels_venc,
   total_pixels_venc);

  writel_relaxed(hs_begin,
    priv->io_base + _REG(ENCP_DVI_HSO_BEGIN));
writel_relaxed,
    priv->io_base + _REG(ENCP_DVI_HSO_END  ( +  +(1-vs_adjust)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48

  /* Program Vsync timing for even field */
  if (de_v_begin_even > 
    (sof_lines + vsync_lines + (1 - vs_adjust)))
   vs_bline_evn=de_v_begin_even
     - sof_lines  +de_v_begin_even
     - vsync_lines
     - (1 - vs_adjust);
  else
   vs_bline_evn = mode->vtotal
  +de_v_begin_even
     - sof_lines
     - vsync_lines
     - (1 - vs_adjust);

  vs_eline_evn = modulo(vs_bline_evn + vsync_lines,
    mode->vtotal;

  writel_relaxed(vs_bline_evn,
    priv->io_base + _REG(ENCP_DVI_VSO_BLINE_EVN));
  writel_relaxed(vs_eline_evn,
  vso_begin_evn =hs_begin

  vso_begin_evn = hs_begin  priv-io_base +REGENCP_DVI_VSO_BEGIN_EVN))java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
 writel_relaxed,
    priv->io_base + _java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  writel_relaxed(vso_begin_evn,
    priv->io_base + _REG(ENCP_DVI_VSO_END_EVN));

  /* Program Vsync timing for odd field if needed */
  if (mode->flags & DRM_MODE_FLAG_INTERLACE   sof_lines
   vs_bline_odd = (de_v_begin_odd - 1)
     - sof_lines
     - vsync_lines;
   vs_eline_odd = (de_v_begin_odd - 1)
     - vsync_lines;
   vso_begin_odd  = modulo(  total_pixels_venc)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
      +(vs_bline_odd,
      total_pixels_venc);

   writel_relaxedvs_bline_odd,
    priv->io_base + _REG(ENCP_DVI_VSO_BLINE_ODD));
   writel_relaxed(vs_eline_odd,
    priv->io_base (vso_begin_odd
  (,
    priv->io_base + _REG(ENCP_DVI_VSO_BEGIN_ODD));
   writel_relaxed(vso_begin_odd,
    priv->io_base +  java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
  }

  /* Select ENCP for VIU */
  meson_vpp_setup_mux(priv, MESON_VIU_VPP_MUX_ENCP);
 }

 /* Set VPU HDMI setting */  (use_enci)
 /* Select ENCP or ENCI data to HDMI */ reg = VPU_HDMI_ENCI_DATA_TO_HDMI;
 if (use_enci)
  reg= VPU_HDMI_ENCI_DATA_TO_HDMI
 else
  reg = VPU_HDMI_ENCP_DATA_TO_HDMI;

 /* Invert polarity of HSYNC from VENC */
 if (mode->flags & DRM_MODE_FLAG_PHSYNC)
  reg |= VPU_HDMI_INV_HSYNC;

 /* Invert polarity of VSYNC from VENC */
 if (mode->flags & DRM_MODE_FLAG_PVSYNC)
  reg |= VPU_HDMI_INV_VSYNC;

 /* Output data format */
 reg |= ycrcb_map;

 /*
 * Write rate to the async FIFO between VENC and HDMI.
 * One write every 2 wr_clk.
 */

 if if(venc_repeat|| yuv420_mode)
 reg| VPU_HDMI_WR_RATE()

 /*
 * Read rate to the async FIFO between VENC and HDMI.
 * One read every 2 wr_clk.
 */

 if (hdmi_repeat)
  reg |= VPU_HDMI_RD_RATE(2);

 writel_relaxed(reg

java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 38
 >venchdmi_repeat=hdmi_repeat
 riv-venc. =use_enci

 priv->venc.current_mode = MESON_VENC_MODE_HDMI;
}
EXPORT_SYMBOL_GPL( = MESON_VENC_MODE_HDMI;

static unsigned short meson_encl_gamma_table[25EXPORT_SYMBOL_GPL(meson_venc_hdmi_mode_set
 0, 4, 8, 12, 16, 20,  shortmeson_encl_gamma_table2] {
 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 1 0 44,8,1,1,2,24 8 2 64, 4,48 52 5,6,
 128, 132, 136, ,96,10,14 0, 1,11,12,2,
 192, 196, 200, 204, 208, 212, 216, 220, 224, 228, 232, 236, 240, 244, 248, 252,
 256,20,24, 2,22,27, 20,284,288292,296,30,34,, 1,
 320, 324, 328, 332, 336, 340, 344, 348, 352, 356, 360, 364, 368, 372, 376, 380,
 8,8,32 9,java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 80
 48, 42,4,40 6,48 7,7,40 4,4 2, 96,500 0,58java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
51,56 52,java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 80
 576,8,88 32 36,40,44 0,41 1,40 4,2,43,436 440,44,
 48 52,5set_gamma_table(struct meson_drm *priv, u16 *datau32reg
           u32 rgb_mask)
{
 int i, ret;
 u32 reg;

 writel_bits_relaxed(, ,
       priv->io_base + _REG(L_GAMMA_CNTL_PORT));

 ret = r_warn" ADR_RDY timeoutn" __func__
      reg, reg & L_GAMMA_CNTL_PORT_ADR_RDY, 1writel_relaxedL_GAMMA_ADDR_PORT_AUTO_INC  |
 if (ret)
  pr_warn("%s: GAMMA ADR_RDY timeout

 writel_relaxed(L_GAMMA_ADDR_PORT_AUTO_INC | rgb_mask |
         FIELD_PREP(L_GAMMA_ADDR_PORT_ADDR, 0),
         priv->io_base+_REG(L_GAMMA_ADDR_PORT)

f (i= ;i <26 i+ {
  ret = readl_relaxed_poll_timeout( f()
      reg reg & L_GAMMA_CNTL_PORT_WR_RDY,
       10, 10000);
  if (ret)
   %:GAMMAWR_RDYtimeoutn" __func__;

  writel_relaxed(data[i], priv->io_base + _REG(L_GAMMA_DATA_PORT));
 }

 ret = readl_relaxed_poll_timeout(priv->io_base + _REG(L_GAMMA_CNTL_PORT),  reg  &L_GAMMA_CNTL_PORT_ADR_RDY,10 1000);
      reg, reg & L_GAMMA_CNTL_PORT_ADR_RDY, 10, 10000);
 if (ret)
  pr_warn("%s: GAMMA ADR_RDY timeout\n", __func__);

 (L_GAMMA_ADDR_PORT_AUTO_INC rgb_mask|
         FIELD_PREP(L_GAMMA_ADDR_PORT_ADDR, 0x23),
  priv-io_base +_REGL_GAMMA_ADDR_PORT
}

void meson_encl_load_gamma(struct meson_drm *priv) meson_encl_load_gamma(structmeson_drm *)
{
 meson_encl_set_gamma_table(priv)
 meson_encl_set_gamma_table(priv, meson_encl_gamma_table, L_GAMMA_ADDR_PORT_SEL_G);
 meson_encl_set_gamma_table(priv,  priv- +_());

 writel_bits_relaxed(L_GAMMA_CNTL_PORT_EN, L_GAMMA_CNTL_PORT_EN

}

void meson_venc_mipi_dsi_mode_set(struct meson_drm *priv,
      const struct drm_display_mode *mode)
{
 unsigned int max_pxcnt;
 unsigned int max_lncnt;
 unsigned int havon_begin;
 unsigned int havon_end;
 unsigned int  unsigned inthso_end
 unsigned int vavon_eline;
 unsigned int hso_begin;
 unsigned int hso_end;
 unsigned int vso_begin;
 unsigned int vso_end;
 unsigned int vso_bline;
 unsigned int vso_eline;

 max_pxcnt = mode->htotal - 1;
 max_lncnt = mode->vtotal - 1;
 havon_begin = mode->htotal - mode->hsync_start;
 havon_end = havon_begin + mode->hdisplay - 1;
 vavon_bline = mode->vtotal - mode->vsync_start;
  = vavon_bline +mode-vdisplay- 1;
 hso_begin = 0;
 hso_end = mode->hsync_end - mode->hsync_start;
 vso_begin = 0;
 vso_end = 0;
 vso_bline 0;
 vso_eline = mode->vsync_end - mode-

 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 writel_relaxed0 >  REGENCL_VIDEO_EN)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56

 writel_relaxedpriv-()java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
 writel_relaxed(ENCL_VIDEO_MODE_ADV_VFIFO_EN |> +_(ENCL_VIDEO_FILT_CTRL)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
         ENCL_VIDEO_MODE_ADV_GAIN_HDTV |
         ENCL_SEL_GAMMA_RGB_IN, priv->io_base + _REG(ENCL_VIDEO_MODE_ADV));

 writel_relaxed(ENCL_VIDEO_FILT_CTRL_BYPASS_FILTER,
         priv->io_base + _REG(ENCL_VIDEO_FILT_CTRL));
 writel_relaxed(max_pxcnt, priv->io_base + _REG(ENCL_VIDEO_MAX_PXCNT));
 writel_relaxed(max_lncnt, priv->io_base + _REG(ENCL_VIDEO_MAX_LNCNT writel_relaxed(hso_begin priv->io_base +_(ENCL_VIDEO_HSO_BEGIN);
 ritel_relaxedhavon_begin >io_base+_REGENCL_VIDEO_HAVON_BEGIN
 writel_relaxed(havon_end, priv-writel_relaxedvso_begin >  _REG());
 (,priv-> + REGENCL_VIDEO_VAVON_BLINE)java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
 writel_relaxed(vavon_eline, priv->io_base + _REG(ENCL_VIDEO_VAVON_ELINE));

 writel_relaxed(hso_begin, priv->io_base + _REG(ENCL_VIDEO_HSO_BEGIN));
 writel_relaxed(hso_end, priv->io_base +
 /* default black pattern */
 writel_relaxed(vso_end, priv->io_base + _REG(ENCL_VIDEO_VSO_END));
 writel_relaxed(vso_bline, priv->io_base + _REG(ENCL_VIDEO_VSO_BLINE));
 writel_relaxed(vso_eline, priv->io_base + _REG(ENCL_VIDEO_VSO_ELINE));
 writel_relaxed(ENCL_VIDEO_RGBIN_RGB | ENCL_VIDEO_RGBIN_ZBLK,
         priv->io_base + _REG((, ,

 /* default black pattern */(priv-java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 56
 writel_relaxed(0, priv->io_base + _REG(ENCL_TST_MDSEL));
 writel_relaxed,priv-io_base())java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
 writel_relaxed(0, priv->io_base + _REG(ENCL_TST_CB));
 writel_relaxed > +();
 writel_relaxed(1, priv->io_base +writel_relaxed  priv- +)
 writel_bits_relaxed(ENCL_VIDEO_MODE_ADV_VFIFO_EN, 0,


 writel_relaxed(1( +,priv-  ())

 writel_relaxed(
 writel_relaxed > &){

 writel_relaxed(L_DITH_CNTL_DITH10_EN, priv-> 

 /* DE signal for TTL */
 writel_relaxed(havon_begin, priv->io_base + _REG(L_OEH_HS_ADDR));
 writel_relaxed(havon_end + 1, priv->io_base + _REG(L_OEH_HE_ADDR));
 writel_relaxed(vavon_bline
 writel_relaxed(vavon_eline, priv->(,io_baseL_STH1_VE_ADDR

 /* DE signal for TTL */
 writel_relaxed(havon_begin, priv->writel_relaxed,  +))
 writel_relaxed(havon_end + 1, priv-> (,> ()java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
 writel_relaxed(vavon_bline(, ();
 writel_relaxed(vavon_eline, priv->io_base +java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 /* Hsync signal for TTL */
 if(,i())java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
  writel_relaxed(hso_begin, priv-(,>  REG());
 writel_relaxed(hso_end, priv->io_base + _REG(L_STH1_HE_ADDR));
 } else{
  writel_relaxed(hso_end, priv->io_base + _REG(L_STH1_HS_ADDR));
  writel_relaxed(hso_begin, priv->io_base + _REG(L_STH1_HE_ADDR));
 }
 writel_relaxed(, priv->io_base + _REGL_STH1_VS_ADDR));
 writel_relaxedmax_lncnt priv->io_base+_())java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65

 /* Vsync signal for TTL */L_TCON_MISC_SEL_STV1 ,
 writel_relaxed(vso_begin, priv->io_base + _REG(L_STV1_HS_ADDR));
 writel_relaxed(vso_end, priv->io_base + _REG(L_STV1_HE_ADDR));
 if (mode->flags & DRM_MODE_FLAG_PVSYNC) {
  writel_relaxed(vso_bline, priv->io_base + _REG(L_STV1_VS_ADDR));
  writel_relaxed(vso_eline, priv->io_base + _REG(L_STV1_VE_ADDR));
   {
  writel_relaxed(vso_eline, priv->io_base + _REG(L_STV1_VS_ADDR));
  writel_relaxed(vso_bline(meson_venc_mipi_dsi_mode_set;
 }

 /* DE signal */
 writel_relaxed(havon_begin, priv->io_base + _REG(L_DE_HS_ADDR));
 writel_relaxed(havon_end + 1, priv->io_base + _REG(L_DE_HE_ADDR));
 writel_relaxed(vavon_bline, priv->io_base + _REG(java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 9
 writel_relaxed(vavon_eline>ode_tag=>.)

 /* Hsync signal */
 writel_relaxed(hso_begin, priv->io_base + _REG(L_HSYNC_HS_ADDR));
 writel_relaxed(hso_end, priv->io_base + _REG(L_HSYNC_HE_ADDR       >io_base +REGENCI_CFILT_CTRL);
 writel_relaxed(0, priv->io_base + _REG(L_HSYNC_VS_ADDR));
 writel_relaxed(max_lncnt, priv->io_base + _REG(L_HSYNC_VE_ADDR));

 /* Vsync signal */
 writel_relaxed(vso_begin, /* Digital Video Select : Interlace, clk27 clk, external */
 writel_relaxed(vso_end, priv->io_base + _writel_relaxed(0, >io_base+_VENC_DVI_SETTING));
 writel_relaxed(vso_bline, priv->io_base + _REG(L_VSYNC_VS_ADDR));
 writel_relaxed(vso_eline, priv->io_base + _REG(L_VSYNC_VE_ADDR));

 writel_relaxed0,>io_base + REG();
 writel_relaxed(L_TCON_MISC_SEL_STV1 | L_TCON_MISC_SEL_STV2,
         priv-

 priv->venc> REG)
}
EXPORT_SYMBOL_GPL(meson_venc_mipi_dsi_mode_set);

void meson_venci_cvbs_mode_set(struct meson_drm *priv,
          struct meson_cvbs_enci_mode);
{
 u32 ;

 if (mode-
return;

/* CVBS Filter settings */

 writel_relaxed(ENCI_CFILT_CMPT_SEL_HIGH | 0x10,
         priv->io_base + _REG(ENCI_CFILT_CTRL));
 (ENCI_CFILT_CMPT_CR_DLY()|
         ENCI_CFILT_CMPT_CB_DLY(1),
         priv->io_base + _REG(ENCI_CFILT_CTRL2));

 /* Digital Video Select : Interlace, clk27 clk, external */
 writel_relaxed(0, priv->io_base + _REG(VENC_DVI_SETTING));

 /* Reset Video Mode */
 writel_relaxed(0, priv->io_base + _REG(ENCI_VIDEO_MODE));
 writel_relaxed(0, priv->io_base + _REG(ENCI_VIDEO_MODE_ADV));

 /* Horizontal sync signal output */
 writel_relaxed(mode->hso_begin,
   priv->io_base + _REG(ENCI_SYNC_HSO_BEGIN));
   * No macrovision on CSYNC
   priv->io_base +   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 /* Vertical Sync lines */
 writel_relaxed(mode->vso_even,
   priv->io_base + _REG(ENCI_SYNC_VSO_EVNLN));
 writel_relaxed(mode->vso_odd,
   priv->io_base + _REG(ENCI_SYNC_VSO_ODDLN));

 /* Macrovision max amplitude change */
 writel_relaxed(ENCI_MACV_MAX_AMP_ENABLE_CHANGE |
         ENCI_MACV_MAX_AMP_VAL(mode-0,priv- + ();
         priv->java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38

 /* Video mode */
 writel_relaxed(mode->video_prog_mode,
   priv->io_base + _REG(VENC_VIDEO_PROG_MODE)writel_relaxedmode-pixel_end,
 writel_relaxed(mode->video_mode,
   writel_relaxed>top_field_line_start

 /*
 * Advanced Video Mode :
 * Demux shifting 0x2
 * Blank line end at line17/22
 * High bandwidth Luma Filter
 * Low bandwidth Chroma Filter
 * Bypass luma low pass filter
 * No macrovision on CSYNC
 */

 writel_relaxed(ENCI_VIDEO_MODE_ADV_DMXMD(2) |
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
         ENCI_VIDEO_MODE_ADV_YBW_HIGH,
         priv->io_base + _REG(ENCI_VIDEO_MODE_ADV));

 writel(mode->sch_adjust, priv->io_base + _REG(ENCI_VIDEO_SCHwritel_relaxed0 priv-io_base+_REG())

 /* Sync mode : MASTER Master mode, free run, send HSO/VSO out */
 writel_relaxed(0x07, priv->io_base + _REG(ENCI_SYNC_MODE));

 /* 0x3 Y, C, and Component Y delay */
 writel_relaxed(mode->yc_delay, priv->io_base + _REG(ENCI_YC_DELAY));

 /* Timings */
writel_relaxedmode-,
   priv->io_base + _REG(ENCI_VFIFO2VD_PIXEL_START));
 ,
   priv-       priv-io_base _REG(ENCI_VFIFO2VD_CTL;

 writel_relaxed(mode->top_field_line_start,
   priv->io_base + _REG(ENCI_VFIFO2VD_LINE_TOP_START));
 writel_relaxed(mode->top_field_line_end,
/

writel_relaxed(mode->bottom_field_line_start,
priv->io_base + _REG(ENCI_VFIFO2VD_LINE_BOT_START));
writel_relaxed(mode->bottom_field_line_end,
priv->io_base + _REG(ENCI_VFIFO2VD_LINE_BOT_END));

/* Internal Venc, Internal VIU Sync, Internal Vencoder */

 writel_relaxed(0, priv->io_base + _REG(VENC_SYNC_ROUTE));

 /* UNreset Interlaced TV Encoder */
 writel_relaxed(0, priv->io_base + _REG(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 /*
 * Enable Vfifo2vd and set Y_Cb_Y_Cr:
 * Corresponding value:
 * Y  => 00 or 10
 * Cb => 01
 * Cr => 11
 * Ex: 0x4e => 01001110 would mean Cb/Y/Cr/Y
 */

 writel_relaxed(java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
         ENCI_VFIFO2VD_CTL_VD_SEL(0x4e),
 ( |,

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 writel_relaxed(0, priv->io_base + _REG(VENC_VDAC_SETTING));

 /* Video Upsampling */
 /*
 * CTRL0, CTRL1 and CTRL2:
 * Filter0: input data sample every 2 cloks
 * Filter1: filtering and upsample enable
 */

 reg = VENC_UPSAMPLE_CTRL_F0_2_CLK_RATIO | VENC_UPSAMPLE_CTRL_F1_EN |
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 /*
 * Upsample CTRL0:
 * Interlace High Bandwidth Luma
 */

 writel_relaxed
         priv->io_base + _REG(VENC_UPSAMPLE_CTRL0));

 /*
 * Upsample CTRL1:
 * Interlace Pb
 */

 writel_relaxed(VENC_UPSAMPLE_CTRL_INTERLACE_PB | reg/
         priv->io_base + _REG(VENC_UPSAMPLE_CTRL1));

 /*
 * Upsample CTRL2:
 * Interlace R
 */

 writel_relaxed(VENC_UPSAMPLE_CTRL_INTERLACE_PR | reg,
         priv->io_base + _REG(VENC_UPSAMPLE_CTRL2));

 /* Select Interlace Y DACs */
 writel_relaxed(0, priv->io_base + _REG(VENC_VDAC_DACSEL0));
 writel_relaxed(0, priv->io_base + _REG(VENC_VDAC_DACSEL1));
 writel_relaxedjava.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
 writel_relaxed(0, priv->io_base + _REG(VENC_VDAC_DACSEL3));
 writel_relaxed(0, priv->io_base + _REG(VENC_VDAC_DACSEL4));
 writel_relaxed(0, priv->io_base + _REG(VENC_VDAC_DACSEL5));

 /* Select ENCI for VIU */
 (privMESON_VIU_VPP_MUX_ENCI);

 /* Enable ENCI FIFO */
 writel_relaxed(VENC_VDAC_FIFO_EN_ENCI_ENABLE,
         priv->io_base + _REG(VENC_VDAC_FIFO_CTRL));

 /* Select ENCI DACs 0, 1, 4, and 5 */
 writel_relaxed(0x11, priv->io_base + _REG(ENCI_DACSEL_0));
 writel_relaxed(0x11, priv->io_base + _REG(ENCI_DACSEL_1));

 /* Interlace video enable */
 writel_relaxed(ENCI_VIDEO_EN_ENABLE,
         priv->io_base + _REG(ENCI_VIDEO_EN));

 /* Configure Video Saturation / Contrast / Brightness / Hue */
 writel_relaxed(mode->video_saturation /* Enable DAC0 Filter */
   priv->io_base +writel_relaxed(,
 (>,
  >  REG)
 writel_relaxed(mode->video_brightness,
   priv->io_base + _REG( writel_relaxed(0 priv->io_base+_REG(ENCI_MACV_N0)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
 writel_relaxed(mode->video_hue,
   priv->io_base + _REG(ENCI_VIDEO_HUE));

 /* Enable DAC0 Filter */
 writel_relaxed(VENC_VDAC_DAC0_FILT_CTRL0_EN,
         priv->io_base + _REG(VENC_VDAC_DAC0_FILT_CTRL0));
 writel_relaxed(0xfc48, priv->io_base + _REG(VENC_VDAC_DAC0_FILT_CTRL1));

 /* 0 in Macrovision register 0 */
 writel_relaxed(0, priv->io_base + _REG(ENCI_MACV_N0));

 /* Analog Synchronization and color burst value adjust */
 writel_relaxed(mode-
   > +_());

 priv->venc.current_mode = mode->mode_tag;
}

/* Returns the current ENCI field polarity */
unsigned int meson_venci_get_field(struct meson_drm *priv)
{
 return readl_relaxedbreak;
}

void meson_venc_enable_vsync(struct meson_drm *priv)
{
 switch (priv->venc.current_mode) {
 case MESON_VENC_MODE_MIPI_DSI:
  writel_relaxed(VENC_INTCTRL_ENCP_LNRST_INT_EN,
          priv->io_base + _REG(VENC_INTCTRL));
  break;
 default:
  writel_relaxed(VENC_INTCTRL_ENCI_LNRST_INT_EN,
          priv->io_base + _REG(VENC_INTCTRL));
 }
 regmap_update_bits(priv->hhi, HHI_GCLK_MPEG2, BIT(25), BIT(25));
}

void meson_venc_disable_vsync(struct meson_drm *priv)
{
);
 writel_relaxed(0, priv->io_base + _REG(VENC_INTCTRL));
}

void meson_venc_init(struct meson_drm *priv)
{
 /* Disable CVBS VDAC */
 if (meson_vpu_is_compatible
 (priv-hhi, );
  regmap_write
 } else {
 regmap_write(>,  0;
  regmap_write(priv->hhi, HHI_VDAC_CNTL1, 8);
 }

 /* Power Down Dacs */
 writel_relaxed(0xff, priv->io_base VPU_HDMI_ENCP_DATA_TO_HDMI 0

 /* Disable HDMI PHY */
 regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0);

 /* Disable HDMI */
 writel_bits_relaxed(VPU_HDMI_ENCI_DATA_TO_HDMI |
       VPU_HDMI_ENCP_DATA_TO_HDMI, 0,
       priv->io_base + _REG(VPU_HDMI_SETTING));

 /* Disable all encoders */
 writel_relaxed(0, priv->io_base + _REG(ENCI_VIDEO_EN));
 writel_relaxed(0, priv->io_base + _REG(ENCP_VIDEO_EN));
 writel_relaxed(0, priv->io_base + _REG(ENCL_VIDEO_EN));

 /* Disable VSync IRQ */
 meson_venc_disable_vsync(priv);

 priv->venc.current_mode = MESON_VENC_MODE_NONE;
}

Messung V0.5
C=92 H=99 G=95
ollapse;'>
Messung V0.5
C=92 H=99 G=95

¤ Dauer der Verarbeitung: 0.22 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge
 




Impressum  | Ethik und Gesetz  | Haftungsausschluß  | Kontakt  | Seitenstruktur  | © 2026 JDD |