updated exynos-drm-next
Subsystems (3)
Inki Dae
maintainercover updated exynos-drm-next
Hi, Dave and all.
this patch set includes the following features.
- add HDMI version 1.4 support.
- add mode_fixup feature.
. hdmi module would change current mode to driver desired mode properly.
- add buffer alloction type.
. we can allocate physically continuous or non-continuous
memory and also it creates scatterlist for iommu support so allocated memory region can be mapped to iommu page table using scatterlist.
- add dma address get/put interface.
. this function would be used for drm based 2d acceleration driver
to get/put dma address through gem handle.
when exynos_drm_get_dma_address is called reference count of gem object would be increased not to be released by gem close and when exynos_drm_put_dma_address is called the reference count of this gem object would be decreased to be released.
- add virtual display driver.
. this driver would be used for wireless display.
- add direct rendering based 2d graphics acceleration module.
. exynos SoC chip has fimg2d named 2d graphics accelerator and this driver
supports only exynos4x12 series.
this patch set is based on git repository below:git://git.infradead.org/users/kmpark/linux-samsung exynos-drm-fixes
commit-id: f6d69d1e77509d71c29f2a7b119214b8fdf86ae2
and exynos-drm-fixes is based on git repository below:git://people.freedesktop.org/~airlied/linux.git drm-fixes
commit-id: 38aa4a568ba4c3ccba83e862a01e3e60e3b811ee
P.S.
drm-next doesn't reflect updated latest codes of mainline so this patch set should be merged to drm-next after latest mainline codes are merged to drm-next. now is just for review and if latest codes are merged to drm-next then I will merge this patch set to exynos-drm-next for git pull request.
Thanks.
Inki Dae (5):
drm/exynos: add HDMI version 1.4 support drm/exynos: added mode_fixup feature and code clean. drm/exynos: added buffer allocation type. drm/exynos: added new funtion to get/put dma address. drm/exynos: added virtual display driver.
Joonyoung Shim (5):
drm/exynos: release pending pageflip events when closed drm/exynos: remove module of exynos drm subdrv drm/exynos: add subdrv open/close functions drm/exynos: add is_local member in exynos_drm_subdrv struct drm/exynos: add G2D driver
drivers/gpu/drm/exynos/Kconfig | 20 +- drivers/gpu/drm/exynos/Makefile | 12 +- drivers/gpu/drm/exynos/exynos_ddc.c | 1 - drivers/gpu/drm/exynos/exynos_drm_buf.c | 152 +++- drivers/gpu/drm/exynos/exynos_drm_buf.h | 4 +- drivers/gpu/drm/exynos/exynos_drm_connector.c | 35 +- drivers/gpu/drm/exynos/exynos_drm_core.c | 140 +-- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 12 +- drivers/gpu/drm/exynos/exynos_drm_drv.c | 125 +++- drivers/gpu/drm/exynos/exynos_drm_drv.h | 49 +- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 24 +- drivers/gpu/drm/exynos/exynos_drm_fb.c | 6 - drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 90 +-- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 20 +- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 864 +++++++++++++++++ drivers/gpu/drm/exynos/exynos_drm_g2d.h | 36 + drivers/gpu/drm/exynos/exynos_drm_gem.c | 346 +++++++- drivers/gpu/drm/exynos/exynos_drm_gem.h | 29 +- drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 115 +-- drivers/gpu/drm/exynos/exynos_drm_hdmi.h | 5 + drivers/gpu/drm/exynos/exynos_drm_vidi.c | 677 ++++++++++++++ drivers/gpu/drm/exynos/exynos_drm_vidi.h | 36 + drivers/gpu/drm/exynos/exynos_hdmi.c | 1234 ++++++++++++++++++++++--- drivers/gpu/drm/exynos/exynos_hdmi.h | 10 +- drivers/gpu/drm/exynos/exynos_mixer.c | 7 - drivers/gpu/drm/exynos/regs-hdmi.h | 306 ++++++- include/drm/exynos_drm.h | 84 ++ 27 files changed, 3879 insertions(+), 560 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_g2d.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_g2d.h create mode 100644 drivers/gpu/drm/exynos/exynos_drm_vidi.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_vidi.h
Signature · 1 line
1.7.4.1
Inki Dae
maintainerPATCH 1/10 drm/exynos: add HDMI version 1.4 support
Later Exynos series from Exynos4X12 support HDMI version 1.4. We will distinguish to use which version via platform data.
--- drivers/gpu/drm/exynos/exynos_hdmi.c | 1152 +++++++++++++++++++++++++++++++--- drivers/gpu/drm/exynos/exynos_hdmi.h | 10 +- drivers/gpu/drm/exynos/regs-hdmi.h | 306 ++++++++-- include/drm/exynos_drm.h | 2 + 4 files changed, 1325 insertions(+), 145 deletions(-)
drivers/gpu/drm/exynos/exynos_hdmi.c +1053 -99
@@ -43,42 +43,43 @@#define HDMI_OVERLAY_NUMBER 3#define get_hdmi_context (dev) platform_get_drvdata(to_platform_device(dev)) -static const u8 hdmiphy_conf27[32 ] = { +/* HDMI Version 1.3 */ +static const u8 hdmiphy_v13_conf27[32 ] = {0x01 ,0x05 ,0x00 ,0xD8 ,0x10 ,0x1C ,0x30 ,0x40 ,0x6B ,0x10 ,0x02 ,0x51 ,0xDF ,0xF2 ,0x54 ,0x87 ,0x84 ,0x00 ,0x30 ,0x38 ,0x00 ,0x08 ,0x10 ,0xE0 ,0x22 ,0x40 ,0xE3 ,0x26 ,0x00 ,0x00 ,0x00 ,0x00 , }; -static const u8 hdmiphy_conf27_027[32 ] = { +static const u8 hdmiphy_v13_conf27_027[32 ] = {0x01 ,0x05 ,0x00 ,0xD4 ,0x10 ,0x9C ,0x09 ,0x64 ,0x6B ,0x10 ,0x02 ,0x51 ,0xDF ,0xF2 ,0x54 ,0x87 ,0x84 ,0x00 ,0x30 ,0x38 ,0x00 ,0x08 ,0x10 ,0xE0 ,0x22 ,0x40 ,0xE3 ,0x26 ,0x00 ,0x00 ,0x00 ,0x00 , }; -static const u8 hdmiphy_conf74_175[32 ] = { +static const u8 hdmiphy_v13_conf74_175[32 ] = {0x01 ,0x05 ,0x00 ,0xD8 ,0x10 ,0x9C ,0xef ,0x5B ,0x6D ,0x10 ,0x01 ,0x51 ,0xef ,0xF3 ,0x54 ,0xb9 ,0x84 ,0x00 ,0x30 ,0x38 ,0x00 ,0x08 ,0x10 ,0xE0 ,0x22 ,0x40 ,0xa5 ,0x26 ,0x01 ,0x00 ,0x00 ,0x00 , }; -static const u8 hdmiphy_conf74_25[32 ] = { +static const u8 hdmiphy_v13_conf74_25[32 ] = {0x01 ,0x05 ,0x00 ,0xd8 ,0x10 ,0x9c ,0xf8 ,0x40 ,0x6a ,0x10 ,0x01 ,0x51 ,0xff ,0xf1 ,0x54 ,0xba ,0x84 ,0x00 ,0x10 ,0x38 ,0x00 ,0x08 ,0x10 ,0xe0 ,0x22 ,0x40 ,0xa4 ,0x26 ,0x01 ,0x00 ,0x00 ,0x00 , }; -static const u8 hdmiphy_conf148_5[32 ] = { +static const u8 hdmiphy_v13_conf148_5[32 ] = {0x01 ,0x05 ,0x00 ,0xD8 ,0x10 ,0x9C ,0xf8 ,0x40 ,0x6A ,0x18 ,0x00 ,0x51 ,0xff ,0xF1 ,0x54 ,0xba ,0x84 ,0x00 ,0x10 ,0x38 ,0x00 ,0x08 ,0x10 ,0xE0 ,0x22 ,0x40 ,0xa4 ,0x26 ,0x02 ,0x00 ,0x00 ,0x00 , }; -struct hdmi_tg_regs { +struct hdmi_v13_tg_regs {u8 cmd;u8 h_fsz_l;u8 h_fsz_h;
@@ -110,7 +111,7 @@ struct hdmi_tg_regs {u8 field_bot_hdmi_h; }; -struct hdmi_core_regs { +struct hdmi_v13_core_regs {u8 h_blank[2 ];u8 v_blank[3 ];u8 h_v_line[3 ];
@@ -123,12 +124,21 @@ struct hdmi_core_regs {u8 v_sync_gen3[3 ]; }; -struct hdmi_preset_conf { -struct hdmi_core_regs core; -struct hdmi_tg_regs tg; +struct hdmi_v13_preset_conf { +struct hdmi_v13_core_regs core; +struct hdmi_v13_tg_regs tg; +}; + +struct hdmi_v13_conf { +int width; +int height; +int vrefresh; +bool interlace; +const u8 *hdmiphy_data; +const struct hdmi_v13_preset_conf *conf; }; -static const struct hdmi_preset_conf hdmi_conf_480p = { +static const struct hdmi_v13_preset_conf hdmi_v13_conf_480p = { .core = { .h_blank = {0x8a ,0x00 }, .v_blank = {0x0d ,0x6a ,0x01 },
@@ -154,7 +164,7 @@ static const struct hdmi_preset_conf hdmi_conf_480p = { }, }; -static const struct hdmi_preset_conf hdmi_conf_720p60 = { +static const struct hdmi_v13_preset_conf hdmi_v13_conf_720p60 = { .core = { .h_blank = {0x72 ,0x01 }, .v_blank = {0xee ,0xf2 ,0x00 },
@@ -182,7 +192,7 @@ static const struct hdmi_preset_conf hdmi_conf_720p60 = { }, }; -static const struct hdmi_preset_conf hdmi_conf_1080i50 = { +static const struct hdmi_v13_preset_conf hdmi_v13_conf_1080i50 = { .core = { .h_blank = {0xd0 ,0x02 }, .v_blank = {0x32 ,0xB2 ,0x00 },
@@ -210,7 +220,7 @@ static const struct hdmi_preset_conf hdmi_conf_1080i50 = { }, }; -static const struct hdmi_preset_conf hdmi_conf_1080p50 = { +static const struct hdmi_v13_preset_conf hdmi_v13_conf_1080p50 = { .core = { .h_blank = {0xd0 ,0x02 }, .v_blank = {0x65 ,0x6c ,0x01 },
@@ -238,7 +248,7 @@ static const struct hdmi_preset_conf hdmi_conf_1080p50 = { }, }; -static const struct hdmi_preset_conf hdmi_conf_1080i60 = { +static const struct hdmi_v13_preset_conf hdmi_v13_conf_1080i60 = { .core = { .h_blank = {0x18 ,0x01 }, .v_blank = {0x32 ,0xB2 ,0x00 },
@@ -266,7 +276,7 @@ static const struct hdmi_preset_conf hdmi_conf_1080i60 = { }, }; -static const struct hdmi_preset_conf hdmi_conf_1080p60 = { +static const struct hdmi_v13_preset_conf hdmi_v13_conf_1080p60 = { .core = { .h_blank = {0x18 ,0x01 }, .v_blank = {0x65 ,0x6c ,0x01 },
@@ -294,13 +304,530 @@ static const struct hdmi_preset_conf hdmi_conf_1080p60 = { }, }; +static const struct hdmi_v13_conf hdmi_v13_confs[] = { + {1280 ,720 ,60 , false, hdmiphy_v13_conf74_25, &hdmi_v13_conf_720p60 }, + {1280 ,720 ,50 , false, hdmiphy_v13_conf74_25, &hdmi_v13_conf_720p60 }, + {720 ,480 ,60 , false, hdmiphy_v13_conf27_027, &hdmi_v13_conf_480p }, + {1920 ,1080 ,50 , true, hdmiphy_v13_conf74_25, &hdmi_v13_conf_1080i50 }, + {1920 ,1080 ,50 , false, hdmiphy_v13_conf148_5, + &hdmi_v13_conf_1080p50 }, + {1920 ,1080 ,60 , true, hdmiphy_v13_conf74_25, &hdmi_v13_conf_1080i60 }, + {1920 ,1080 ,60 , false, hdmiphy_v13_conf148_5, + &hdmi_v13_conf_1080p60 }, +}; + +/* HDMI Version 1.4 */ +static const u8 hdmiphy_conf27_027[32 ] = { +0x01 ,0xd1 ,0x2d ,0x72 ,0x40 ,0x64 ,0x12 ,0x08 , +0x43 ,0xa0 ,0x0e ,0xd9 ,0x45 ,0xa0 ,0xac ,0x80 , +0x08 ,0x80 ,0x11 ,0x04 ,0x02 ,0x22 ,0x44 ,0x86 , +0x54 ,0xe3 ,0x24 ,0x00 ,0x00 ,0x00 ,0x01 ,0x00 , +}; + +static const u8 hdmiphy_conf74_25[32 ] = { +0x01 ,0xd1 ,0x1f ,0x10 ,0x40 ,0x40 ,0xf8 ,0x08 , +0x81 ,0xa0 ,0xba ,0xd8 ,0x45 ,0xa0 ,0xac ,0x80 , +0x3c ,0x80 ,0x11 ,0x04 ,0x02 ,0x22 ,0x44 ,0x86 , +0x54 ,0xa5 ,0x24 ,0x01 ,0x00 ,0x00 ,0x01 ,0x00 , +}; + +static const u8 hdmiphy_conf148_5[32 ] = { +0x01 ,0xd1 ,0x1f ,0x00 ,0x40 ,0x40 ,0xf8 ,0x08 , +0x81 ,0xa0 ,0xba ,0xd8 ,0x45 ,0xa0 ,0xac ,0x80 , +0x3c ,0x80 ,0x11 ,0x04 ,0x02 ,0x22 ,0x44 ,0x86 , +0x54 ,0x4b ,0x25 ,0x03 ,0x00 ,0x00 ,0x01 ,0x00 , +}; + +struct hdmi_tg_regs { +u8 cmd; +u8 h_fsz_l; +u8 h_fsz_h; +u8 hact_st_l; +u8 hact_st_h; +u8 hact_sz_l; +u8 hact_sz_h; +u8 v_fsz_l; +u8 v_fsz_h; +u8 vsync_l; +u8 vsync_h; +u8 vsync2_l; +u8 vsync2_h; +u8 vact_st_l; +u8 vact_st_h; +u8 vact_sz_l; +u8 vact_sz_h; +u8 field_chg_l; +u8 field_chg_h; +u8 vact_st2_l; +u8 vact_st2_h; +u8 vact_st3_l; +u8 vact_st3_h; +u8 vact_st4_l; +u8 vact_st4_h; +u8 vsync_top_hdmi_l; +u8 vsync_top_hdmi_h; +u8 vsync_bot_hdmi_l; +u8 vsync_bot_hdmi_h; +u8 field_top_hdmi_l; +u8 field_top_hdmi_h; +u8 field_bot_hdmi_l; +u8 field_bot_hdmi_h; +u8 tg_3d; +}; + +struct hdmi_core_regs { +u8 h_blank[2 ]; +u8 v2_blank[2 ]; +u8 v1_blank[2 ]; +u8 v_line[2 ]; +u8 h_line[2 ]; +u8 hsync_pol[1 ]; +u8 vsync_pol[1 ]; +u8 int_pro_mode[1 ]; +u8 v_blank_f0[2 ]; +u8 v_blank_f1[2 ]; +u8 h_sync_start[2 ]; +u8 h_sync_end[2 ]; +u8 v_sync_line_bef_2[2 ]; +u8 v_sync_line_bef_1[2 ]; +u8 v_sync_line_aft_2[2 ]; +u8 v_sync_line_aft_1[2 ]; +u8 v_sync_line_aft_pxl_2[2 ]; +u8 v_sync_line_aft_pxl_1[2 ]; +u8 v_blank_f2[2 ];/* for 3D mode */ +u8 v_blank_f3[2 ];/* for 3D mode */ +u8 v_blank_f4[2 ];/* for 3D mode */ +u8 v_blank_f5[2 ];/* for 3D mode */ +u8 v_sync_line_aft_3[2 ]; +u8 v_sync_line_aft_4[2 ]; +u8 v_sync_line_aft_5[2 ]; +u8 v_sync_line_aft_6[2 ]; +u8 v_sync_line_aft_pxl_3[2 ]; +u8 v_sync_line_aft_pxl_4[2 ]; +u8 v_sync_line_aft_pxl_5[2 ]; +u8 v_sync_line_aft_pxl_6[2 ]; +u8 vact_space_1[2 ]; +u8 vact_space_2[2 ]; +u8 vact_space_3[2 ]; +u8 vact_space_4[2 ]; +u8 vact_space_5[2 ]; +u8 vact_space_6[2 ]; +}; + +struct hdmi_preset_conf { +struct hdmi_core_regs core; +struct hdmi_tg_regs tg; +}; + +struct hdmi_conf { +int width; +int height; +int vrefresh; +bool interlace; +const u8 *hdmiphy_data; +const struct hdmi_preset_conf *conf; +}; + +static const struct hdmi_preset_conf hdmi_conf_480p60 = { + .core = { + .h_blank = {0x8a ,0x00 }, + .v2_blank = {0x0d ,0x02 }, + .v1_blank = {0x2d ,0x00 }, + .v_line = {0x0d ,0x02 }, + .h_line = {0x5a ,0x03 }, + .hsync_pol = {0x01 }, + .vsync_pol = {0x01 }, + .int_pro_mode = {0x00 }, + .v_blank_f0 = {0xff ,0xff }, + .v_blank_f1 = {0xff ,0xff }, + .h_sync_start = {0x0e ,0x00 }, + .h_sync_end = {0x4c ,0x00 }, + .v_sync_line_bef_2 = {0x0f ,0x00 }, + .v_sync_line_bef_1 = {0x09 ,0x00 }, + .v_sync_line_aft_2 = {0xff ,0xff }, + .v_sync_line_aft_1 = {0xff ,0xff }, + .v_sync_line_aft_pxl_2 = {0xff ,0xff }, + .v_sync_line_aft_pxl_1 = {0xff ,0xff }, + .v_blank_f2 = {0xff ,0xff }, + .v_blank_f3 = {0xff ,0xff }, + .v_blank_f4 = {0xff ,0xff }, + .v_blank_f5 = {0xff ,0xff }, + .v_sync_line_aft_3 = {0xff ,0xff }, + .v_sync_line_aft_4 = {0xff ,0xff }, + .v_sync_line_aft_5 = {0xff ,0xff }, + .v_sync_line_aft_6 = {0xff ,0xff }, + .v_sync_line_aft_pxl_3 = {0xff ,0xff }, + .v_sync_line_aft_pxl_4 = {0xff ,0xff }, + .v_sync_line_aft_pxl_5 = {0xff ,0xff }, + .v_sync_line_aft_pxl_6 = {0xff ,0xff }, + .vact_space_1 = {0xff ,0xff }, + .vact_space_2 = {0xff ,0xff }, + .vact_space_3 = {0xff ,0xff }, + .vact_space_4 = {0xff ,0xff }, + .vact_space_5 = {0xff ,0xff }, + .vact_space_6 = {0xff ,0xff }, +/* other don't care */ + }, + .tg = { +0x00 ,/* cmd */ +0x5a ,0x03 ,/* h_fsz */ +0x8a ,0x00 ,0xd0 ,0x02 ,/* hact */ +0x0d ,0x02 ,/* v_fsz */ +0x01 ,0x00 ,0x33 ,0x02 ,/* vsync */ +0x2d ,0x00 ,0xe0 ,0x01 ,/* vact */ +0x33 ,0x02 ,/* field_chg */ +0x48 ,0x02 ,/* vact_st2 */ +0x00 ,0x00 ,/* vact_st3 */ +0x00 ,0x00 ,/* vact_st4 */ +0x01 ,0x00 ,0x01 ,0x00 ,/* vsync top/bot */ +0x01 ,0x00 ,0x33 ,0x02 ,/* field top/bot */ +0x00 ,/* 3d FP */ + }, +}; + +static const struct hdmi_preset_conf hdmi_conf_720p50 = { + .core = { + .h_blank = {0xbc ,0x02 }, + .v2_blank = {0xee ,0x02 }, + .v1_blank = {0x1e ,0x00 }, + .v_line = {0xee ,0x02 }, + .h_line = {0xbc ,0x07 }, + .hsync_pol = {0x00 }, + .vsync_pol = {0x00 }, + .int_pro_mode = {0x00 }, + .v_blank_f0 = {0xff ,0xff }, + .v_blank_f1 = {0xff ,0xff }, + .h_sync_start = {0xb6 ,0x01 }, + .h_sync_end = {0xde ,0x01 }, + .v_sync_line_bef_2 = {0x0a ,0x00 }, + .v_sync_line_bef_1 = {0x05 ,0x00 }, + .v_sync_line_aft_2 = {0xff ,0xff }, + .v_sync_line_aft_1 = {0xff ,0xff }, + .v_sync_line_aft_pxl_2 = {0xff ,0xff }, + .v_sync_line_aft_pxl_1 = {0xff ,0xff }, + .v_blank_f2 = {0xff ,0xff }, + .v_blank_f3 = {0xff ,0xff }, + .v_blank_f4 = {0xff ,0xff }, + .v_blank_f5 = {0xff ,0xff }, + .v_sync_line_aft_3 = {0xff ,0xff }, + .v_sync_line_aft_4 = {0xff ,0xff }, + .v_sync_line_aft_5 = {0xff ,0xff }, + .v_sync_line_aft_6 = {0xff ,0xff }, + .v_sync_line_aft_pxl_3 = {0xff ,0xff }, + .v_sync_line_aft_pxl_4 = {0xff ,0xff }, + .v_sync_line_aft_pxl_5 = {0xff ,0xff }, + .v_sync_line_aft_pxl_6 = {0xff ,0xff }, + .vact_space_1 = {0xff ,0xff }, + .vact_space_2 = {0xff ,0xff }, + .vact_space_3 = {0xff ,0xff }, + .vact_space_4 = {0xff ,0xff }, + .vact_space_5 = {0xff ,0xff }, + .vact_space_6 = {0xff ,0xff }, +/* other don't care */ + }, + .tg = { +0x00 ,/* cmd */ +0xbc ,0x07 ,/* h_fsz */ +0xbc ,0x02 ,0x00 ,0x05 ,/* hact */ +0xee ,0x02 ,/* v_fsz */ +0x01 ,0x00 ,0x33 ,0x02 ,/* vsync */ +0x1e ,0x00 ,0xd0 ,0x02 ,/* vact */ +0x33 ,0x02 ,/* field_chg */ +0x48 ,0x02 ,/* vact_st2 */ +0x00 ,0x00 ,/* vact_st3 */ +0x00 ,0x00 ,/* vact_st4 */ +0x01 ,0x00 ,0x01 ,0x00 ,/* vsync top/bot */ +0x01 ,0x00 ,0x33 ,0x02 ,/* field top/bot */ +0x00 ,/* 3d FP */ + }, +}; + +static const struct hdmi_preset_conf hdmi_conf_720p60 = { + .core = { + .h_blank = {0x72 ,0x01 }, + .v2_blank = {0xee ,0x02 }, + .v1_blank = {0x1e ,0x00 }, + .v_line = {0xee ,0x02 }, + .h_line = {0x72 ,0x06 }, + .hsync_pol = {0x00 }, + .vsync_pol = {0x00 }, + .int_pro_mode = {0x00 }, + .v_blank_f0 = {0xff ,0xff }, + .v_blank_f1 = {0xff ,0xff }, + .h_sync_start = {0x6c ,0x00 }, + .h_sync_end = {0x94 ,0x00 }, + .v_sync_line_bef_2 = {0x0a ,0x00 }, + .v_sync_line_bef_1 = {0x05 ,0x00 }, + .v_sync_line_aft_2 = {0xff ,0xff }, + .v_sync_line_aft_1 = {0xff ,0xff }, + .v_sync_line_aft_pxl_2 = {0xff ,0xff }, + .v_sync_line_aft_pxl_1 = {0xff ,0xff }, + .v_blank_f2 = {0xff ,0xff }, + .v_blank_f3 = {0xff ,0xff }, + .v_blank_f4 = {0xff ,0xff }, + .v_blank_f5 = {0xff ,0xff }, + .v_sync_line_aft_3 = {0xff ,0xff }, + .v_sync_line_aft_4 = {0xff ,0xff }, + .v_sync_line_aft_5 = {0xff ,0xff }, + .v_sync_line_aft_6 = {0xff ,0xff }, + .v_sync_line_aft_pxl_3 = {0xff ,0xff }, + .v_sync_line_aft_pxl_4 = {0xff ,0xff }, + .v_sync_line_aft_pxl_5 = {0xff ,0xff }, + .v_sync_line_aft_pxl_6 = {0xff ,0xff }, + .vact_space_1 = {0xff ,0xff }, + .vact_space_2 = {0xff ,0xff }, + .vact_space_3 = {0xff ,0xff }, + .vact_space_4 = {0xff ,0xff }, + .vact_space_5 = {0xff ,0xff }, + .vact_space_6 = {0xff ,0xff }, +/* other don't care */ + }, + .tg = { +0x00 ,/* cmd */ +0x72 ,0x06 ,/* h_fsz */ +0x72 ,0x01 ,0x00 ,0x05 ,/* hact */ +0xee ,0x02 ,/* v_fsz */ +0x01 ,0x00 ,0x33 ,0x02 ,/* vsync */ +0x1e ,0x00 ,0xd0 ,0x02 ,/* vact */ +0x33 ,0x02 ,/* field_chg */ +0x48 ,0x02 ,/* vact_st2 */ +0x00 ,0x00 ,/* vact_st3 */ +0x00 ,0x00 ,/* vact_st4 */ +0x01 ,0x00 ,0x01 ,0x00 ,/* vsync top/bot */ +0x01 ,0x00 ,0x33 ,0x02 ,/* field top/bot */ +0x00 ,/* 3d FP */ + }, +}; + +static const struct hdmi_preset_conf hdmi_conf_1080i50 = { + .core = { + .h_blank = {0xd0 ,0x02 }, + .v2_blank = {0x32 ,0x02 }, + .v1_blank = {0x16 ,0x00 }, + .v_line = {0x65 ,0x04 }, + .h_line = {0x50 ,0x0a }, + .hsync_pol = {0x00 }, + .vsync_pol = {0x00 }, + .int_pro_mode = {0x01 }, + .v_blank_f0 = {0x49 ,0x02 }, + .v_blank_f1 = {0x65 ,0x04 }, + .h_sync_start = {0x0e ,0x02 }, + .h_sync_end = {0x3a ,0x02 }, + .v_sync_line_bef_2 = {0x07 ,0x00 }, + .v_sync_line_bef_1 = {0x02 ,0x00 }, + .v_sync_line_aft_2 = {0x39 ,0x02 }, + .v_sync_line_aft_1 = {0x34 ,0x02 }, + .v_sync_line_aft_pxl_2 = {0x38 ,0x07 }, + .v_sync_line_aft_pxl_1 = {0x38 ,0x07 }, + .v_blank_f2 = {0xff ,0xff }, + .v_blank_f3 = {0xff ,0xff }, + .v_blank_f4 = {0xff ,0xff }, + .v_blank_f5 = {0xff ,0xff }, + .v_sync_line_aft_3 = {0xff ,0xff }, + .v_sync_line_aft_4 = {0xff ,0xff }, + .v_sync_line_aft_5 = {0xff ,0xff }, + .v_sync_line_aft_6 = {0xff ,0xff }, + .v_sync_line_aft_pxl_3 = {0xff ,0xff }, + .v_sync_line_aft_pxl_4 = {0xff ,0xff }, + .v_sync_line_aft_pxl_5 = {0xff ,0xff }, + .v_sync_line_aft_pxl_6 = {0xff ,0xff }, + .vact_space_1 = {0xff ,0xff }, + .vact_space_2 = {0xff ,0xff }, + .vact_space_3 = {0xff ,0xff }, + .vact_space_4 = {0xff ,0xff }, + .vact_space_5 = {0xff ,0xff }, + .vact_space_6 = {0xff ,0xff }, +/* other don't care */ + }, + .tg = { +0x00 ,/* cmd */ +0x50 ,0x0a ,/* h_fsz */ +0xd0 ,0x02 ,0x80 ,0x07 ,/* hact */ +0x65 ,0x04 ,/* v_fsz */ +0x01 ,0x00 ,0x33 ,0x02 ,/* vsync */ +0x16 ,0x00 ,0x1c ,0x02 ,/* vact */ +0x33 ,0x02 ,/* field_chg */ +0x49 ,0x02 ,/* vact_st2 */ +0x00 ,0x00 ,/* vact_st3 */ +0x00 ,0x00 ,/* vact_st4 */ +0x01 ,0x00 ,0x33 ,0x02 ,/* vsync top/bot */ +0x01 ,0x00 ,0x33 ,0x02 ,/* field top/bot */ +0x00 ,/* 3d FP */ + }, +}; + +static const struct hdmi_preset_conf hdmi_conf_1080i60 = { + .core = { + .h_blank = {0x18 ,0x01 }, + .v2_blank = {0x32 ,0x02 }, + .v1_blank = {0x16 ,0x00 }, + .v_line = {0x65 ,0x04 }, + .h_line = {0x98 ,0x08 }, + .hsync_pol = {0x00 }, + .vsync_pol = {0x00 }, + .int_pro_mode = {0x01 }, + .v_blank_f0 = {0x49 ,0x02 }, + .v_blank_f1 = {0x65 ,0x04 }, + .h_sync_start = {0x56 ,0x00 }, + .h_sync_end = {0x82 ,0x00 }, + .v_sync_line_bef_2 = {0x07 ,0x00 }, + .v_sync_line_bef_1 = {0x02 ,0x00 }, + .v_sync_line_aft_2 = {0x39 ,0x02 }, + .v_sync_line_aft_1 = {0x34 ,0x02 }, + .v_sync_line_aft_pxl_2 = {0xa4 ,0x04 }, + .v_sync_line_aft_pxl_1 = {0xa4 ,0x04 }, + .v_blank_f2 = {0xff ,0xff }, + .v_blank_f3 = {0xff ,0xff }, + .v_blank_f4 = {0xff ,0xff }, + .v_blank_f5 = {0xff ,0xff }, + .v_sync_line_aft_3 = {0xff ,0xff }, + .v_sync_line_aft_4 = {0xff ,0xff }, + .v_sync_line_aft_5 = {0xff ,0xff }, + .v_sync_line_aft_6 = {0xff ,0xff }, + .v_sync_line_aft_pxl_3 = {0xff ,0xff }, + .v_sync_line_aft_pxl_4 = {0xff ,0xff }, + .v_sync_line_aft_pxl_5 = {0xff ,0xff }, + .v_sync_line_aft_pxl_6 = {0xff ,0xff }, + .vact_space_1 = {0xff ,0xff }, + .vact_space_2 = {0xff ,0xff }, + .vact_space_3 = {0xff ,0xff }, + .vact_space_4 = {0xff ,0xff }, + .vact_space_5 = {0xff ,0xff }, + .vact_space_6 = {0xff ,0xff }, +/* other don't care */ + }, + .tg = { +0x00 ,/* cmd */ +0x98 ,0x08 ,/* h_fsz */ +0x18 ,0x01 ,0x80 ,0x07 ,/* hact */ +0x65 ,0x04 ,/* v_fsz */ +0x01 ,0x00 ,0x33 ,0x02 ,/* vsync */ +0x16 ,0x00 ,0x1c ,0x02 ,/* vact */ +0x33 ,0x02 ,/* field_chg */ +0x49 ,0x02 ,/* vact_st2 */ +0x00 ,0x00 ,/* vact_st3 */ +0x00 ,0x00 ,/* vact_st4 */ +0x01 ,0x00 ,0x33 ,0x02 ,/* vsync top/bot */ +0x01 ,0x00 ,0x33 ,0x02 ,/* field top/bot */ +0x00 ,/* 3d FP */ + }, +}; + +static const struct hdmi_preset_conf hdmi_conf_1080p50 = { + .core = { + .h_blank = {0xd0 ,0x02 }, + .v2_blank = {0x65 ,0x04 }, + .v1_blank = {0x2d ,0x00 }, + .v_line = {0x65 ,0x04 }, + .h_line = {0x50 ,0x0a }, + .hsync_pol = {0x00 }, + .vsync_pol = {0x00 }, + .int_pro_mode = {0x00 }, + .v_blank_f0 = {0xff ,0xff }, + .v_blank_f1 = {0xff ,0xff }, + .h_sync_start = {0x0e ,0x02 }, + .h_sync_end = {0x3a ,0x02 }, + .v_sync_line_bef_2 = {0x09 ,0x00 }, + .v_sync_line_bef_1 = {0x04 ,0x00 }, + .v_sync_line_aft_2 = {0xff ,0xff }, + .v_sync_line_aft_1 = {0xff ,0xff }, + .v_sync_line_aft_pxl_2 = {0xff ,0xff }, + .v_sync_line_aft_pxl_1 = {0xff ,0xff }, + .v_blank_f2 = {0xff ,0xff }, + .v_blank_f3 = {0xff ,0xff }, + .v_blank_f4 = {0xff ,0xff }, + .v_blank_f5 = {0xff ,0xff }, + .v_sync_line_aft_3 = {0xff ,0xff }, + .v_sync_line_aft_4 = {0xff ,0xff }, + .v_sync_line_aft_5 = {0xff ,0xff }, + .v_sync_line_aft_6 = {0xff ,0xff }, + .v_sync_line_aft_pxl_3 = {0xff ,0xff }, + .v_sync_line_aft_pxl_4 = {0xff ,0xff }, + .v_sync_line_aft_pxl_5 = {0xff ,0xff }, + .v_sync_line_aft_pxl_6 = {0xff ,0xff }, + .vact_space_1 = {0xff ,0xff }, + .vact_space_2 = {0xff ,0xff }, + .vact_space_3 = {0xff ,0xff }, + .vact_space_4 = {0xff ,0xff }, + .vact_space_5 = {0xff ,0xff }, + .vact_space_6 = {0xff ,0xff }, +/* other don't care */ + }, + .tg = { +0x00 ,/* cmd */ +0x50 ,0x0a ,/* h_fsz */ +0xd0 ,0x02 ,0x80 ,0x07 ,/* hact */ +0x65 ,0x04 ,/* v_fsz */ +0x01 ,0x00 ,0x33 ,0x02 ,/* vsync */ +0x2d ,0x00 ,0x38 ,0x04 ,/* vact */ +0x33 ,0x02 ,/* field_chg */ +0x48 ,0x02 ,/* vact_st2 */ +0x00 ,0x00 ,/* vact_st3 */ +0x00 ,0x00 ,/* vact_st4 */ +0x01 ,0x00 ,0x01 ,0x00 ,/* vsync top/bot */ +0x01 ,0x00 ,0x33 ,0x02 ,/* field top/bot */ +0x00 ,/* 3d FP */ + }, +}; + +static const struct hdmi_preset_conf hdmi_conf_1080p60 = { + .core = { + .h_blank = {0x18 ,0x01 }, + .v2_blank = {0x65 ,0x04 }, + .v1_blank = {0x2d ,0x00 }, + .v_line = {0x65 ,0x04 }, + .h_line = {0x98 ,0x08 }, + .hsync_pol = {0x00 }, + .vsync_pol = {0x00 }, + .int_pro_mode = {0x00 }, + .v_blank_f0 = {0xff ,0xff }, + .v_blank_f1 = {0xff ,0xff }, + .h_sync_start = {0x56 ,0x00 }, + .h_sync_end = {0x82 ,0x00 }, + .v_sync_line_bef_2 = {0x09 ,0x00 }, + .v_sync_line_bef_1 = {0x04 ,0x00 }, + .v_sync_line_aft_2 = {0xff ,0xff }, + .v_sync_line_aft_1 = {0xff ,0xff }, + .v_sync_line_aft_pxl_2 = {0xff ,0xff }, + .v_sync_line_aft_pxl_1 = {0xff ,0xff }, + .v_blank_f2 = {0xff ,0xff }, + .v_blank_f3 = {0xff ,0xff }, + .v_blank_f4 = {0xff ,0xff }, + .v_blank_f5 = {0xff ,0xff }, + .v_sync_line_aft_3 = {0xff ,0xff }, + .v_sync_line_aft_4 = {0xff ,0xff }, + .v_sync_line_aft_5 = {0xff ,0xff }, + .v_sync_line_aft_6 = {0xff ,0xff }, + .v_sync_line_aft_pxl_3 = {0xff ,0xff }, + .v_sync_line_aft_pxl_4 = {0xff ,0xff }, + .v_sync_line_aft_pxl_5 = {0xff ,0xff }, + .v_sync_line_aft_pxl_6 = {0xff ,0xff }, +/* other don't care */ + }, + .tg = { +0x00 ,/* cmd */ +0x98 ,0x08 ,/* h_fsz */ +0x18 ,0x01 ,0x80 ,0x07 ,/* hact */ +0x65 ,0x04 ,/* v_fsz */ +0x01 ,0x00 ,0x33 ,0x02 ,/* vsync */ +0x2d ,0x00 ,0x38 ,0x04 ,/* vact */ +0x33 ,0x02 ,/* field_chg */ +0x48 ,0x02 ,/* vact_st2 */ +0x00 ,0x00 ,/* vact_st3 */ +0x00 ,0x00 ,/* vact_st4 */ +0x01 ,0x00 ,0x01 ,0x00 ,/* vsync top/bot */ +0x01 ,0x00 ,0x33 ,0x02 ,/* field top/bot */ +0x00 ,/* 3d FP */ + }, +}; +static const struct hdmi_conf hdmi_confs[] = { + {720 ,480 ,60 , false, hdmiphy_conf27_027, &hdmi_conf_480p60 }, + {1280 ,720 ,50 , false, hdmiphy_conf74_25, &hdmi_conf_720p50 }, {1280 ,720 ,60 , false, hdmiphy_conf74_25, &hdmi_conf_720p60 }, - {1280 ,720 ,50 , false, hdmiphy_conf74_25, &hdmi_conf_720p60 }, - {720 ,480 ,60 , false, hdmiphy_conf27_027, &hdmi_conf_480p }, {1920 ,1080 ,50 , true, hdmiphy_conf74_25, &hdmi_conf_1080i50 }, - {1920 ,1080 ,50 , false, hdmiphy_conf148_5, &hdmi_conf_1080p50 }, {1920 ,1080 ,60 , true, hdmiphy_conf74_25, &hdmi_conf_1080i60 }, + {1920 ,1080 ,50 , false, hdmiphy_conf148_5, &hdmi_conf_1080p50 }, {1920 ,1080 ,60 , false, hdmiphy_conf148_5, &hdmi_conf_1080p60 }, };
@@ -324,7 +851,7 @@ static inline void hdmi_reg_writemask(struct hdmi_context *hdata,writel (value, hdata->regs + reg_id); } -static void hdmi_regs_dump (struct hdmi_context *hdata,char *prefix) +static void hdmi_v13_regs_dump (struct hdmi_context *hdata,char *prefix) {#define DUMPREG (reg_id) \ DRM_DEBUG_KMS("%s:" #reg_id " = %08x\n", prefix, \
@@ -333,6 +860,101 @@ static void hdmi_regs_dump(struct hdmi_context *hdata, char *prefix)DUMPREG (HDMI_INTC_FLAG );DUMPREG (HDMI_INTC_CON );DUMPREG (HDMI_HPD_STATUS ); +DUMPREG (HDMI_V13_PHY_RSTOUT ); +DUMPREG (HDMI_V13_PHY_VPLL ); +DUMPREG (HDMI_V13_PHY_CMU ); +DUMPREG (HDMI_V13_CORE_RSTOUT ); + +DRM_DEBUG_KMS ("%s: ---- CORE REGISTERS ----\n" , prefix); +DUMPREG (HDMI_CON_0 ); +DUMPREG (HDMI_CON_1 ); +DUMPREG (HDMI_CON_2 ); +DUMPREG (HDMI_SYS_STATUS ); +DUMPREG (HDMI_V13_PHY_STATUS ); +DUMPREG (HDMI_STATUS_EN ); +DUMPREG (HDMI_HPD ); +DUMPREG (HDMI_MODE_SEL ); +DUMPREG (HDMI_V13_HPD_GEN ); +DUMPREG (HDMI_V13_DC_CONTROL ); +DUMPREG (HDMI_V13_VIDEO_PATTERN_GEN ); + +DRM_DEBUG_KMS ("%s: ---- CORE SYNC REGISTERS ----\n" , prefix); +DUMPREG (HDMI_H_BLANK_0 ); +DUMPREG (HDMI_H_BLANK_1 ); +DUMPREG (HDMI_V13_V_BLANK_0 ); +DUMPREG (HDMI_V13_V_BLANK_1 ); +DUMPREG (HDMI_V13_V_BLANK_2 ); +DUMPREG (HDMI_V13_H_V_LINE_0 ); +DUMPREG (HDMI_V13_H_V_LINE_1 ); +DUMPREG (HDMI_V13_H_V_LINE_2 ); +DUMPREG (HDMI_VSYNC_POL ); +DUMPREG (HDMI_INT_PRO_MODE ); +DUMPREG (HDMI_V13_V_BLANK_F_0 ); +DUMPREG (HDMI_V13_V_BLANK_F_1 ); +DUMPREG (HDMI_V13_V_BLANK_F_2 ); +DUMPREG (HDMI_V13_H_SYNC_GEN_0 ); +DUMPREG (HDMI_V13_H_SYNC_GEN_1 ); +DUMPREG (HDMI_V13_H_SYNC_GEN_2 ); +DUMPREG (HDMI_V13_V_SYNC_GEN_1_0 ); +DUMPREG (HDMI_V13_V_SYNC_GEN_1_1 ); +DUMPREG (HDMI_V13_V_SYNC_GEN_1_2 ); +DUMPREG (HDMI_V13_V_SYNC_GEN_2_0 ); +DUMPREG (HDMI_V13_V_SYNC_GEN_2_1 ); +DUMPREG (HDMI_V13_V_SYNC_GEN_2_2 ); +DUMPREG (HDMI_V13_V_SYNC_GEN_3_0 ); +DUMPREG (HDMI_V13_V_SYNC_GEN_3_1 ); +DUMPREG (HDMI_V13_V_SYNC_GEN_3_2 ); + +DRM_DEBUG_KMS ("%s: ---- TG REGISTERS ----\n" , prefix); +DUMPREG (HDMI_TG_CMD ); +DUMPREG (HDMI_TG_H_FSZ_L ); +DUMPREG (HDMI_TG_H_FSZ_H ); +DUMPREG (HDMI_TG_HACT_ST_L ); +DUMPREG (HDMI_TG_HACT_ST_H ); +DUMPREG (HDMI_TG_HACT_SZ_L ); +DUMPREG (HDMI_TG_HACT_SZ_H ); +DUMPREG (HDMI_TG_V_FSZ_L ); +DUMPREG (HDMI_TG_V_FSZ_H ); +DUMPREG (HDMI_TG_VSYNC_L ); +DUMPREG (HDMI_TG_VSYNC_H ); +DUMPREG (HDMI_TG_VSYNC2_L ); +DUMPREG (HDMI_TG_VSYNC2_H ); +DUMPREG (HDMI_TG_VACT_ST_L ); +DUMPREG (HDMI_TG_VACT_ST_H ); +DUMPREG (HDMI_TG_VACT_SZ_L ); +DUMPREG (HDMI_TG_VACT_SZ_H ); +DUMPREG (HDMI_TG_FIELD_CHG_L ); +DUMPREG (HDMI_TG_FIELD_CHG_H ); +DUMPREG (HDMI_TG_VACT_ST2_L ); +DUMPREG (HDMI_TG_VACT_ST2_H ); +DUMPREG (HDMI_TG_VSYNC_TOP_HDMI_L ); +DUMPREG (HDMI_TG_VSYNC_TOP_HDMI_H ); +DUMPREG (HDMI_TG_VSYNC_BOT_HDMI_L ); +DUMPREG (HDMI_TG_VSYNC_BOT_HDMI_H ); +DUMPREG (HDMI_TG_FIELD_TOP_HDMI_L ); +DUMPREG (HDMI_TG_FIELD_TOP_HDMI_H ); +DUMPREG (HDMI_TG_FIELD_BOT_HDMI_L ); +DUMPREG (HDMI_TG_FIELD_BOT_HDMI_H ); +#undef DUMPREG +} + +static void hdmi_v14_regs_dump (struct hdmi_context *hdata,char *prefix) +{ +int i; + +#define DUMPREG (reg_id) \ + DRM_DEBUG_KMS("%s:" #reg_id " = %08x\n", prefix, \ + readl(hdata->regs + reg_id)) + +DRM_DEBUG_KMS ("%s: ---- CONTROL REGISTERS ----\n" , prefix); +DUMPREG (HDMI_INTC_CON ); +DUMPREG (HDMI_INTC_FLAG ); +DUMPREG (HDMI_HPD_STATUS ); +DUMPREG (HDMI_INTC_CON_1 ); +DUMPREG (HDMI_INTC_FLAG_1 ); +DUMPREG (HDMI_PHY_STATUS_0 ); +DUMPREG (HDMI_PHY_STATUS_PLL ); +DUMPREG (HDMI_PHY_CON_0 );DUMPREG (HDMI_PHY_RSTOUT );DUMPREG (HDMI_PHY_VPLL );DUMPREG (HDMI_PHY_CMU );
@@ -343,40 +965,93 @@ static void hdmi_regs_dump(struct hdmi_context *hdata, char *prefix)DUMPREG (HDMI_CON_1 );DUMPREG (HDMI_CON_2 );DUMPREG (HDMI_SYS_STATUS ); -DUMPREG (HDMI_PHY_STATUS ); +DUMPREG (HDMI_PHY_STATUS_0 );DUMPREG (HDMI_STATUS_EN );DUMPREG (HDMI_HPD );DUMPREG (HDMI_MODE_SEL ); -DUMPREG (HDMI_HPD_GEN ); +DUMPREG (HDMI_ENC_EN );DUMPREG (HDMI_DC_CONTROL );DUMPREG (HDMI_VIDEO_PATTERN_GEN );DRM_DEBUG_KMS ("%s: ---- CORE SYNC REGISTERS ----\n" , prefix);DUMPREG (HDMI_H_BLANK_0 );DUMPREG (HDMI_H_BLANK_1 ); -DUMPREG (HDMI_V_BLANK_0 ); -DUMPREG (HDMI_V_BLANK_1 ); -DUMPREG (HDMI_V_BLANK_2 ); -DUMPREG (HDMI_H_V_LINE_0 ); -DUMPREG (HDMI_H_V_LINE_1 ); -DUMPREG (HDMI_H_V_LINE_2 ); +DUMPREG (HDMI_V2_BLANK_0 ); +DUMPREG (HDMI_V2_BLANK_1 ); +DUMPREG (HDMI_V1_BLANK_0 ); +DUMPREG (HDMI_V1_BLANK_1 ); +DUMPREG (HDMI_V_LINE_0 ); +DUMPREG (HDMI_V_LINE_1 ); +DUMPREG (HDMI_H_LINE_0 ); +DUMPREG (HDMI_H_LINE_1 ); +DUMPREG (HDMI_HSYNC_POL ); +DUMPREG (HDMI_VSYNC_POL );DUMPREG (HDMI_INT_PRO_MODE ); -DUMPREG (HDMI_V_BLANK_F_0 ); -DUMPREG (HDMI_V_BLANK_F_1 ); -DUMPREG (HDMI_V_BLANK_F_2 ); -DUMPREG (HDMI_H_SYNC_GEN_0 ); -DUMPREG (HDMI_H_SYNC_GEN_1 ); -DUMPREG (HDMI_H_SYNC_GEN_2 ); -DUMPREG (HDMI_V_SYNC_GEN_1_0 ); -DUMPREG (HDMI_V_SYNC_GEN_1_1 ); -DUMPREG (HDMI_V_SYNC_GEN_1_2 ); -DUMPREG (HDMI_V_SYNC_GEN_2_0 ); -DUMPREG (HDMI_V_SYNC_GEN_2_1 ); -DUMPREG (HDMI_V_SYNC_GEN_2_2 ); -DUMPREG (HDMI_V_SYNC_GEN_3_0 ); -DUMPREG (HDMI_V_SYNC_GEN_3_1 ); -DUMPREG (HDMI_V_SYNC_GEN_3_2 ); +DUMPREG (HDMI_V_BLANK_F0_0 ); +DUMPREG (HDMI_V_BLANK_F0_1 ); +DUMPREG (HDMI_V_BLANK_F1_0 ); +DUMPREG (HDMI_V_BLANK_F1_1 ); + +DUMPREG (HDMI_H_SYNC_START_0 ); +DUMPREG (HDMI_H_SYNC_START_1 ); +DUMPREG (HDMI_H_SYNC_END_0 ); +DUMPREG (HDMI_H_SYNC_END_1 ); + +DUMPREG (HDMI_V_SYNC_LINE_BEF_2_0 ); +DUMPREG (HDMI_V_SYNC_LINE_BEF_2_1 ); +DUMPREG (HDMI_V_SYNC_LINE_BEF_1_0 ); +DUMPREG (HDMI_V_SYNC_LINE_BEF_1_1 ); + +DUMPREG (HDMI_V_SYNC_LINE_AFT_2_0 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_2_1 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_1_0 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_1_1 ); + +DUMPREG (HDMI_V_SYNC_LINE_AFT_PXL_2_0 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_PXL_2_1 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_PXL_1_0 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_PXL_1_1 ); + +DUMPREG (HDMI_V_BLANK_F2_0 ); +DUMPREG (HDMI_V_BLANK_F2_1 ); +DUMPREG (HDMI_V_BLANK_F3_0 ); +DUMPREG (HDMI_V_BLANK_F3_1 ); +DUMPREG (HDMI_V_BLANK_F4_0 ); +DUMPREG (HDMI_V_BLANK_F4_1 ); +DUMPREG (HDMI_V_BLANK_F5_0 ); +DUMPREG (HDMI_V_BLANK_F5_1 ); + +DUMPREG (HDMI_V_SYNC_LINE_AFT_3_0 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_3_1 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_4_0 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_4_1 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_5_0 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_5_1 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_6_0 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_6_1 ); + +DUMPREG (HDMI_V_SYNC_LINE_AFT_PXL_3_0 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_PXL_3_1 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_PXL_4_0 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_PXL_4_1 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_PXL_5_0 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_PXL_5_1 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_PXL_6_0 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_PXL_6_1 ); + +DUMPREG (HDMI_VACT_SPACE_1_0 ); +DUMPREG (HDMI_VACT_SPACE_1_1 ); +DUMPREG (HDMI_VACT_SPACE_2_0 ); +DUMPREG (HDMI_VACT_SPACE_2_1 ); +DUMPREG (HDMI_VACT_SPACE_3_0 ); +DUMPREG (HDMI_VACT_SPACE_3_1 ); +DUMPREG (HDMI_VACT_SPACE_4_0 ); +DUMPREG (HDMI_VACT_SPACE_4_1 ); +DUMPREG (HDMI_VACT_SPACE_5_0 ); +DUMPREG (HDMI_VACT_SPACE_5_1 ); +DUMPREG (HDMI_VACT_SPACE_6_0 ); +DUMPREG (HDMI_VACT_SPACE_6_1 );DRM_DEBUG_KMS ("%s: ---- TG REGISTERS ----\n" , prefix);DUMPREG (HDMI_TG_CMD );
@@ -400,6 +1075,10 @@ static void hdmi_regs_dump(struct hdmi_context *hdata, char *prefix)DUMPREG (HDMI_TG_FIELD_CHG_H );DUMPREG (HDMI_TG_VACT_ST2_L );DUMPREG (HDMI_TG_VACT_ST2_H ); +DUMPREG (HDMI_TG_VACT_ST3_L ); +DUMPREG (HDMI_TG_VACT_ST3_H ); +DUMPREG (HDMI_TG_VACT_ST4_L ); +DUMPREG (HDMI_TG_VACT_ST4_H );DUMPREG (HDMI_TG_VSYNC_TOP_HDMI_L );DUMPREG (HDMI_TG_VSYNC_TOP_HDMI_H );DUMPREG (HDMI_TG_VSYNC_BOT_HDMI_L );
@@ -408,10 +1087,49 @@ static void hdmi_regs_dump(struct hdmi_context *hdata, char *prefix)DUMPREG (HDMI_TG_FIELD_TOP_HDMI_H );DUMPREG (HDMI_TG_FIELD_BOT_HDMI_L );DUMPREG (HDMI_TG_FIELD_BOT_HDMI_H ); +DUMPREG (HDMI_TG_3D ); + +DRM_DEBUG_KMS ("%s: ---- PACKET REGISTERS ----\n" , prefix); +DUMPREG (HDMI_AVI_CON ); +DUMPREG (HDMI_AVI_HEADER0 ); +DUMPREG (HDMI_AVI_HEADER1 ); +DUMPREG (HDMI_AVI_HEADER2 ); +DUMPREG (HDMI_AVI_CHECK_SUM ); +DUMPREG (HDMI_VSI_CON ); +DUMPREG (HDMI_VSI_HEADER0 ); +DUMPREG (HDMI_VSI_HEADER1 ); +DUMPREG (HDMI_VSI_HEADER2 ); +for (i =0 ; i <7 ; ++i) +DUMPREG (HDMI_VSI_DATA (i)); +#undef DUMPREG } -static int hdmi_conf_index (struct drm_display_mode *mode) +static void hdmi_regs_dump (struct hdmi_context *hdata,char *prefix) +{ +if (hdata->is_v13) +hdmi_v13_regs_dump (hdata, prefix); +else +hdmi_v14_regs_dump (hdata, prefix); +} + +static int hdmi_v13_conf_index (struct drm_display_mode *mode) +{ +int i; + +for (i =0 ; i <ARRAY_SIZE (hdmi_v13_confs); ++i) +if (hdmi_v13_confs[i].width == mode->hdisplay && + hdmi_v13_confs[i].height == mode->vdisplay && + hdmi_v13_confs[i].vrefresh == mode->vrefresh && + hdmi_v13_confs[i].interlace == + ((mode->flags &DRM_MODE_FLAG_INTERLACE ) ? + true : false)) +return i; + +return -1 ; +} + +static int hdmi_v14_conf_index (struct drm_display_mode *mode) {int i;
@@ -427,6 +1145,15 @@ static int hdmi_conf_index(struct drm_display_mode *mode)return -1 ; } +static int hdmi_conf_index (struct hdmi_context *hdata, +struct drm_display_mode *mode) +{ +if (hdata->is_v13) +return hdmi_v13_conf_index (mode); +else +return hdmi_v14_conf_index (mode); +} +static bool hdmi_is_connected (void *ctx) {struct hdmi_context *hdata = (struct hdmi_context *)ctx;
@@ -462,16 +1189,25 @@ static int hdmi_get_edid(void *ctx, struct drm_connector *connector,return 0 ; } -static int hdmi_check_timing (void *ctx,void *timing) +static int hdmi_v13_check_timing (struct fb_videomode *check_timing) { -struct fb_videomode *check_timing = timing;int i; -DRM_DEBUG_KMS ("[%d] %s\n" , __LINE__, __func__); +for (i =0 ; i <ARRAY_SIZE (hdmi_v13_confs); ++i) +if (hdmi_v13_confs[i].width == check_timing->xres && + hdmi_v13_confs[i].height == check_timing->yres && + hdmi_v13_confs[i].vrefresh == check_timing->refresh && + hdmi_v13_confs[i].interlace == + ((check_timing->vmode &FB_VMODE_INTERLACED ) ? + true : false)) +return 0 ; -DRM_DEBUG_KMS ("[%d]x[%d] [%d]Hz [%x]\n" , check_timing->xres, - check_timing->yres, check_timing->refresh, - check_timing->vmode); +return -EINVAL ; +} + +static int hdmi_v14_check_timing (struct fb_videomode *check_timing) +{ +int i;for (i =0 ; i <ARRAY_SIZE (hdmi_confs); ++i) if (hdmi_confs[i].width == check_timing->xres &&
@@ -485,6 +1221,23 @@ static int hdmi_check_timing(void *ctx, void *timing)return -EINVAL ; } +static int hdmi_check_timing (void *ctx,void *timing) +{ +struct hdmi_context *hdata = (struct hdmi_context *)ctx; +struct fb_videomode *check_timing = timing; + +DRM_DEBUG_KMS ("[%d] %s\n" , __LINE__, __func__); + +DRM_DEBUG_KMS ("[%d]x[%d] [%d]Hz [%x]\n" , check_timing->xres, + check_timing->yres, check_timing->refresh, + check_timing->vmode); + +if (hdata->is_v13) +return hdmi_v13_check_timing (check_timing); +else +return hdmi_v14_check_timing (check_timing); +} +static int hdmi_display_power_on (void *ctx,int mode) {DRM_DEBUG_KMS ("[%d] %s\n" , __LINE__, __func__);
@@ -516,13 +1269,20 @@ static struct exynos_hdmi_display_ops display_ops = {static void hdmi_conf_reset (struct hdmi_context *hdata) { +u32 reg; +/* disable hpd handle for drm */ hdata->hpd_handle = false; +if (hdata->is_v13) + reg =HDMI_V13_CORE_RSTOUT ; +else + reg =HDMI_CORE_RSTOUT ; +/* resetting HDMI core */ -hdmi_reg_writemask (hdata,HDMI_CORE_RSTOUT ,0 ,HDMI_CORE_SW_RSTOUT ); +hdmi_reg_writemask (hdata, reg,0 ,HDMI_CORE_SW_RSTOUT );mdelay (10 ); -hdmi_reg_writemask (hdata,HDMI_CORE_RSTOUT , ~0 ,HDMI_CORE_SW_RSTOUT ); +hdmi_reg_writemask (hdata, reg, ~0 ,HDMI_CORE_SW_RSTOUT );mdelay (10 );/* enable hpd handle for drm */
@@ -546,27 +1306,126 @@ static void hdmi_conf_init(struct hdmi_context *hdata) HDMI_MODE_HDMI_EN, HDMI_MODE_MASK);/* disable bluescreen */ hdmi_reg_writemask (hdata,HDMI_CON_0 ,0 ,HDMI_BLUE_SCR_EN ); -/* choose bluescreen (fecal) color */ -hdmi_reg_writeb (hdata,HDMI_BLUE_SCREEN_0 ,0x12 ); -hdmi_reg_writeb (hdata,HDMI_BLUE_SCREEN_1 ,0x34 ); -hdmi_reg_writeb (hdata,HDMI_BLUE_SCREEN_2 ,0x56 ); -/* enable AVI packet every vsync, fixes purple line problem */ -hdmi_reg_writeb (hdata,HDMI_AVI_CON ,0x02 ); -/* force RGB, look to CEA-861-D, table 7 for more detail */ -hdmi_reg_writeb (hdata,HDMI_AVI_BYTE (0 ),0 <<5 ); -hdmi_reg_writemask (hdata,HDMI_CON_1 ,0x10 <<5 ,0x11 <<5 ); - -hdmi_reg_writeb (hdata,HDMI_SPD_CON ,0x02 ); -hdmi_reg_writeb (hdata,HDMI_AUI_CON ,0x02 ); -hdmi_reg_writeb (hdata,HDMI_ACR_CON ,0x04 ); + +if (hdata->is_v13) { +/* choose bluescreen (fecal) color */ +hdmi_reg_writeb (hdata,HDMI_V13_BLUE_SCREEN_0 ,0x12 ); +hdmi_reg_writeb (hdata,HDMI_V13_BLUE_SCREEN_1 ,0x34 ); +hdmi_reg_writeb (hdata,HDMI_V13_BLUE_SCREEN_2 ,0x56 ); + +/* enable AVI packet every vsync, fixes purple line problem */ +hdmi_reg_writeb (hdata,HDMI_V13_AVI_CON ,0x02 ); +/* force RGB, look to CEA-861-D, table 7 for more detail */ +hdmi_reg_writeb (hdata,HDMI_V13_AVI_BYTE (0 ),0 <<5 ); +hdmi_reg_writemask (hdata,HDMI_CON_1 ,0x10 <<5 ,0x11 <<5 ); + +hdmi_reg_writeb (hdata,HDMI_V13_SPD_CON ,0x02 ); +hdmi_reg_writeb (hdata,HDMI_V13_AUI_CON ,0x02 ); +hdmi_reg_writeb (hdata,HDMI_V13_ACR_CON ,0x04 ); + }else { +/* enable AVI packet every vsync, fixes purple line problem */ +hdmi_reg_writeb (hdata,HDMI_AVI_CON ,0x02 ); +hdmi_reg_writeb (hdata,HDMI_AVI_BYTE (1 ),2 <<5 ); +hdmi_reg_writemask (hdata,HDMI_CON_1 ,2 ,3 <<5 ); + }/* enable hpd handle for drm */ hdata->hpd_handle = true; } -static void hdmi_timing_apply (struct hdmi_context *hdata, -const struct hdmi_preset_conf *conf) +static void hdmi_v13_timing_apply (struct hdmi_context *hdata) { +const struct hdmi_v13_preset_conf *conf = + hdmi_v13_confs[hdata->cur_conf].conf; +const struct hdmi_v13_core_regs *core = &conf->core; +const struct hdmi_v13_tg_regs *tg = &conf->tg; +int tries; + +/* setting core registers */ +hdmi_reg_writeb (hdata,HDMI_H_BLANK_0 , core->h_blank[0 ]); +hdmi_reg_writeb (hdata,HDMI_H_BLANK_1 , core->h_blank[1 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_BLANK_0 , core->v_blank[0 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_BLANK_1 , core->v_blank[1 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_BLANK_2 , core->v_blank[2 ]); +hdmi_reg_writeb (hdata,HDMI_V13_H_V_LINE_0 , core->h_v_line[0 ]); +hdmi_reg_writeb (hdata,HDMI_V13_H_V_LINE_1 , core->h_v_line[1 ]); +hdmi_reg_writeb (hdata,HDMI_V13_H_V_LINE_2 , core->h_v_line[2 ]); +hdmi_reg_writeb (hdata,HDMI_VSYNC_POL , core->vsync_pol[0 ]); +hdmi_reg_writeb (hdata,HDMI_INT_PRO_MODE , core->int_pro_mode[0 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_BLANK_F_0 , core->v_blank_f[0 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_BLANK_F_1 , core->v_blank_f[1 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_BLANK_F_2 , core->v_blank_f[2 ]); +hdmi_reg_writeb (hdata,HDMI_V13_H_SYNC_GEN_0 , core->h_sync_gen[0 ]); +hdmi_reg_writeb (hdata,HDMI_V13_H_SYNC_GEN_1 , core->h_sync_gen[1 ]); +hdmi_reg_writeb (hdata,HDMI_V13_H_SYNC_GEN_2 , core->h_sync_gen[2 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_SYNC_GEN_1_0 , core->v_sync_gen1[0 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_SYNC_GEN_1_1 , core->v_sync_gen1[1 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_SYNC_GEN_1_2 , core->v_sync_gen1[2 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_SYNC_GEN_2_0 , core->v_sync_gen2[0 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_SYNC_GEN_2_1 , core->v_sync_gen2[1 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_SYNC_GEN_2_2 , core->v_sync_gen2[2 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_SYNC_GEN_3_0 , core->v_sync_gen3[0 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_SYNC_GEN_3_1 , core->v_sync_gen3[1 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_SYNC_GEN_3_2 , core->v_sync_gen3[2 ]); +/* Timing generator registers */ +hdmi_reg_writeb (hdata,HDMI_TG_H_FSZ_L , tg->h_fsz_l); +hdmi_reg_writeb (hdata,HDMI_TG_H_FSZ_H , tg->h_fsz_h); +hdmi_reg_writeb (hdata,HDMI_TG_HACT_ST_L , tg->hact_st_l); +hdmi_reg_writeb (hdata,HDMI_TG_HACT_ST_H , tg->hact_st_h); +hdmi_reg_writeb (hdata,HDMI_TG_HACT_SZ_L , tg->hact_sz_l); +hdmi_reg_writeb (hdata,HDMI_TG_HACT_SZ_H , tg->hact_sz_h); +hdmi_reg_writeb (hdata,HDMI_TG_V_FSZ_L , tg->v_fsz_l); +hdmi_reg_writeb (hdata,HDMI_TG_V_FSZ_H , tg->v_fsz_h); +hdmi_reg_writeb (hdata,HDMI_TG_VSYNC_L , tg->vsync_l); +hdmi_reg_writeb (hdata,HDMI_TG_VSYNC_H , tg->vsync_h); +hdmi_reg_writeb (hdata,HDMI_TG_VSYNC2_L , tg->vsync2_l); +hdmi_reg_writeb (hdata,HDMI_TG_VSYNC2_H , tg->vsync2_h); +hdmi_reg_writeb (hdata,HDMI_TG_VACT_ST_L , tg->vact_st_l); +hdmi_reg_writeb (hdata,HDMI_TG_VACT_ST_H , tg->vact_st_h); +hdmi_reg_writeb (hdata,HDMI_TG_VACT_SZ_L , tg->vact_sz_l); +hdmi_reg_writeb (hdata,HDMI_TG_VACT_SZ_H , tg->vact_sz_h); +hdmi_reg_writeb (hdata,HDMI_TG_FIELD_CHG_L , tg->field_chg_l); +hdmi_reg_writeb (hdata,HDMI_TG_FIELD_CHG_H , tg->field_chg_h); +hdmi_reg_writeb (hdata,HDMI_TG_VACT_ST2_L , tg->vact_st2_l); +hdmi_reg_writeb (hdata,HDMI_TG_VACT_ST2_H , tg->vact_st2_h); +hdmi_reg_writeb (hdata,HDMI_TG_VSYNC_TOP_HDMI_L , tg->vsync_top_hdmi_l); +hdmi_reg_writeb (hdata,HDMI_TG_VSYNC_TOP_HDMI_H , tg->vsync_top_hdmi_h); +hdmi_reg_writeb (hdata,HDMI_TG_VSYNC_BOT_HDMI_L , tg->vsync_bot_hdmi_l); +hdmi_reg_writeb (hdata,HDMI_TG_VSYNC_BOT_HDMI_H , tg->vsync_bot_hdmi_h); +hdmi_reg_writeb (hdata,HDMI_TG_FIELD_TOP_HDMI_L , tg->field_top_hdmi_l); +hdmi_reg_writeb (hdata,HDMI_TG_FIELD_TOP_HDMI_H , tg->field_top_hdmi_h); +hdmi_reg_writeb (hdata,HDMI_TG_FIELD_BOT_HDMI_L , tg->field_bot_hdmi_l); +hdmi_reg_writeb (hdata,HDMI_TG_FIELD_BOT_HDMI_H , tg->field_bot_hdmi_h); + +/* waiting for HDMIPHY's PLL to get to steady state */ +for (tries =100 ; tries; --tries) { +u32 val =hdmi_reg_read (hdata,HDMI_V13_PHY_STATUS ); +if (val &HDMI_PHY_STATUS_READY ) +break ; +mdelay (1 ); + } +/* steady state not achieved */ +if (tries ==0 ) { +DRM_ERROR ("hdmiphy's pll could not reach steady state.\n" ); +hdmi_regs_dump (hdata,"timing apply" ); + } + +clk_disable (hdata->res.sclk_hdmi); +clk_set_parent (hdata->res.sclk_hdmi, hdata->res.sclk_hdmiphy); +clk_enable (hdata->res.sclk_hdmi); + +/* enable HDMI and timing generator */ +hdmi_reg_writemask (hdata,HDMI_CON_0 , ~0 ,HDMI_EN ); +if (core->int_pro_mode[0 ]) +hdmi_reg_writemask (hdata,HDMI_TG_CMD , ~0 ,HDMI_TG_EN | +HDMI_FIELD_EN ); +else +hdmi_reg_writemask (hdata,HDMI_TG_CMD , ~0 ,HDMI_TG_EN ); +} + +static void hdmi_v14_timing_apply (struct hdmi_context *hdata) +{ +const struct hdmi_preset_conf *conf = hdmi_confs[hdata->cur_conf].conf;const struct hdmi_core_regs *core = &conf->core;const struct hdmi_tg_regs *tg = &conf->tg;int tries;
@@ -574,29 +1433,102 @@ static void hdmi_timing_apply(struct hdmi_context *hdata,/* setting core registers */ hdmi_reg_writeb (hdata,HDMI_H_BLANK_0 , core->h_blank[0 ]);hdmi_reg_writeb (hdata,HDMI_H_BLANK_1 , core->h_blank[1 ]); -hdmi_reg_writeb (hdata,HDMI_V_BLANK_0 , core->v_blank[0 ]); -hdmi_reg_writeb (hdata,HDMI_V_BLANK_1 , core->v_blank[1 ]); -hdmi_reg_writeb (hdata,HDMI_V_BLANK_2 , core->v_blank[2 ]); -hdmi_reg_writeb (hdata,HDMI_H_V_LINE_0 , core->h_v_line[0 ]); -hdmi_reg_writeb (hdata,HDMI_H_V_LINE_1 , core->h_v_line[1 ]); -hdmi_reg_writeb (hdata,HDMI_H_V_LINE_2 , core->h_v_line[2 ]); +hdmi_reg_writeb (hdata,HDMI_V2_BLANK_0 , core->v2_blank[0 ]); +hdmi_reg_writeb (hdata,HDMI_V2_BLANK_1 , core->v2_blank[1 ]); +hdmi_reg_writeb (hdata,HDMI_V1_BLANK_0 , core->v1_blank[0 ]); +hdmi_reg_writeb (hdata,HDMI_V1_BLANK_1 , core->v1_blank[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_LINE_0 , core->v_line[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_LINE_1 , core->v_line[1 ]); +hdmi_reg_writeb (hdata,HDMI_H_LINE_0 , core->h_line[0 ]); +hdmi_reg_writeb (hdata,HDMI_H_LINE_1 , core->h_line[1 ]); +hdmi_reg_writeb (hdata,HDMI_HSYNC_POL , core->hsync_pol[0 ]);hdmi_reg_writeb (hdata,HDMI_VSYNC_POL , core->vsync_pol[0 ]);hdmi_reg_writeb (hdata,HDMI_INT_PRO_MODE , core->int_pro_mode[0 ]); -hdmi_reg_writeb (hdata,HDMI_V_BLANK_F_0 , core->v_blank_f[0 ]); -hdmi_reg_writeb (hdata,HDMI_V_BLANK_F_1 , core->v_blank_f[1 ]); -hdmi_reg_writeb (hdata,HDMI_V_BLANK_F_2 , core->v_blank_f[2 ]); -hdmi_reg_writeb (hdata,HDMI_H_SYNC_GEN_0 , core->h_sync_gen[0 ]); -hdmi_reg_writeb (hdata,HDMI_H_SYNC_GEN_1 , core->h_sync_gen[1 ]); -hdmi_reg_writeb (hdata,HDMI_H_SYNC_GEN_2 , core->h_sync_gen[2 ]); -hdmi_reg_writeb (hdata,HDMI_V_SYNC_GEN_1_0 , core->v_sync_gen1[0 ]); -hdmi_reg_writeb (hdata,HDMI_V_SYNC_GEN_1_1 , core->v_sync_gen1[1 ]); -hdmi_reg_writeb (hdata,HDMI_V_SYNC_GEN_1_2 , core->v_sync_gen1[2 ]); -hdmi_reg_writeb (hdata,HDMI_V_SYNC_GEN_2_0 , core->v_sync_gen2[0 ]); -hdmi_reg_writeb (hdata,HDMI_V_SYNC_GEN_2_1 , core->v_sync_gen2[1 ]); -hdmi_reg_writeb (hdata,HDMI_V_SYNC_GEN_2_2 , core->v_sync_gen2[2 ]); -hdmi_reg_writeb (hdata,HDMI_V_SYNC_GEN_3_0 , core->v_sync_gen3[0 ]); -hdmi_reg_writeb (hdata,HDMI_V_SYNC_GEN_3_1 , core->v_sync_gen3[1 ]); -hdmi_reg_writeb (hdata,HDMI_V_SYNC_GEN_3_2 , core->v_sync_gen3[2 ]); +hdmi_reg_writeb (hdata,HDMI_V_BLANK_F0_0 , core->v_blank_f0[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_BLANK_F0_1 , core->v_blank_f0[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_BLANK_F1_0 , core->v_blank_f1[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_BLANK_F1_1 , core->v_blank_f1[1 ]); +hdmi_reg_writeb (hdata,HDMI_H_SYNC_START_0 , core->h_sync_start[0 ]); +hdmi_reg_writeb (hdata,HDMI_H_SYNC_START_1 , core->h_sync_start[1 ]); +hdmi_reg_writeb (hdata,HDMI_H_SYNC_END_0 , core->h_sync_end[0 ]); +hdmi_reg_writeb (hdata,HDMI_H_SYNC_END_1 , core->h_sync_end[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_BEF_2_0 , + core->v_sync_line_bef_2[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_BEF_2_1 , + core->v_sync_line_bef_2[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_BEF_1_0 , + core->v_sync_line_bef_1[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_BEF_1_1 , + core->v_sync_line_bef_1[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_2_0 , + core->v_sync_line_aft_2[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_2_1 , + core->v_sync_line_aft_2[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_1_0 , + core->v_sync_line_aft_1[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_1_1 , + core->v_sync_line_aft_1[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_PXL_2_0 , + core->v_sync_line_aft_pxl_2[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_PXL_2_1 , + core->v_sync_line_aft_pxl_2[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_PXL_1_0 , + core->v_sync_line_aft_pxl_1[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_PXL_1_1 , + core->v_sync_line_aft_pxl_1[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_BLANK_F2_0 , core->v_blank_f2[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_BLANK_F2_1 , core->v_blank_f2[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_BLANK_F3_0 , core->v_blank_f3[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_BLANK_F3_1 , core->v_blank_f3[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_BLANK_F4_0 , core->v_blank_f4[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_BLANK_F4_1 , core->v_blank_f4[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_BLANK_F5_0 , core->v_blank_f5[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_BLANK_F5_1 , core->v_blank_f5[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_3_0 , + core->v_sync_line_aft_3[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_3_1 , + core->v_sync_line_aft_3[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_4_0 , + core->v_sync_line_aft_4[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_4_1 , + core->v_sync_line_aft_4[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_5_0 , + core->v_sync_line_aft_5[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_5_1 , + core->v_sync_line_aft_5[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_6_0 , + core->v_sync_line_aft_6[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_6_1 , + core->v_sync_line_aft_6[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_PXL_3_0 , + core->v_sync_line_aft_pxl_3[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_PXL_3_1 , + core->v_sync_line_aft_pxl_3[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_PXL_4_0 , + core->v_sync_line_aft_pxl_4[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_PXL_4_1 , + core->v_sync_line_aft_pxl_4[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_PXL_5_0 , + core->v_sync_line_aft_pxl_5[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_PXL_5_1 , + core->v_sync_line_aft_pxl_5[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_PXL_6_0 , + core->v_sync_line_aft_pxl_6[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_PXL_6_1 , + core->v_sync_line_aft_pxl_6[1 ]); +hdmi_reg_writeb (hdata,HDMI_VACT_SPACE_1_0 , core->vact_space_1[0 ]); +hdmi_reg_writeb (hdata,HDMI_VACT_SPACE_1_1 , core->vact_space_1[1 ]); +hdmi_reg_writeb (hdata,HDMI_VACT_SPACE_2_0 , core->vact_space_2[0 ]); +hdmi_reg_writeb (hdata,HDMI_VACT_SPACE_2_1 , core->vact_space_2[1 ]); +hdmi_reg_writeb (hdata,HDMI_VACT_SPACE_3_0 , core->vact_space_3[0 ]); +hdmi_reg_writeb (hdata,HDMI_VACT_SPACE_3_1 , core->vact_space_3[1 ]); +hdmi_reg_writeb (hdata,HDMI_VACT_SPACE_4_0 , core->vact_space_4[0 ]); +hdmi_reg_writeb (hdata,HDMI_VACT_SPACE_4_1 , core->vact_space_4[1 ]); +hdmi_reg_writeb (hdata,HDMI_VACT_SPACE_5_0 , core->vact_space_5[0 ]); +hdmi_reg_writeb (hdata,HDMI_VACT_SPACE_5_1 , core->vact_space_5[1 ]); +hdmi_reg_writeb (hdata,HDMI_VACT_SPACE_6_0 , core->vact_space_6[0 ]); +hdmi_reg_writeb (hdata,HDMI_VACT_SPACE_6_1 , core->vact_space_6[1 ]); +/* Timing generator registers */ hdmi_reg_writeb (hdata,HDMI_TG_H_FSZ_L , tg->h_fsz_l);hdmi_reg_writeb (hdata,HDMI_TG_H_FSZ_H , tg->h_fsz_h);
@@ -618,6 +1550,10 @@ static void hdmi_timing_apply(struct hdmi_context *hdata,hdmi_reg_writeb (hdata,HDMI_TG_FIELD_CHG_H , tg->field_chg_h);hdmi_reg_writeb (hdata,HDMI_TG_VACT_ST2_L , tg->vact_st2_l);hdmi_reg_writeb (hdata,HDMI_TG_VACT_ST2_H , tg->vact_st2_h); +hdmi_reg_writeb (hdata,HDMI_TG_VACT_ST3_L , tg->vact_st3_l); +hdmi_reg_writeb (hdata,HDMI_TG_VACT_ST3_H , tg->vact_st3_h); +hdmi_reg_writeb (hdata,HDMI_TG_VACT_ST4_L , tg->vact_st4_l); +hdmi_reg_writeb (hdata,HDMI_TG_VACT_ST4_H , tg->vact_st4_h);hdmi_reg_writeb (hdata,HDMI_TG_VSYNC_TOP_HDMI_L , tg->vsync_top_hdmi_l);hdmi_reg_writeb (hdata,HDMI_TG_VSYNC_TOP_HDMI_H , tg->vsync_top_hdmi_h);hdmi_reg_writeb (hdata,HDMI_TG_VSYNC_BOT_HDMI_L , tg->vsync_bot_hdmi_l);
@@ -626,10 +1562,11 @@ static void hdmi_timing_apply(struct hdmi_context *hdata,hdmi_reg_writeb (hdata,HDMI_TG_FIELD_TOP_HDMI_H , tg->field_top_hdmi_h);hdmi_reg_writeb (hdata,HDMI_TG_FIELD_BOT_HDMI_L , tg->field_bot_hdmi_l);hdmi_reg_writeb (hdata,HDMI_TG_FIELD_BOT_HDMI_H , tg->field_bot_hdmi_h); +hdmi_reg_writeb (hdata,HDMI_TG_3D , tg->tg_3d);/* waiting for HDMIPHY's PLL to get to steady state */ for (tries =100 ; tries; --tries) { -u32 val =hdmi_reg_read (hdata,HDMI_PHY_STATUS ); +u32 val =hdmi_reg_read (hdata,HDMI_PHY_STATUS_0 );if (val &HDMI_PHY_STATUS_READY )break ;mdelay (1 );
@@ -653,9 +1590,18 @@ static void hdmi_timing_apply(struct hdmi_context *hdata,hdmi_reg_writemask (hdata,HDMI_TG_CMD , ~0 ,HDMI_TG_EN ); } +static void hdmi_timing_apply (struct hdmi_context *hdata) +{ +if (hdata->is_v13) +hdmi_v13_timing_apply (hdata); +else +hdmi_v14_timing_apply (hdata); +} +static void hdmiphy_conf_reset (struct hdmi_context *hdata) {u8 buffer[2 ]; +u32 reg;clk_disable (hdata->res.sclk_hdmi);clk_set_parent (hdata->res.sclk_hdmi, hdata->res.sclk_pixel);
@@ -668,15 +1614,21 @@ static void hdmiphy_conf_reset(struct hdmi_context *hdata)if (hdata->hdmiphy_port)i2c_master_send (hdata->hdmiphy_port, buffer,2 ); +if (hdata->is_v13) + reg =HDMI_V13_PHY_RSTOUT ; +else + reg =HDMI_PHY_RSTOUT ; +/* reset hdmiphy */ -hdmi_reg_writemask (hdata,HDMI_PHY_RSTOUT , ~0 ,HDMI_PHY_SW_RSTOUT ); +hdmi_reg_writemask (hdata, reg, ~0 ,HDMI_PHY_SW_RSTOUT );mdelay (10 ); -hdmi_reg_writemask (hdata,HDMI_PHY_RSTOUT ,0 ,HDMI_PHY_SW_RSTOUT ); +hdmi_reg_writemask (hdata, reg,0 ,HDMI_PHY_SW_RSTOUT );mdelay (10 ); }static void hdmiphy_conf_apply (struct hdmi_context *hdata) { +const u8 *hdmiphy_data;u8 buffer[32 ];u8 operation[2 ];u8 read_buffer[32 ] = {0 , };
@@ -689,7 +1641,12 @@ static void hdmiphy_conf_apply(struct hdmi_context *hdata) }/* pixel clock */ -memcpy (buffer, hdmi_confs[hdata->cur_conf].hdmiphy_data,32 ); +if (hdata->is_v13) + hdmiphy_data = hdmi_v13_confs[hdata->cur_conf].hdmiphy_data; +else + hdmiphy_data = hdmi_confs[hdata->cur_conf].hdmiphy_data; + +memcpy (buffer, hdmiphy_data,32 ); ret =i2c_master_send (hdata->hdmiphy_port, buffer,32 );if (ret !=32 ) {DRM_ERROR ("failed to configure HDMIPHY via I2C\n" );
@@ -721,9 +1678,6 @@ static void hdmiphy_conf_apply(struct hdmi_context *hdata)static void hdmi_conf_apply (struct hdmi_context *hdata) { -const struct hdmi_preset_conf *conf = - hdmi_confs[hdata->cur_conf].conf; -DRM_DEBUG_KMS ("[%d] %s\n" , __LINE__, __func__);hdmiphy_conf_reset (hdata);
@@ -733,7 +1687,7 @@ static void hdmi_conf_apply(struct hdmi_context *hdata)hdmi_conf_init (hdata);/* setting core registers */ -hdmi_timing_apply (hdata, conf); +hdmi_timing_apply (hdata);hdmi_regs_dump (hdata,"start" ); }
@@ -745,8 +1699,8 @@ static void hdmi_mode_set(void *ctx, void *mode)DRM_DEBUG_KMS ("[%d] %s\n" , __LINE__, __func__); - conf_idx =hdmi_conf_index (mode); -if (conf_idx >=0 && conf_idx <ARRAY_SIZE (hdmi_confs)) + conf_idx =hdmi_conf_index (hdata, mode); +if (conf_idx >=0 ) hdata->cur_conf = conf_idx;else DRM_DEBUG_KMS ("not supported mode\n" );
@@ -926,7 +1880,6 @@ static void hdmi_resource_poweron(struct hdmi_context *hdata)hdmiphy_conf_reset (hdata);hdmi_conf_reset (hdata);hdmi_conf_init (hdata); - }static void hdmi_resource_poweroff (struct hdmi_context *hdata)
@@ -1022,6 +1975,7 @@ static int __devinit hdmi_probe(struct platform_device *pdev)platform_set_drvdata (pdev, drm_hdmi_ctx); + hdata->is_v13 = pdata->is_v13; hdata->default_win = pdata->default_win; hdata->default_timing = &pdata->timing; hdata->default_bpp = pdata->bpp;
drivers/gpu/drm/exynos/exynos_hdmi.h +1 -9
@@ -28,15 +28,6 @@ #ifndef _EXYNOS_HDMI_H_ #define _EXYNOS_HDMI_H_ -struct hdmi_conf { - int width; - int height; - int vrefresh; - bool interlace; - const u8 *hdmiphy_data; - const struct hdmi_preset_conf *conf; -}; - struct hdmi_resources { struct clk *hdmi; struct clk *sclk_hdmi;
@@ -51,6 +42,7 @@ struct hdmi_context {struct device *dev;struct drm_device *drm_dev;struct fb_videomode *default_timing; + unsigned int is_v13:1;unsigned int default_win;unsigned int default_bpp;bool hpd_handle;
drivers/gpu/drm/exynos/regs-hdmi.h +269 -37
335 lines not on this page · raw message
include/drm/exynos_drm.h +2 -0
@@ -147,11 +147,13 @@ struct exynos_drm_common_hdmi_pd {* @timing: default video mode for initializing * @default_win: default window layer number to be used for UI. * @bpp: default bit per pixel. +* @is_v13: set if hdmi version 13 is. */ struct exynos_drm_hdmi_pdata {struct fb_videomode timing;unsigned int default_win;unsigned int bpp; +unsigned int is_v13:1 ; };#endif /* __KERNEL__ */
Signature · 1 line
1.7.4.1
Inki Dae
maintainerPATCH RESEND 1/10 drm/exynos: add HDMI version 1.4 support
In reply to Inki DaeFrom: Joonyoung Shim <[email protected]>
Later Exynos series from Exynos4X12 support HDMI version 1.4. We will distinguish to use which version via platform data.
--- drivers/gpu/drm/exynos/exynos_hdmi.c | 1152 +++++++++++++++++++++++++++++++--- drivers/gpu/drm/exynos/exynos_hdmi.h | 10 +- drivers/gpu/drm/exynos/regs-hdmi.h | 306 ++++++++-- include/drm/exynos_drm.h | 2 + 4 files changed, 1325 insertions(+), 145 deletions(-)
drivers/gpu/drm/exynos/exynos_hdmi.c +1053 -99
@@ -43,42 +43,43 @@#define HDMI_OVERLAY_NUMBER 3#define get_hdmi_context (dev) platform_get_drvdata(to_platform_device(dev)) -static const u8 hdmiphy_conf27[32 ] = { +/* HDMI Version 1.3 */ +static const u8 hdmiphy_v13_conf27[32 ] = {0x01 ,0x05 ,0x00 ,0xD8 ,0x10 ,0x1C ,0x30 ,0x40 ,0x6B ,0x10 ,0x02 ,0x51 ,0xDF ,0xF2 ,0x54 ,0x87 ,0x84 ,0x00 ,0x30 ,0x38 ,0x00 ,0x08 ,0x10 ,0xE0 ,0x22 ,0x40 ,0xE3 ,0x26 ,0x00 ,0x00 ,0x00 ,0x00 , }; -static const u8 hdmiphy_conf27_027[32 ] = { +static const u8 hdmiphy_v13_conf27_027[32 ] = {0x01 ,0x05 ,0x00 ,0xD4 ,0x10 ,0x9C ,0x09 ,0x64 ,0x6B ,0x10 ,0x02 ,0x51 ,0xDF ,0xF2 ,0x54 ,0x87 ,0x84 ,0x00 ,0x30 ,0x38 ,0x00 ,0x08 ,0x10 ,0xE0 ,0x22 ,0x40 ,0xE3 ,0x26 ,0x00 ,0x00 ,0x00 ,0x00 , }; -static const u8 hdmiphy_conf74_175[32 ] = { +static const u8 hdmiphy_v13_conf74_175[32 ] = {0x01 ,0x05 ,0x00 ,0xD8 ,0x10 ,0x9C ,0xef ,0x5B ,0x6D ,0x10 ,0x01 ,0x51 ,0xef ,0xF3 ,0x54 ,0xb9 ,0x84 ,0x00 ,0x30 ,0x38 ,0x00 ,0x08 ,0x10 ,0xE0 ,0x22 ,0x40 ,0xa5 ,0x26 ,0x01 ,0x00 ,0x00 ,0x00 , }; -static const u8 hdmiphy_conf74_25[32 ] = { +static const u8 hdmiphy_v13_conf74_25[32 ] = {0x01 ,0x05 ,0x00 ,0xd8 ,0x10 ,0x9c ,0xf8 ,0x40 ,0x6a ,0x10 ,0x01 ,0x51 ,0xff ,0xf1 ,0x54 ,0xba ,0x84 ,0x00 ,0x10 ,0x38 ,0x00 ,0x08 ,0x10 ,0xe0 ,0x22 ,0x40 ,0xa4 ,0x26 ,0x01 ,0x00 ,0x00 ,0x00 , }; -static const u8 hdmiphy_conf148_5[32 ] = { +static const u8 hdmiphy_v13_conf148_5[32 ] = {0x01 ,0x05 ,0x00 ,0xD8 ,0x10 ,0x9C ,0xf8 ,0x40 ,0x6A ,0x18 ,0x00 ,0x51 ,0xff ,0xF1 ,0x54 ,0xba ,0x84 ,0x00 ,0x10 ,0x38 ,0x00 ,0x08 ,0x10 ,0xE0 ,0x22 ,0x40 ,0xa4 ,0x26 ,0x02 ,0x00 ,0x00 ,0x00 , }; -struct hdmi_tg_regs { +struct hdmi_v13_tg_regs {u8 cmd;u8 h_fsz_l;u8 h_fsz_h;
@@ -110,7 +111,7 @@ struct hdmi_tg_regs {u8 field_bot_hdmi_h; }; -struct hdmi_core_regs { +struct hdmi_v13_core_regs {u8 h_blank[2 ];u8 v_blank[3 ];u8 h_v_line[3 ];
@@ -123,12 +124,21 @@ struct hdmi_core_regs {u8 v_sync_gen3[3 ]; }; -struct hdmi_preset_conf { -struct hdmi_core_regs core; -struct hdmi_tg_regs tg; +struct hdmi_v13_preset_conf { +struct hdmi_v13_core_regs core; +struct hdmi_v13_tg_regs tg; +}; + +struct hdmi_v13_conf { +int width; +int height; +int vrefresh; +bool interlace; +const u8 *hdmiphy_data; +const struct hdmi_v13_preset_conf *conf; }; -static const struct hdmi_preset_conf hdmi_conf_480p = { +static const struct hdmi_v13_preset_conf hdmi_v13_conf_480p = { .core = { .h_blank = {0x8a ,0x00 }, .v_blank = {0x0d ,0x6a ,0x01 },
@@ -154,7 +164,7 @@ static const struct hdmi_preset_conf hdmi_conf_480p = { }, }; -static const struct hdmi_preset_conf hdmi_conf_720p60 = { +static const struct hdmi_v13_preset_conf hdmi_v13_conf_720p60 = { .core = { .h_blank = {0x72 ,0x01 }, .v_blank = {0xee ,0xf2 ,0x00 },
@@ -182,7 +192,7 @@ static const struct hdmi_preset_conf hdmi_conf_720p60 = { }, }; -static const struct hdmi_preset_conf hdmi_conf_1080i50 = { +static const struct hdmi_v13_preset_conf hdmi_v13_conf_1080i50 = { .core = { .h_blank = {0xd0 ,0x02 }, .v_blank = {0x32 ,0xB2 ,0x00 },
@@ -210,7 +220,7 @@ static const struct hdmi_preset_conf hdmi_conf_1080i50 = { }, }; -static const struct hdmi_preset_conf hdmi_conf_1080p50 = { +static const struct hdmi_v13_preset_conf hdmi_v13_conf_1080p50 = { .core = { .h_blank = {0xd0 ,0x02 }, .v_blank = {0x65 ,0x6c ,0x01 },
@@ -238,7 +248,7 @@ static const struct hdmi_preset_conf hdmi_conf_1080p50 = { }, }; -static const struct hdmi_preset_conf hdmi_conf_1080i60 = { +static const struct hdmi_v13_preset_conf hdmi_v13_conf_1080i60 = { .core = { .h_blank = {0x18 ,0x01 }, .v_blank = {0x32 ,0xB2 ,0x00 },
@@ -266,7 +276,7 @@ static const struct hdmi_preset_conf hdmi_conf_1080i60 = { }, }; -static const struct hdmi_preset_conf hdmi_conf_1080p60 = { +static const struct hdmi_v13_preset_conf hdmi_v13_conf_1080p60 = { .core = { .h_blank = {0x18 ,0x01 }, .v_blank = {0x65 ,0x6c ,0x01 },
@@ -294,13 +304,530 @@ static const struct hdmi_preset_conf hdmi_conf_1080p60 = { }, }; +static const struct hdmi_v13_conf hdmi_v13_confs[] = { + {1280 ,720 ,60 , false, hdmiphy_v13_conf74_25, &hdmi_v13_conf_720p60 }, + {1280 ,720 ,50 , false, hdmiphy_v13_conf74_25, &hdmi_v13_conf_720p60 }, + {720 ,480 ,60 , false, hdmiphy_v13_conf27_027, &hdmi_v13_conf_480p }, + {1920 ,1080 ,50 , true, hdmiphy_v13_conf74_25, &hdmi_v13_conf_1080i50 }, + {1920 ,1080 ,50 , false, hdmiphy_v13_conf148_5, + &hdmi_v13_conf_1080p50 }, + {1920 ,1080 ,60 , true, hdmiphy_v13_conf74_25, &hdmi_v13_conf_1080i60 }, + {1920 ,1080 ,60 , false, hdmiphy_v13_conf148_5, + &hdmi_v13_conf_1080p60 }, +}; + +/* HDMI Version 1.4 */ +static const u8 hdmiphy_conf27_027[32 ] = { +0x01 ,0xd1 ,0x2d ,0x72 ,0x40 ,0x64 ,0x12 ,0x08 , +0x43 ,0xa0 ,0x0e ,0xd9 ,0x45 ,0xa0 ,0xac ,0x80 , +0x08 ,0x80 ,0x11 ,0x04 ,0x02 ,0x22 ,0x44 ,0x86 , +0x54 ,0xe3 ,0x24 ,0x00 ,0x00 ,0x00 ,0x01 ,0x00 , +}; + +static const u8 hdmiphy_conf74_25[32 ] = { +0x01 ,0xd1 ,0x1f ,0x10 ,0x40 ,0x40 ,0xf8 ,0x08 , +0x81 ,0xa0 ,0xba ,0xd8 ,0x45 ,0xa0 ,0xac ,0x80 , +0x3c ,0x80 ,0x11 ,0x04 ,0x02 ,0x22 ,0x44 ,0x86 , +0x54 ,0xa5 ,0x24 ,0x01 ,0x00 ,0x00 ,0x01 ,0x00 , +}; + +static const u8 hdmiphy_conf148_5[32 ] = { +0x01 ,0xd1 ,0x1f ,0x00 ,0x40 ,0x40 ,0xf8 ,0x08 , +0x81 ,0xa0 ,0xba ,0xd8 ,0x45 ,0xa0 ,0xac ,0x80 , +0x3c ,0x80 ,0x11 ,0x04 ,0x02 ,0x22 ,0x44 ,0x86 , +0x54 ,0x4b ,0x25 ,0x03 ,0x00 ,0x00 ,0x01 ,0x00 , +}; + +struct hdmi_tg_regs { +u8 cmd; +u8 h_fsz_l; +u8 h_fsz_h; +u8 hact_st_l; +u8 hact_st_h; +u8 hact_sz_l; +u8 hact_sz_h; +u8 v_fsz_l; +u8 v_fsz_h; +u8 vsync_l; +u8 vsync_h; +u8 vsync2_l; +u8 vsync2_h; +u8 vact_st_l; +u8 vact_st_h; +u8 vact_sz_l; +u8 vact_sz_h; +u8 field_chg_l; +u8 field_chg_h; +u8 vact_st2_l; +u8 vact_st2_h; +u8 vact_st3_l; +u8 vact_st3_h; +u8 vact_st4_l; +u8 vact_st4_h; +u8 vsync_top_hdmi_l; +u8 vsync_top_hdmi_h; +u8 vsync_bot_hdmi_l; +u8 vsync_bot_hdmi_h; +u8 field_top_hdmi_l; +u8 field_top_hdmi_h; +u8 field_bot_hdmi_l; +u8 field_bot_hdmi_h; +u8 tg_3d; +}; + +struct hdmi_core_regs { +u8 h_blank[2 ]; +u8 v2_blank[2 ]; +u8 v1_blank[2 ]; +u8 v_line[2 ]; +u8 h_line[2 ]; +u8 hsync_pol[1 ]; +u8 vsync_pol[1 ]; +u8 int_pro_mode[1 ]; +u8 v_blank_f0[2 ]; +u8 v_blank_f1[2 ]; +u8 h_sync_start[2 ]; +u8 h_sync_end[2 ]; +u8 v_sync_line_bef_2[2 ]; +u8 v_sync_line_bef_1[2 ]; +u8 v_sync_line_aft_2[2 ]; +u8 v_sync_line_aft_1[2 ]; +u8 v_sync_line_aft_pxl_2[2 ]; +u8 v_sync_line_aft_pxl_1[2 ]; +u8 v_blank_f2[2 ];/* for 3D mode */ +u8 v_blank_f3[2 ];/* for 3D mode */ +u8 v_blank_f4[2 ];/* for 3D mode */ +u8 v_blank_f5[2 ];/* for 3D mode */ +u8 v_sync_line_aft_3[2 ]; +u8 v_sync_line_aft_4[2 ]; +u8 v_sync_line_aft_5[2 ]; +u8 v_sync_line_aft_6[2 ]; +u8 v_sync_line_aft_pxl_3[2 ]; +u8 v_sync_line_aft_pxl_4[2 ]; +u8 v_sync_line_aft_pxl_5[2 ]; +u8 v_sync_line_aft_pxl_6[2 ]; +u8 vact_space_1[2 ]; +u8 vact_space_2[2 ]; +u8 vact_space_3[2 ]; +u8 vact_space_4[2 ]; +u8 vact_space_5[2 ]; +u8 vact_space_6[2 ]; +}; + +struct hdmi_preset_conf { +struct hdmi_core_regs core; +struct hdmi_tg_regs tg; +}; + +struct hdmi_conf { +int width; +int height; +int vrefresh; +bool interlace; +const u8 *hdmiphy_data; +const struct hdmi_preset_conf *conf; +}; + +static const struct hdmi_preset_conf hdmi_conf_480p60 = { + .core = { + .h_blank = {0x8a ,0x00 }, + .v2_blank = {0x0d ,0x02 }, + .v1_blank = {0x2d ,0x00 }, + .v_line = {0x0d ,0x02 }, + .h_line = {0x5a ,0x03 }, + .hsync_pol = {0x01 }, + .vsync_pol = {0x01 }, + .int_pro_mode = {0x00 }, + .v_blank_f0 = {0xff ,0xff }, + .v_blank_f1 = {0xff ,0xff }, + .h_sync_start = {0x0e ,0x00 }, + .h_sync_end = {0x4c ,0x00 }, + .v_sync_line_bef_2 = {0x0f ,0x00 }, + .v_sync_line_bef_1 = {0x09 ,0x00 }, + .v_sync_line_aft_2 = {0xff ,0xff }, + .v_sync_line_aft_1 = {0xff ,0xff }, + .v_sync_line_aft_pxl_2 = {0xff ,0xff }, + .v_sync_line_aft_pxl_1 = {0xff ,0xff }, + .v_blank_f2 = {0xff ,0xff }, + .v_blank_f3 = {0xff ,0xff }, + .v_blank_f4 = {0xff ,0xff }, + .v_blank_f5 = {0xff ,0xff }, + .v_sync_line_aft_3 = {0xff ,0xff }, + .v_sync_line_aft_4 = {0xff ,0xff }, + .v_sync_line_aft_5 = {0xff ,0xff }, + .v_sync_line_aft_6 = {0xff ,0xff }, + .v_sync_line_aft_pxl_3 = {0xff ,0xff }, + .v_sync_line_aft_pxl_4 = {0xff ,0xff }, + .v_sync_line_aft_pxl_5 = {0xff ,0xff }, + .v_sync_line_aft_pxl_6 = {0xff ,0xff }, + .vact_space_1 = {0xff ,0xff }, + .vact_space_2 = {0xff ,0xff }, + .vact_space_3 = {0xff ,0xff }, + .vact_space_4 = {0xff ,0xff }, + .vact_space_5 = {0xff ,0xff }, + .vact_space_6 = {0xff ,0xff }, +/* other don't care */ + }, + .tg = { +0x00 ,/* cmd */ +0x5a ,0x03 ,/* h_fsz */ +0x8a ,0x00 ,0xd0 ,0x02 ,/* hact */ +0x0d ,0x02 ,/* v_fsz */ +0x01 ,0x00 ,0x33 ,0x02 ,/* vsync */ +0x2d ,0x00 ,0xe0 ,0x01 ,/* vact */ +0x33 ,0x02 ,/* field_chg */ +0x48 ,0x02 ,/* vact_st2 */ +0x00 ,0x00 ,/* vact_st3 */ +0x00 ,0x00 ,/* vact_st4 */ +0x01 ,0x00 ,0x01 ,0x00 ,/* vsync top/bot */ +0x01 ,0x00 ,0x33 ,0x02 ,/* field top/bot */ +0x00 ,/* 3d FP */ + }, +}; + +static const struct hdmi_preset_conf hdmi_conf_720p50 = { + .core = { + .h_blank = {0xbc ,0x02 }, + .v2_blank = {0xee ,0x02 }, + .v1_blank = {0x1e ,0x00 }, + .v_line = {0xee ,0x02 }, + .h_line = {0xbc ,0x07 }, + .hsync_pol = {0x00 }, + .vsync_pol = {0x00 }, + .int_pro_mode = {0x00 }, + .v_blank_f0 = {0xff ,0xff }, + .v_blank_f1 = {0xff ,0xff }, + .h_sync_start = {0xb6 ,0x01 }, + .h_sync_end = {0xde ,0x01 }, + .v_sync_line_bef_2 = {0x0a ,0x00 }, + .v_sync_line_bef_1 = {0x05 ,0x00 }, + .v_sync_line_aft_2 = {0xff ,0xff }, + .v_sync_line_aft_1 = {0xff ,0xff }, + .v_sync_line_aft_pxl_2 = {0xff ,0xff }, + .v_sync_line_aft_pxl_1 = {0xff ,0xff }, + .v_blank_f2 = {0xff ,0xff }, + .v_blank_f3 = {0xff ,0xff }, + .v_blank_f4 = {0xff ,0xff }, + .v_blank_f5 = {0xff ,0xff }, + .v_sync_line_aft_3 = {0xff ,0xff }, + .v_sync_line_aft_4 = {0xff ,0xff }, + .v_sync_line_aft_5 = {0xff ,0xff }, + .v_sync_line_aft_6 = {0xff ,0xff }, + .v_sync_line_aft_pxl_3 = {0xff ,0xff }, + .v_sync_line_aft_pxl_4 = {0xff ,0xff }, + .v_sync_line_aft_pxl_5 = {0xff ,0xff }, + .v_sync_line_aft_pxl_6 = {0xff ,0xff }, + .vact_space_1 = {0xff ,0xff }, + .vact_space_2 = {0xff ,0xff }, + .vact_space_3 = {0xff ,0xff }, + .vact_space_4 = {0xff ,0xff }, + .vact_space_5 = {0xff ,0xff }, + .vact_space_6 = {0xff ,0xff }, +/* other don't care */ + }, + .tg = { +0x00 ,/* cmd */ +0xbc ,0x07 ,/* h_fsz */ +0xbc ,0x02 ,0x00 ,0x05 ,/* hact */ +0xee ,0x02 ,/* v_fsz */ +0x01 ,0x00 ,0x33 ,0x02 ,/* vsync */ +0x1e ,0x00 ,0xd0 ,0x02 ,/* vact */ +0x33 ,0x02 ,/* field_chg */ +0x48 ,0x02 ,/* vact_st2 */ +0x00 ,0x00 ,/* vact_st3 */ +0x00 ,0x00 ,/* vact_st4 */ +0x01 ,0x00 ,0x01 ,0x00 ,/* vsync top/bot */ +0x01 ,0x00 ,0x33 ,0x02 ,/* field top/bot */ +0x00 ,/* 3d FP */ + }, +}; + +static const struct hdmi_preset_conf hdmi_conf_720p60 = { + .core = { + .h_blank = {0x72 ,0x01 }, + .v2_blank = {0xee ,0x02 }, + .v1_blank = {0x1e ,0x00 }, + .v_line = {0xee ,0x02 }, + .h_line = {0x72 ,0x06 }, + .hsync_pol = {0x00 }, + .vsync_pol = {0x00 }, + .int_pro_mode = {0x00 }, + .v_blank_f0 = {0xff ,0xff }, + .v_blank_f1 = {0xff ,0xff }, + .h_sync_start = {0x6c ,0x00 }, + .h_sync_end = {0x94 ,0x00 }, + .v_sync_line_bef_2 = {0x0a ,0x00 }, + .v_sync_line_bef_1 = {0x05 ,0x00 }, + .v_sync_line_aft_2 = {0xff ,0xff }, + .v_sync_line_aft_1 = {0xff ,0xff }, + .v_sync_line_aft_pxl_2 = {0xff ,0xff }, + .v_sync_line_aft_pxl_1 = {0xff ,0xff }, + .v_blank_f2 = {0xff ,0xff }, + .v_blank_f3 = {0xff ,0xff }, + .v_blank_f4 = {0xff ,0xff }, + .v_blank_f5 = {0xff ,0xff }, + .v_sync_line_aft_3 = {0xff ,0xff }, + .v_sync_line_aft_4 = {0xff ,0xff }, + .v_sync_line_aft_5 = {0xff ,0xff }, + .v_sync_line_aft_6 = {0xff ,0xff }, + .v_sync_line_aft_pxl_3 = {0xff ,0xff }, + .v_sync_line_aft_pxl_4 = {0xff ,0xff }, + .v_sync_line_aft_pxl_5 = {0xff ,0xff }, + .v_sync_line_aft_pxl_6 = {0xff ,0xff }, + .vact_space_1 = {0xff ,0xff }, + .vact_space_2 = {0xff ,0xff }, + .vact_space_3 = {0xff ,0xff }, + .vact_space_4 = {0xff ,0xff }, + .vact_space_5 = {0xff ,0xff }, + .vact_space_6 = {0xff ,0xff }, +/* other don't care */ + }, + .tg = { +0x00 ,/* cmd */ +0x72 ,0x06 ,/* h_fsz */ +0x72 ,0x01 ,0x00 ,0x05 ,/* hact */ +0xee ,0x02 ,/* v_fsz */ +0x01 ,0x00 ,0x33 ,0x02 ,/* vsync */ +0x1e ,0x00 ,0xd0 ,0x02 ,/* vact */ +0x33 ,0x02 ,/* field_chg */ +0x48 ,0x02 ,/* vact_st2 */ +0x00 ,0x00 ,/* vact_st3 */ +0x00 ,0x00 ,/* vact_st4 */ +0x01 ,0x00 ,0x01 ,0x00 ,/* vsync top/bot */ +0x01 ,0x00 ,0x33 ,0x02 ,/* field top/bot */ +0x00 ,/* 3d FP */ + }, +}; + +static const struct hdmi_preset_conf hdmi_conf_1080i50 = { + .core = { + .h_blank = {0xd0 ,0x02 }, + .v2_blank = {0x32 ,0x02 }, + .v1_blank = {0x16 ,0x00 }, + .v_line = {0x65 ,0x04 }, + .h_line = {0x50 ,0x0a }, + .hsync_pol = {0x00 }, + .vsync_pol = {0x00 }, + .int_pro_mode = {0x01 }, + .v_blank_f0 = {0x49 ,0x02 }, + .v_blank_f1 = {0x65 ,0x04 }, + .h_sync_start = {0x0e ,0x02 }, + .h_sync_end = {0x3a ,0x02 }, + .v_sync_line_bef_2 = {0x07 ,0x00 }, + .v_sync_line_bef_1 = {0x02 ,0x00 }, + .v_sync_line_aft_2 = {0x39 ,0x02 }, + .v_sync_line_aft_1 = {0x34 ,0x02 }, + .v_sync_line_aft_pxl_2 = {0x38 ,0x07 }, + .v_sync_line_aft_pxl_1 = {0x38 ,0x07 }, + .v_blank_f2 = {0xff ,0xff }, + .v_blank_f3 = {0xff ,0xff }, + .v_blank_f4 = {0xff ,0xff }, + .v_blank_f5 = {0xff ,0xff }, + .v_sync_line_aft_3 = {0xff ,0xff }, + .v_sync_line_aft_4 = {0xff ,0xff }, + .v_sync_line_aft_5 = {0xff ,0xff }, + .v_sync_line_aft_6 = {0xff ,0xff }, + .v_sync_line_aft_pxl_3 = {0xff ,0xff }, + .v_sync_line_aft_pxl_4 = {0xff ,0xff }, + .v_sync_line_aft_pxl_5 = {0xff ,0xff }, + .v_sync_line_aft_pxl_6 = {0xff ,0xff }, + .vact_space_1 = {0xff ,0xff }, + .vact_space_2 = {0xff ,0xff }, + .vact_space_3 = {0xff ,0xff }, + .vact_space_4 = {0xff ,0xff }, + .vact_space_5 = {0xff ,0xff }, + .vact_space_6 = {0xff ,0xff }, +/* other don't care */ + }, + .tg = { +0x00 ,/* cmd */ +0x50 ,0x0a ,/* h_fsz */ +0xd0 ,0x02 ,0x80 ,0x07 ,/* hact */ +0x65 ,0x04 ,/* v_fsz */ +0x01 ,0x00 ,0x33 ,0x02 ,/* vsync */ +0x16 ,0x00 ,0x1c ,0x02 ,/* vact */ +0x33 ,0x02 ,/* field_chg */ +0x49 ,0x02 ,/* vact_st2 */ +0x00 ,0x00 ,/* vact_st3 */ +0x00 ,0x00 ,/* vact_st4 */ +0x01 ,0x00 ,0x33 ,0x02 ,/* vsync top/bot */ +0x01 ,0x00 ,0x33 ,0x02 ,/* field top/bot */ +0x00 ,/* 3d FP */ + }, +}; + +static const struct hdmi_preset_conf hdmi_conf_1080i60 = { + .core = { + .h_blank = {0x18 ,0x01 }, + .v2_blank = {0x32 ,0x02 }, + .v1_blank = {0x16 ,0x00 }, + .v_line = {0x65 ,0x04 }, + .h_line = {0x98 ,0x08 }, + .hsync_pol = {0x00 }, + .vsync_pol = {0x00 }, + .int_pro_mode = {0x01 }, + .v_blank_f0 = {0x49 ,0x02 }, + .v_blank_f1 = {0x65 ,0x04 }, + .h_sync_start = {0x56 ,0x00 }, + .h_sync_end = {0x82 ,0x00 }, + .v_sync_line_bef_2 = {0x07 ,0x00 }, + .v_sync_line_bef_1 = {0x02 ,0x00 }, + .v_sync_line_aft_2 = {0x39 ,0x02 }, + .v_sync_line_aft_1 = {0x34 ,0x02 }, + .v_sync_line_aft_pxl_2 = {0xa4 ,0x04 }, + .v_sync_line_aft_pxl_1 = {0xa4 ,0x04 }, + .v_blank_f2 = {0xff ,0xff }, + .v_blank_f3 = {0xff ,0xff }, + .v_blank_f4 = {0xff ,0xff }, + .v_blank_f5 = {0xff ,0xff }, + .v_sync_line_aft_3 = {0xff ,0xff }, + .v_sync_line_aft_4 = {0xff ,0xff }, + .v_sync_line_aft_5 = {0xff ,0xff }, + .v_sync_line_aft_6 = {0xff ,0xff }, + .v_sync_line_aft_pxl_3 = {0xff ,0xff }, + .v_sync_line_aft_pxl_4 = {0xff ,0xff }, + .v_sync_line_aft_pxl_5 = {0xff ,0xff }, + .v_sync_line_aft_pxl_6 = {0xff ,0xff }, + .vact_space_1 = {0xff ,0xff }, + .vact_space_2 = {0xff ,0xff }, + .vact_space_3 = {0xff ,0xff }, + .vact_space_4 = {0xff ,0xff }, + .vact_space_5 = {0xff ,0xff }, + .vact_space_6 = {0xff ,0xff }, +/* other don't care */ + }, + .tg = { +0x00 ,/* cmd */ +0x98 ,0x08 ,/* h_fsz */ +0x18 ,0x01 ,0x80 ,0x07 ,/* hact */ +0x65 ,0x04 ,/* v_fsz */ +0x01 ,0x00 ,0x33 ,0x02 ,/* vsync */ +0x16 ,0x00 ,0x1c ,0x02 ,/* vact */ +0x33 ,0x02 ,/* field_chg */ +0x49 ,0x02 ,/* vact_st2 */ +0x00 ,0x00 ,/* vact_st3 */ +0x00 ,0x00 ,/* vact_st4 */ +0x01 ,0x00 ,0x33 ,0x02 ,/* vsync top/bot */ +0x01 ,0x00 ,0x33 ,0x02 ,/* field top/bot */ +0x00 ,/* 3d FP */ + }, +}; + +static const struct hdmi_preset_conf hdmi_conf_1080p50 = { + .core = { + .h_blank = {0xd0 ,0x02 }, + .v2_blank = {0x65 ,0x04 }, + .v1_blank = {0x2d ,0x00 }, + .v_line = {0x65 ,0x04 }, + .h_line = {0x50 ,0x0a }, + .hsync_pol = {0x00 }, + .vsync_pol = {0x00 }, + .int_pro_mode = {0x00 }, + .v_blank_f0 = {0xff ,0xff }, + .v_blank_f1 = {0xff ,0xff }, + .h_sync_start = {0x0e ,0x02 }, + .h_sync_end = {0x3a ,0x02 }, + .v_sync_line_bef_2 = {0x09 ,0x00 }, + .v_sync_line_bef_1 = {0x04 ,0x00 }, + .v_sync_line_aft_2 = {0xff ,0xff }, + .v_sync_line_aft_1 = {0xff ,0xff }, + .v_sync_line_aft_pxl_2 = {0xff ,0xff }, + .v_sync_line_aft_pxl_1 = {0xff ,0xff }, + .v_blank_f2 = {0xff ,0xff }, + .v_blank_f3 = {0xff ,0xff }, + .v_blank_f4 = {0xff ,0xff }, + .v_blank_f5 = {0xff ,0xff }, + .v_sync_line_aft_3 = {0xff ,0xff }, + .v_sync_line_aft_4 = {0xff ,0xff }, + .v_sync_line_aft_5 = {0xff ,0xff }, + .v_sync_line_aft_6 = {0xff ,0xff }, + .v_sync_line_aft_pxl_3 = {0xff ,0xff }, + .v_sync_line_aft_pxl_4 = {0xff ,0xff }, + .v_sync_line_aft_pxl_5 = {0xff ,0xff }, + .v_sync_line_aft_pxl_6 = {0xff ,0xff }, + .vact_space_1 = {0xff ,0xff }, + .vact_space_2 = {0xff ,0xff }, + .vact_space_3 = {0xff ,0xff }, + .vact_space_4 = {0xff ,0xff }, + .vact_space_5 = {0xff ,0xff }, + .vact_space_6 = {0xff ,0xff }, +/* other don't care */ + }, + .tg = { +0x00 ,/* cmd */ +0x50 ,0x0a ,/* h_fsz */ +0xd0 ,0x02 ,0x80 ,0x07 ,/* hact */ +0x65 ,0x04 ,/* v_fsz */ +0x01 ,0x00 ,0x33 ,0x02 ,/* vsync */ +0x2d ,0x00 ,0x38 ,0x04 ,/* vact */ +0x33 ,0x02 ,/* field_chg */ +0x48 ,0x02 ,/* vact_st2 */ +0x00 ,0x00 ,/* vact_st3 */ +0x00 ,0x00 ,/* vact_st4 */ +0x01 ,0x00 ,0x01 ,0x00 ,/* vsync top/bot */ +0x01 ,0x00 ,0x33 ,0x02 ,/* field top/bot */ +0x00 ,/* 3d FP */ + }, +}; + +static const struct hdmi_preset_conf hdmi_conf_1080p60 = { + .core = { + .h_blank = {0x18 ,0x01 }, + .v2_blank = {0x65 ,0x04 }, + .v1_blank = {0x2d ,0x00 }, + .v_line = {0x65 ,0x04 }, + .h_line = {0x98 ,0x08 }, + .hsync_pol = {0x00 }, + .vsync_pol = {0x00 }, + .int_pro_mode = {0x00 }, + .v_blank_f0 = {0xff ,0xff }, + .v_blank_f1 = {0xff ,0xff }, + .h_sync_start = {0x56 ,0x00 }, + .h_sync_end = {0x82 ,0x00 }, + .v_sync_line_bef_2 = {0x09 ,0x00 }, + .v_sync_line_bef_1 = {0x04 ,0x00 }, + .v_sync_line_aft_2 = {0xff ,0xff }, + .v_sync_line_aft_1 = {0xff ,0xff }, + .v_sync_line_aft_pxl_2 = {0xff ,0xff }, + .v_sync_line_aft_pxl_1 = {0xff ,0xff }, + .v_blank_f2 = {0xff ,0xff }, + .v_blank_f3 = {0xff ,0xff }, + .v_blank_f4 = {0xff ,0xff }, + .v_blank_f5 = {0xff ,0xff }, + .v_sync_line_aft_3 = {0xff ,0xff }, + .v_sync_line_aft_4 = {0xff ,0xff }, + .v_sync_line_aft_5 = {0xff ,0xff }, + .v_sync_line_aft_6 = {0xff ,0xff }, + .v_sync_line_aft_pxl_3 = {0xff ,0xff }, + .v_sync_line_aft_pxl_4 = {0xff ,0xff }, + .v_sync_line_aft_pxl_5 = {0xff ,0xff }, + .v_sync_line_aft_pxl_6 = {0xff ,0xff }, +/* other don't care */ + }, + .tg = { +0x00 ,/* cmd */ +0x98 ,0x08 ,/* h_fsz */ +0x18 ,0x01 ,0x80 ,0x07 ,/* hact */ +0x65 ,0x04 ,/* v_fsz */ +0x01 ,0x00 ,0x33 ,0x02 ,/* vsync */ +0x2d ,0x00 ,0x38 ,0x04 ,/* vact */ +0x33 ,0x02 ,/* field_chg */ +0x48 ,0x02 ,/* vact_st2 */ +0x00 ,0x00 ,/* vact_st3 */ +0x00 ,0x00 ,/* vact_st4 */ +0x01 ,0x00 ,0x01 ,0x00 ,/* vsync top/bot */ +0x01 ,0x00 ,0x33 ,0x02 ,/* field top/bot */ +0x00 ,/* 3d FP */ + }, +}; +static const struct hdmi_conf hdmi_confs[] = { + {720 ,480 ,60 , false, hdmiphy_conf27_027, &hdmi_conf_480p60 }, + {1280 ,720 ,50 , false, hdmiphy_conf74_25, &hdmi_conf_720p50 }, {1280 ,720 ,60 , false, hdmiphy_conf74_25, &hdmi_conf_720p60 }, - {1280 ,720 ,50 , false, hdmiphy_conf74_25, &hdmi_conf_720p60 }, - {720 ,480 ,60 , false, hdmiphy_conf27_027, &hdmi_conf_480p }, {1920 ,1080 ,50 , true, hdmiphy_conf74_25, &hdmi_conf_1080i50 }, - {1920 ,1080 ,50 , false, hdmiphy_conf148_5, &hdmi_conf_1080p50 }, {1920 ,1080 ,60 , true, hdmiphy_conf74_25, &hdmi_conf_1080i60 }, + {1920 ,1080 ,50 , false, hdmiphy_conf148_5, &hdmi_conf_1080p50 }, {1920 ,1080 ,60 , false, hdmiphy_conf148_5, &hdmi_conf_1080p60 }, };
@@ -324,7 +851,7 @@ static inline void hdmi_reg_writemask(struct hdmi_context *hdata,writel (value, hdata->regs + reg_id); } -static void hdmi_regs_dump (struct hdmi_context *hdata,char *prefix) +static void hdmi_v13_regs_dump (struct hdmi_context *hdata,char *prefix) {#define DUMPREG (reg_id) \ DRM_DEBUG_KMS("%s:" #reg_id " = %08x\n", prefix, \
@@ -333,6 +860,101 @@ static void hdmi_regs_dump(struct hdmi_context *hdata, char *prefix)DUMPREG (HDMI_INTC_FLAG );DUMPREG (HDMI_INTC_CON );DUMPREG (HDMI_HPD_STATUS ); +DUMPREG (HDMI_V13_PHY_RSTOUT ); +DUMPREG (HDMI_V13_PHY_VPLL ); +DUMPREG (HDMI_V13_PHY_CMU ); +DUMPREG (HDMI_V13_CORE_RSTOUT ); + +DRM_DEBUG_KMS ("%s: ---- CORE REGISTERS ----\n" , prefix); +DUMPREG (HDMI_CON_0 ); +DUMPREG (HDMI_CON_1 ); +DUMPREG (HDMI_CON_2 ); +DUMPREG (HDMI_SYS_STATUS ); +DUMPREG (HDMI_V13_PHY_STATUS ); +DUMPREG (HDMI_STATUS_EN ); +DUMPREG (HDMI_HPD ); +DUMPREG (HDMI_MODE_SEL ); +DUMPREG (HDMI_V13_HPD_GEN ); +DUMPREG (HDMI_V13_DC_CONTROL ); +DUMPREG (HDMI_V13_VIDEO_PATTERN_GEN ); + +DRM_DEBUG_KMS ("%s: ---- CORE SYNC REGISTERS ----\n" , prefix); +DUMPREG (HDMI_H_BLANK_0 ); +DUMPREG (HDMI_H_BLANK_1 ); +DUMPREG (HDMI_V13_V_BLANK_0 ); +DUMPREG (HDMI_V13_V_BLANK_1 ); +DUMPREG (HDMI_V13_V_BLANK_2 ); +DUMPREG (HDMI_V13_H_V_LINE_0 ); +DUMPREG (HDMI_V13_H_V_LINE_1 ); +DUMPREG (HDMI_V13_H_V_LINE_2 ); +DUMPREG (HDMI_VSYNC_POL ); +DUMPREG (HDMI_INT_PRO_MODE ); +DUMPREG (HDMI_V13_V_BLANK_F_0 ); +DUMPREG (HDMI_V13_V_BLANK_F_1 ); +DUMPREG (HDMI_V13_V_BLANK_F_2 ); +DUMPREG (HDMI_V13_H_SYNC_GEN_0 ); +DUMPREG (HDMI_V13_H_SYNC_GEN_1 ); +DUMPREG (HDMI_V13_H_SYNC_GEN_2 ); +DUMPREG (HDMI_V13_V_SYNC_GEN_1_0 ); +DUMPREG (HDMI_V13_V_SYNC_GEN_1_1 ); +DUMPREG (HDMI_V13_V_SYNC_GEN_1_2 ); +DUMPREG (HDMI_V13_V_SYNC_GEN_2_0 ); +DUMPREG (HDMI_V13_V_SYNC_GEN_2_1 ); +DUMPREG (HDMI_V13_V_SYNC_GEN_2_2 ); +DUMPREG (HDMI_V13_V_SYNC_GEN_3_0 ); +DUMPREG (HDMI_V13_V_SYNC_GEN_3_1 ); +DUMPREG (HDMI_V13_V_SYNC_GEN_3_2 ); + +DRM_DEBUG_KMS ("%s: ---- TG REGISTERS ----\n" , prefix); +DUMPREG (HDMI_TG_CMD ); +DUMPREG (HDMI_TG_H_FSZ_L ); +DUMPREG (HDMI_TG_H_FSZ_H ); +DUMPREG (HDMI_TG_HACT_ST_L ); +DUMPREG (HDMI_TG_HACT_ST_H ); +DUMPREG (HDMI_TG_HACT_SZ_L ); +DUMPREG (HDMI_TG_HACT_SZ_H ); +DUMPREG (HDMI_TG_V_FSZ_L ); +DUMPREG (HDMI_TG_V_FSZ_H ); +DUMPREG (HDMI_TG_VSYNC_L ); +DUMPREG (HDMI_TG_VSYNC_H ); +DUMPREG (HDMI_TG_VSYNC2_L ); +DUMPREG (HDMI_TG_VSYNC2_H ); +DUMPREG (HDMI_TG_VACT_ST_L ); +DUMPREG (HDMI_TG_VACT_ST_H ); +DUMPREG (HDMI_TG_VACT_SZ_L ); +DUMPREG (HDMI_TG_VACT_SZ_H ); +DUMPREG (HDMI_TG_FIELD_CHG_L ); +DUMPREG (HDMI_TG_FIELD_CHG_H ); +DUMPREG (HDMI_TG_VACT_ST2_L ); +DUMPREG (HDMI_TG_VACT_ST2_H ); +DUMPREG (HDMI_TG_VSYNC_TOP_HDMI_L ); +DUMPREG (HDMI_TG_VSYNC_TOP_HDMI_H ); +DUMPREG (HDMI_TG_VSYNC_BOT_HDMI_L ); +DUMPREG (HDMI_TG_VSYNC_BOT_HDMI_H ); +DUMPREG (HDMI_TG_FIELD_TOP_HDMI_L ); +DUMPREG (HDMI_TG_FIELD_TOP_HDMI_H ); +DUMPREG (HDMI_TG_FIELD_BOT_HDMI_L ); +DUMPREG (HDMI_TG_FIELD_BOT_HDMI_H ); +#undef DUMPREG +} + +static void hdmi_v14_regs_dump (struct hdmi_context *hdata,char *prefix) +{ +int i; + +#define DUMPREG (reg_id) \ + DRM_DEBUG_KMS("%s:" #reg_id " = %08x\n", prefix, \ + readl(hdata->regs + reg_id)) + +DRM_DEBUG_KMS ("%s: ---- CONTROL REGISTERS ----\n" , prefix); +DUMPREG (HDMI_INTC_CON ); +DUMPREG (HDMI_INTC_FLAG ); +DUMPREG (HDMI_HPD_STATUS ); +DUMPREG (HDMI_INTC_CON_1 ); +DUMPREG (HDMI_INTC_FLAG_1 ); +DUMPREG (HDMI_PHY_STATUS_0 ); +DUMPREG (HDMI_PHY_STATUS_PLL ); +DUMPREG (HDMI_PHY_CON_0 );DUMPREG (HDMI_PHY_RSTOUT );DUMPREG (HDMI_PHY_VPLL );DUMPREG (HDMI_PHY_CMU );
@@ -343,40 +965,93 @@ static void hdmi_regs_dump(struct hdmi_context *hdata, char *prefix)DUMPREG (HDMI_CON_1 );DUMPREG (HDMI_CON_2 );DUMPREG (HDMI_SYS_STATUS ); -DUMPREG (HDMI_PHY_STATUS ); +DUMPREG (HDMI_PHY_STATUS_0 );DUMPREG (HDMI_STATUS_EN );DUMPREG (HDMI_HPD );DUMPREG (HDMI_MODE_SEL ); -DUMPREG (HDMI_HPD_GEN ); +DUMPREG (HDMI_ENC_EN );DUMPREG (HDMI_DC_CONTROL );DUMPREG (HDMI_VIDEO_PATTERN_GEN );DRM_DEBUG_KMS ("%s: ---- CORE SYNC REGISTERS ----\n" , prefix);DUMPREG (HDMI_H_BLANK_0 );DUMPREG (HDMI_H_BLANK_1 ); -DUMPREG (HDMI_V_BLANK_0 ); -DUMPREG (HDMI_V_BLANK_1 ); -DUMPREG (HDMI_V_BLANK_2 ); -DUMPREG (HDMI_H_V_LINE_0 ); -DUMPREG (HDMI_H_V_LINE_1 ); -DUMPREG (HDMI_H_V_LINE_2 ); +DUMPREG (HDMI_V2_BLANK_0 ); +DUMPREG (HDMI_V2_BLANK_1 ); +DUMPREG (HDMI_V1_BLANK_0 ); +DUMPREG (HDMI_V1_BLANK_1 ); +DUMPREG (HDMI_V_LINE_0 ); +DUMPREG (HDMI_V_LINE_1 ); +DUMPREG (HDMI_H_LINE_0 ); +DUMPREG (HDMI_H_LINE_1 ); +DUMPREG (HDMI_HSYNC_POL ); +DUMPREG (HDMI_VSYNC_POL );DUMPREG (HDMI_INT_PRO_MODE ); -DUMPREG (HDMI_V_BLANK_F_0 ); -DUMPREG (HDMI_V_BLANK_F_1 ); -DUMPREG (HDMI_V_BLANK_F_2 ); -DUMPREG (HDMI_H_SYNC_GEN_0 ); -DUMPREG (HDMI_H_SYNC_GEN_1 ); -DUMPREG (HDMI_H_SYNC_GEN_2 ); -DUMPREG (HDMI_V_SYNC_GEN_1_0 ); -DUMPREG (HDMI_V_SYNC_GEN_1_1 ); -DUMPREG (HDMI_V_SYNC_GEN_1_2 ); -DUMPREG (HDMI_V_SYNC_GEN_2_0 ); -DUMPREG (HDMI_V_SYNC_GEN_2_1 ); -DUMPREG (HDMI_V_SYNC_GEN_2_2 ); -DUMPREG (HDMI_V_SYNC_GEN_3_0 ); -DUMPREG (HDMI_V_SYNC_GEN_3_1 ); -DUMPREG (HDMI_V_SYNC_GEN_3_2 ); +DUMPREG (HDMI_V_BLANK_F0_0 ); +DUMPREG (HDMI_V_BLANK_F0_1 ); +DUMPREG (HDMI_V_BLANK_F1_0 ); +DUMPREG (HDMI_V_BLANK_F1_1 ); + +DUMPREG (HDMI_H_SYNC_START_0 ); +DUMPREG (HDMI_H_SYNC_START_1 ); +DUMPREG (HDMI_H_SYNC_END_0 ); +DUMPREG (HDMI_H_SYNC_END_1 ); + +DUMPREG (HDMI_V_SYNC_LINE_BEF_2_0 ); +DUMPREG (HDMI_V_SYNC_LINE_BEF_2_1 ); +DUMPREG (HDMI_V_SYNC_LINE_BEF_1_0 ); +DUMPREG (HDMI_V_SYNC_LINE_BEF_1_1 ); + +DUMPREG (HDMI_V_SYNC_LINE_AFT_2_0 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_2_1 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_1_0 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_1_1 ); + +DUMPREG (HDMI_V_SYNC_LINE_AFT_PXL_2_0 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_PXL_2_1 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_PXL_1_0 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_PXL_1_1 ); + +DUMPREG (HDMI_V_BLANK_F2_0 ); +DUMPREG (HDMI_V_BLANK_F2_1 ); +DUMPREG (HDMI_V_BLANK_F3_0 ); +DUMPREG (HDMI_V_BLANK_F3_1 ); +DUMPREG (HDMI_V_BLANK_F4_0 ); +DUMPREG (HDMI_V_BLANK_F4_1 ); +DUMPREG (HDMI_V_BLANK_F5_0 ); +DUMPREG (HDMI_V_BLANK_F5_1 ); + +DUMPREG (HDMI_V_SYNC_LINE_AFT_3_0 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_3_1 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_4_0 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_4_1 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_5_0 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_5_1 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_6_0 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_6_1 ); + +DUMPREG (HDMI_V_SYNC_LINE_AFT_PXL_3_0 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_PXL_3_1 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_PXL_4_0 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_PXL_4_1 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_PXL_5_0 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_PXL_5_1 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_PXL_6_0 ); +DUMPREG (HDMI_V_SYNC_LINE_AFT_PXL_6_1 ); + +DUMPREG (HDMI_VACT_SPACE_1_0 ); +DUMPREG (HDMI_VACT_SPACE_1_1 ); +DUMPREG (HDMI_VACT_SPACE_2_0 ); +DUMPREG (HDMI_VACT_SPACE_2_1 ); +DUMPREG (HDMI_VACT_SPACE_3_0 ); +DUMPREG (HDMI_VACT_SPACE_3_1 ); +DUMPREG (HDMI_VACT_SPACE_4_0 ); +DUMPREG (HDMI_VACT_SPACE_4_1 ); +DUMPREG (HDMI_VACT_SPACE_5_0 ); +DUMPREG (HDMI_VACT_SPACE_5_1 ); +DUMPREG (HDMI_VACT_SPACE_6_0 ); +DUMPREG (HDMI_VACT_SPACE_6_1 );DRM_DEBUG_KMS ("%s: ---- TG REGISTERS ----\n" , prefix);DUMPREG (HDMI_TG_CMD );
@@ -400,6 +1075,10 @@ static void hdmi_regs_dump(struct hdmi_context *hdata, char *prefix)DUMPREG (HDMI_TG_FIELD_CHG_H );DUMPREG (HDMI_TG_VACT_ST2_L );DUMPREG (HDMI_TG_VACT_ST2_H ); +DUMPREG (HDMI_TG_VACT_ST3_L ); +DUMPREG (HDMI_TG_VACT_ST3_H ); +DUMPREG (HDMI_TG_VACT_ST4_L ); +DUMPREG (HDMI_TG_VACT_ST4_H );DUMPREG (HDMI_TG_VSYNC_TOP_HDMI_L );DUMPREG (HDMI_TG_VSYNC_TOP_HDMI_H );DUMPREG (HDMI_TG_VSYNC_BOT_HDMI_L );
@@ -408,10 +1087,49 @@ static void hdmi_regs_dump(struct hdmi_context *hdata, char *prefix)DUMPREG (HDMI_TG_FIELD_TOP_HDMI_H );DUMPREG (HDMI_TG_FIELD_BOT_HDMI_L );DUMPREG (HDMI_TG_FIELD_BOT_HDMI_H ); +DUMPREG (HDMI_TG_3D ); + +DRM_DEBUG_KMS ("%s: ---- PACKET REGISTERS ----\n" , prefix); +DUMPREG (HDMI_AVI_CON ); +DUMPREG (HDMI_AVI_HEADER0 ); +DUMPREG (HDMI_AVI_HEADER1 ); +DUMPREG (HDMI_AVI_HEADER2 ); +DUMPREG (HDMI_AVI_CHECK_SUM ); +DUMPREG (HDMI_VSI_CON ); +DUMPREG (HDMI_VSI_HEADER0 ); +DUMPREG (HDMI_VSI_HEADER1 ); +DUMPREG (HDMI_VSI_HEADER2 ); +for (i =0 ; i <7 ; ++i) +DUMPREG (HDMI_VSI_DATA (i)); +#undef DUMPREG } -static int hdmi_conf_index (struct drm_display_mode *mode) +static void hdmi_regs_dump (struct hdmi_context *hdata,char *prefix) +{ +if (hdata->is_v13) +hdmi_v13_regs_dump (hdata, prefix); +else +hdmi_v14_regs_dump (hdata, prefix); +} + +static int hdmi_v13_conf_index (struct drm_display_mode *mode) +{ +int i; + +for (i =0 ; i <ARRAY_SIZE (hdmi_v13_confs); ++i) +if (hdmi_v13_confs[i].width == mode->hdisplay && + hdmi_v13_confs[i].height == mode->vdisplay && + hdmi_v13_confs[i].vrefresh == mode->vrefresh && + hdmi_v13_confs[i].interlace == + ((mode->flags &DRM_MODE_FLAG_INTERLACE ) ? + true : false)) +return i; + +return -1 ; +} + +static int hdmi_v14_conf_index (struct drm_display_mode *mode) {int i;
@@ -427,6 +1145,15 @@ static int hdmi_conf_index(struct drm_display_mode *mode)return -1 ; } +static int hdmi_conf_index (struct hdmi_context *hdata, +struct drm_display_mode *mode) +{ +if (hdata->is_v13) +return hdmi_v13_conf_index (mode); +else +return hdmi_v14_conf_index (mode); +} +static bool hdmi_is_connected (void *ctx) {struct hdmi_context *hdata = (struct hdmi_context *)ctx;
@@ -462,16 +1189,25 @@ static int hdmi_get_edid(void *ctx, struct drm_connector *connector,return 0 ; } -static int hdmi_check_timing (void *ctx,void *timing) +static int hdmi_v13_check_timing (struct fb_videomode *check_timing) { -struct fb_videomode *check_timing = timing;int i; -DRM_DEBUG_KMS ("[%d] %s\n" , __LINE__, __func__); +for (i =0 ; i <ARRAY_SIZE (hdmi_v13_confs); ++i) +if (hdmi_v13_confs[i].width == check_timing->xres && + hdmi_v13_confs[i].height == check_timing->yres && + hdmi_v13_confs[i].vrefresh == check_timing->refresh && + hdmi_v13_confs[i].interlace == + ((check_timing->vmode &FB_VMODE_INTERLACED ) ? + true : false)) +return 0 ; -DRM_DEBUG_KMS ("[%d]x[%d] [%d]Hz [%x]\n" , check_timing->xres, - check_timing->yres, check_timing->refresh, - check_timing->vmode); +return -EINVAL ; +} + +static int hdmi_v14_check_timing (struct fb_videomode *check_timing) +{ +int i;for (i =0 ; i <ARRAY_SIZE (hdmi_confs); ++i) if (hdmi_confs[i].width == check_timing->xres &&
@@ -485,6 +1221,23 @@ static int hdmi_check_timing(void *ctx, void *timing)return -EINVAL ; } +static int hdmi_check_timing (void *ctx,void *timing) +{ +struct hdmi_context *hdata = (struct hdmi_context *)ctx; +struct fb_videomode *check_timing = timing; + +DRM_DEBUG_KMS ("[%d] %s\n" , __LINE__, __func__); + +DRM_DEBUG_KMS ("[%d]x[%d] [%d]Hz [%x]\n" , check_timing->xres, + check_timing->yres, check_timing->refresh, + check_timing->vmode); + +if (hdata->is_v13) +return hdmi_v13_check_timing (check_timing); +else +return hdmi_v14_check_timing (check_timing); +} +static int hdmi_display_power_on (void *ctx,int mode) {DRM_DEBUG_KMS ("[%d] %s\n" , __LINE__, __func__);
@@ -516,13 +1269,20 @@ static struct exynos_hdmi_display_ops display_ops = {static void hdmi_conf_reset (struct hdmi_context *hdata) { +u32 reg; +/* disable hpd handle for drm */ hdata->hpd_handle = false; +if (hdata->is_v13) + reg =HDMI_V13_CORE_RSTOUT ; +else + reg =HDMI_CORE_RSTOUT ; +/* resetting HDMI core */ -hdmi_reg_writemask (hdata,HDMI_CORE_RSTOUT ,0 ,HDMI_CORE_SW_RSTOUT ); +hdmi_reg_writemask (hdata, reg,0 ,HDMI_CORE_SW_RSTOUT );mdelay (10 ); -hdmi_reg_writemask (hdata,HDMI_CORE_RSTOUT , ~0 ,HDMI_CORE_SW_RSTOUT ); +hdmi_reg_writemask (hdata, reg, ~0 ,HDMI_CORE_SW_RSTOUT );mdelay (10 );/* enable hpd handle for drm */
@@ -546,27 +1306,126 @@ static void hdmi_conf_init(struct hdmi_context *hdata) HDMI_MODE_HDMI_EN, HDMI_MODE_MASK);/* disable bluescreen */ hdmi_reg_writemask (hdata,HDMI_CON_0 ,0 ,HDMI_BLUE_SCR_EN ); -/* choose bluescreen (fecal) color */ -hdmi_reg_writeb (hdata,HDMI_BLUE_SCREEN_0 ,0x12 ); -hdmi_reg_writeb (hdata,HDMI_BLUE_SCREEN_1 ,0x34 ); -hdmi_reg_writeb (hdata,HDMI_BLUE_SCREEN_2 ,0x56 ); -/* enable AVI packet every vsync, fixes purple line problem */ -hdmi_reg_writeb (hdata,HDMI_AVI_CON ,0x02 ); -/* force RGB, look to CEA-861-D, table 7 for more detail */ -hdmi_reg_writeb (hdata,HDMI_AVI_BYTE (0 ),0 <<5 ); -hdmi_reg_writemask (hdata,HDMI_CON_1 ,0x10 <<5 ,0x11 <<5 ); - -hdmi_reg_writeb (hdata,HDMI_SPD_CON ,0x02 ); -hdmi_reg_writeb (hdata,HDMI_AUI_CON ,0x02 ); -hdmi_reg_writeb (hdata,HDMI_ACR_CON ,0x04 ); + +if (hdata->is_v13) { +/* choose bluescreen (fecal) color */ +hdmi_reg_writeb (hdata,HDMI_V13_BLUE_SCREEN_0 ,0x12 ); +hdmi_reg_writeb (hdata,HDMI_V13_BLUE_SCREEN_1 ,0x34 ); +hdmi_reg_writeb (hdata,HDMI_V13_BLUE_SCREEN_2 ,0x56 ); + +/* enable AVI packet every vsync, fixes purple line problem */ +hdmi_reg_writeb (hdata,HDMI_V13_AVI_CON ,0x02 ); +/* force RGB, look to CEA-861-D, table 7 for more detail */ +hdmi_reg_writeb (hdata,HDMI_V13_AVI_BYTE (0 ),0 <<5 ); +hdmi_reg_writemask (hdata,HDMI_CON_1 ,0x10 <<5 ,0x11 <<5 ); + +hdmi_reg_writeb (hdata,HDMI_V13_SPD_CON ,0x02 ); +hdmi_reg_writeb (hdata,HDMI_V13_AUI_CON ,0x02 ); +hdmi_reg_writeb (hdata,HDMI_V13_ACR_CON ,0x04 ); + }else { +/* enable AVI packet every vsync, fixes purple line problem */ +hdmi_reg_writeb (hdata,HDMI_AVI_CON ,0x02 ); +hdmi_reg_writeb (hdata,HDMI_AVI_BYTE (1 ),2 <<5 ); +hdmi_reg_writemask (hdata,HDMI_CON_1 ,2 ,3 <<5 ); + }/* enable hpd handle for drm */ hdata->hpd_handle = true; } -static void hdmi_timing_apply (struct hdmi_context *hdata, -const struct hdmi_preset_conf *conf) +static void hdmi_v13_timing_apply (struct hdmi_context *hdata) { +const struct hdmi_v13_preset_conf *conf = + hdmi_v13_confs[hdata->cur_conf].conf; +const struct hdmi_v13_core_regs *core = &conf->core; +const struct hdmi_v13_tg_regs *tg = &conf->tg; +int tries; + +/* setting core registers */ +hdmi_reg_writeb (hdata,HDMI_H_BLANK_0 , core->h_blank[0 ]); +hdmi_reg_writeb (hdata,HDMI_H_BLANK_1 , core->h_blank[1 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_BLANK_0 , core->v_blank[0 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_BLANK_1 , core->v_blank[1 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_BLANK_2 , core->v_blank[2 ]); +hdmi_reg_writeb (hdata,HDMI_V13_H_V_LINE_0 , core->h_v_line[0 ]); +hdmi_reg_writeb (hdata,HDMI_V13_H_V_LINE_1 , core->h_v_line[1 ]); +hdmi_reg_writeb (hdata,HDMI_V13_H_V_LINE_2 , core->h_v_line[2 ]); +hdmi_reg_writeb (hdata,HDMI_VSYNC_POL , core->vsync_pol[0 ]); +hdmi_reg_writeb (hdata,HDMI_INT_PRO_MODE , core->int_pro_mode[0 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_BLANK_F_0 , core->v_blank_f[0 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_BLANK_F_1 , core->v_blank_f[1 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_BLANK_F_2 , core->v_blank_f[2 ]); +hdmi_reg_writeb (hdata,HDMI_V13_H_SYNC_GEN_0 , core->h_sync_gen[0 ]); +hdmi_reg_writeb (hdata,HDMI_V13_H_SYNC_GEN_1 , core->h_sync_gen[1 ]); +hdmi_reg_writeb (hdata,HDMI_V13_H_SYNC_GEN_2 , core->h_sync_gen[2 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_SYNC_GEN_1_0 , core->v_sync_gen1[0 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_SYNC_GEN_1_1 , core->v_sync_gen1[1 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_SYNC_GEN_1_2 , core->v_sync_gen1[2 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_SYNC_GEN_2_0 , core->v_sync_gen2[0 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_SYNC_GEN_2_1 , core->v_sync_gen2[1 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_SYNC_GEN_2_2 , core->v_sync_gen2[2 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_SYNC_GEN_3_0 , core->v_sync_gen3[0 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_SYNC_GEN_3_1 , core->v_sync_gen3[1 ]); +hdmi_reg_writeb (hdata,HDMI_V13_V_SYNC_GEN_3_2 , core->v_sync_gen3[2 ]); +/* Timing generator registers */ +hdmi_reg_writeb (hdata,HDMI_TG_H_FSZ_L , tg->h_fsz_l); +hdmi_reg_writeb (hdata,HDMI_TG_H_FSZ_H , tg->h_fsz_h); +hdmi_reg_writeb (hdata,HDMI_TG_HACT_ST_L , tg->hact_st_l); +hdmi_reg_writeb (hdata,HDMI_TG_HACT_ST_H , tg->hact_st_h); +hdmi_reg_writeb (hdata,HDMI_TG_HACT_SZ_L , tg->hact_sz_l); +hdmi_reg_writeb (hdata,HDMI_TG_HACT_SZ_H , tg->hact_sz_h); +hdmi_reg_writeb (hdata,HDMI_TG_V_FSZ_L , tg->v_fsz_l); +hdmi_reg_writeb (hdata,HDMI_TG_V_FSZ_H , tg->v_fsz_h); +hdmi_reg_writeb (hdata,HDMI_TG_VSYNC_L , tg->vsync_l); +hdmi_reg_writeb (hdata,HDMI_TG_VSYNC_H , tg->vsync_h); +hdmi_reg_writeb (hdata,HDMI_TG_VSYNC2_L , tg->vsync2_l); +hdmi_reg_writeb (hdata,HDMI_TG_VSYNC2_H , tg->vsync2_h); +hdmi_reg_writeb (hdata,HDMI_TG_VACT_ST_L , tg->vact_st_l); +hdmi_reg_writeb (hdata,HDMI_TG_VACT_ST_H , tg->vact_st_h); +hdmi_reg_writeb (hdata,HDMI_TG_VACT_SZ_L , tg->vact_sz_l); +hdmi_reg_writeb (hdata,HDMI_TG_VACT_SZ_H , tg->vact_sz_h); +hdmi_reg_writeb (hdata,HDMI_TG_FIELD_CHG_L , tg->field_chg_l); +hdmi_reg_writeb (hdata,HDMI_TG_FIELD_CHG_H , tg->field_chg_h); +hdmi_reg_writeb (hdata,HDMI_TG_VACT_ST2_L , tg->vact_st2_l); +hdmi_reg_writeb (hdata,HDMI_TG_VACT_ST2_H , tg->vact_st2_h); +hdmi_reg_writeb (hdata,HDMI_TG_VSYNC_TOP_HDMI_L , tg->vsync_top_hdmi_l); +hdmi_reg_writeb (hdata,HDMI_TG_VSYNC_TOP_HDMI_H , tg->vsync_top_hdmi_h); +hdmi_reg_writeb (hdata,HDMI_TG_VSYNC_BOT_HDMI_L , tg->vsync_bot_hdmi_l); +hdmi_reg_writeb (hdata,HDMI_TG_VSYNC_BOT_HDMI_H , tg->vsync_bot_hdmi_h); +hdmi_reg_writeb (hdata,HDMI_TG_FIELD_TOP_HDMI_L , tg->field_top_hdmi_l); +hdmi_reg_writeb (hdata,HDMI_TG_FIELD_TOP_HDMI_H , tg->field_top_hdmi_h); +hdmi_reg_writeb (hdata,HDMI_TG_FIELD_BOT_HDMI_L , tg->field_bot_hdmi_l); +hdmi_reg_writeb (hdata,HDMI_TG_FIELD_BOT_HDMI_H , tg->field_bot_hdmi_h); + +/* waiting for HDMIPHY's PLL to get to steady state */ +for (tries =100 ; tries; --tries) { +u32 val =hdmi_reg_read (hdata,HDMI_V13_PHY_STATUS ); +if (val &HDMI_PHY_STATUS_READY ) +break ; +mdelay (1 ); + } +/* steady state not achieved */ +if (tries ==0 ) { +DRM_ERROR ("hdmiphy's pll could not reach steady state.\n" ); +hdmi_regs_dump (hdata,"timing apply" ); + } + +clk_disable (hdata->res.sclk_hdmi); +clk_set_parent (hdata->res.sclk_hdmi, hdata->res.sclk_hdmiphy); +clk_enable (hdata->res.sclk_hdmi); + +/* enable HDMI and timing generator */ +hdmi_reg_writemask (hdata,HDMI_CON_0 , ~0 ,HDMI_EN ); +if (core->int_pro_mode[0 ]) +hdmi_reg_writemask (hdata,HDMI_TG_CMD , ~0 ,HDMI_TG_EN | +HDMI_FIELD_EN ); +else +hdmi_reg_writemask (hdata,HDMI_TG_CMD , ~0 ,HDMI_TG_EN ); +} + +static void hdmi_v14_timing_apply (struct hdmi_context *hdata) +{ +const struct hdmi_preset_conf *conf = hdmi_confs[hdata->cur_conf].conf;const struct hdmi_core_regs *core = &conf->core;const struct hdmi_tg_regs *tg = &conf->tg;int tries;
@@ -574,29 +1433,102 @@ static void hdmi_timing_apply(struct hdmi_context *hdata,/* setting core registers */ hdmi_reg_writeb (hdata,HDMI_H_BLANK_0 , core->h_blank[0 ]);hdmi_reg_writeb (hdata,HDMI_H_BLANK_1 , core->h_blank[1 ]); -hdmi_reg_writeb (hdata,HDMI_V_BLANK_0 , core->v_blank[0 ]); -hdmi_reg_writeb (hdata,HDMI_V_BLANK_1 , core->v_blank[1 ]); -hdmi_reg_writeb (hdata,HDMI_V_BLANK_2 , core->v_blank[2 ]); -hdmi_reg_writeb (hdata,HDMI_H_V_LINE_0 , core->h_v_line[0 ]); -hdmi_reg_writeb (hdata,HDMI_H_V_LINE_1 , core->h_v_line[1 ]); -hdmi_reg_writeb (hdata,HDMI_H_V_LINE_2 , core->h_v_line[2 ]); +hdmi_reg_writeb (hdata,HDMI_V2_BLANK_0 , core->v2_blank[0 ]); +hdmi_reg_writeb (hdata,HDMI_V2_BLANK_1 , core->v2_blank[1 ]); +hdmi_reg_writeb (hdata,HDMI_V1_BLANK_0 , core->v1_blank[0 ]); +hdmi_reg_writeb (hdata,HDMI_V1_BLANK_1 , core->v1_blank[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_LINE_0 , core->v_line[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_LINE_1 , core->v_line[1 ]); +hdmi_reg_writeb (hdata,HDMI_H_LINE_0 , core->h_line[0 ]); +hdmi_reg_writeb (hdata,HDMI_H_LINE_1 , core->h_line[1 ]); +hdmi_reg_writeb (hdata,HDMI_HSYNC_POL , core->hsync_pol[0 ]);hdmi_reg_writeb (hdata,HDMI_VSYNC_POL , core->vsync_pol[0 ]);hdmi_reg_writeb (hdata,HDMI_INT_PRO_MODE , core->int_pro_mode[0 ]); -hdmi_reg_writeb (hdata,HDMI_V_BLANK_F_0 , core->v_blank_f[0 ]); -hdmi_reg_writeb (hdata,HDMI_V_BLANK_F_1 , core->v_blank_f[1 ]); -hdmi_reg_writeb (hdata,HDMI_V_BLANK_F_2 , core->v_blank_f[2 ]); -hdmi_reg_writeb (hdata,HDMI_H_SYNC_GEN_0 , core->h_sync_gen[0 ]); -hdmi_reg_writeb (hdata,HDMI_H_SYNC_GEN_1 , core->h_sync_gen[1 ]); -hdmi_reg_writeb (hdata,HDMI_H_SYNC_GEN_2 , core->h_sync_gen[2 ]); -hdmi_reg_writeb (hdata,HDMI_V_SYNC_GEN_1_0 , core->v_sync_gen1[0 ]); -hdmi_reg_writeb (hdata,HDMI_V_SYNC_GEN_1_1 , core->v_sync_gen1[1 ]); -hdmi_reg_writeb (hdata,HDMI_V_SYNC_GEN_1_2 , core->v_sync_gen1[2 ]); -hdmi_reg_writeb (hdata,HDMI_V_SYNC_GEN_2_0 , core->v_sync_gen2[0 ]); -hdmi_reg_writeb (hdata,HDMI_V_SYNC_GEN_2_1 , core->v_sync_gen2[1 ]); -hdmi_reg_writeb (hdata,HDMI_V_SYNC_GEN_2_2 , core->v_sync_gen2[2 ]); -hdmi_reg_writeb (hdata,HDMI_V_SYNC_GEN_3_0 , core->v_sync_gen3[0 ]); -hdmi_reg_writeb (hdata,HDMI_V_SYNC_GEN_3_1 , core->v_sync_gen3[1 ]); -hdmi_reg_writeb (hdata,HDMI_V_SYNC_GEN_3_2 , core->v_sync_gen3[2 ]); +hdmi_reg_writeb (hdata,HDMI_V_BLANK_F0_0 , core->v_blank_f0[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_BLANK_F0_1 , core->v_blank_f0[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_BLANK_F1_0 , core->v_blank_f1[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_BLANK_F1_1 , core->v_blank_f1[1 ]); +hdmi_reg_writeb (hdata,HDMI_H_SYNC_START_0 , core->h_sync_start[0 ]); +hdmi_reg_writeb (hdata,HDMI_H_SYNC_START_1 , core->h_sync_start[1 ]); +hdmi_reg_writeb (hdata,HDMI_H_SYNC_END_0 , core->h_sync_end[0 ]); +hdmi_reg_writeb (hdata,HDMI_H_SYNC_END_1 , core->h_sync_end[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_BEF_2_0 , + core->v_sync_line_bef_2[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_BEF_2_1 , + core->v_sync_line_bef_2[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_BEF_1_0 , + core->v_sync_line_bef_1[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_BEF_1_1 , + core->v_sync_line_bef_1[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_2_0 , + core->v_sync_line_aft_2[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_2_1 , + core->v_sync_line_aft_2[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_1_0 , + core->v_sync_line_aft_1[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_1_1 , + core->v_sync_line_aft_1[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_PXL_2_0 , + core->v_sync_line_aft_pxl_2[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_PXL_2_1 , + core->v_sync_line_aft_pxl_2[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_PXL_1_0 , + core->v_sync_line_aft_pxl_1[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_PXL_1_1 , + core->v_sync_line_aft_pxl_1[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_BLANK_F2_0 , core->v_blank_f2[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_BLANK_F2_1 , core->v_blank_f2[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_BLANK_F3_0 , core->v_blank_f3[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_BLANK_F3_1 , core->v_blank_f3[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_BLANK_F4_0 , core->v_blank_f4[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_BLANK_F4_1 , core->v_blank_f4[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_BLANK_F5_0 , core->v_blank_f5[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_BLANK_F5_1 , core->v_blank_f5[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_3_0 , + core->v_sync_line_aft_3[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_3_1 , + core->v_sync_line_aft_3[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_4_0 , + core->v_sync_line_aft_4[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_4_1 , + core->v_sync_line_aft_4[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_5_0 , + core->v_sync_line_aft_5[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_5_1 , + core->v_sync_line_aft_5[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_6_0 , + core->v_sync_line_aft_6[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_6_1 , + core->v_sync_line_aft_6[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_PXL_3_0 , + core->v_sync_line_aft_pxl_3[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_PXL_3_1 , + core->v_sync_line_aft_pxl_3[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_PXL_4_0 , + core->v_sync_line_aft_pxl_4[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_PXL_4_1 , + core->v_sync_line_aft_pxl_4[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_PXL_5_0 , + core->v_sync_line_aft_pxl_5[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_PXL_5_1 , + core->v_sync_line_aft_pxl_5[1 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_PXL_6_0 , + core->v_sync_line_aft_pxl_6[0 ]); +hdmi_reg_writeb (hdata,HDMI_V_SYNC_LINE_AFT_PXL_6_1 , + core->v_sync_line_aft_pxl_6[1 ]); +hdmi_reg_writeb (hdata,HDMI_VACT_SPACE_1_0 , core->vact_space_1[0 ]); +hdmi_reg_writeb (hdata,HDMI_VACT_SPACE_1_1 , core->vact_space_1[1 ]); +hdmi_reg_writeb (hdata,HDMI_VACT_SPACE_2_0 , core->vact_space_2[0 ]); +hdmi_reg_writeb (hdata,HDMI_VACT_SPACE_2_1 , core->vact_space_2[1 ]); +hdmi_reg_writeb (hdata,HDMI_VACT_SPACE_3_0 , core->vact_space_3[0 ]); +hdmi_reg_writeb (hdata,HDMI_VACT_SPACE_3_1 , core->vact_space_3[1 ]); +hdmi_reg_writeb (hdata,HDMI_VACT_SPACE_4_0 , core->vact_space_4[0 ]); +hdmi_reg_writeb (hdata,HDMI_VACT_SPACE_4_1 , core->vact_space_4[1 ]); +hdmi_reg_writeb (hdata,HDMI_VACT_SPACE_5_0 , core->vact_space_5[0 ]); +hdmi_reg_writeb (hdata,HDMI_VACT_SPACE_5_1 , core->vact_space_5[1 ]); +hdmi_reg_writeb (hdata,HDMI_VACT_SPACE_6_0 , core->vact_space_6[0 ]); +hdmi_reg_writeb (hdata,HDMI_VACT_SPACE_6_1 , core->vact_space_6[1 ]); +/* Timing generator registers */ hdmi_reg_writeb (hdata,HDMI_TG_H_FSZ_L , tg->h_fsz_l);hdmi_reg_writeb (hdata,HDMI_TG_H_FSZ_H , tg->h_fsz_h);
@@ -618,6 +1550,10 @@ static void hdmi_timing_apply(struct hdmi_context *hdata,hdmi_reg_writeb (hdata,HDMI_TG_FIELD_CHG_H , tg->field_chg_h);hdmi_reg_writeb (hdata,HDMI_TG_VACT_ST2_L , tg->vact_st2_l);hdmi_reg_writeb (hdata,HDMI_TG_VACT_ST2_H , tg->vact_st2_h); +hdmi_reg_writeb (hdata,HDMI_TG_VACT_ST3_L , tg->vact_st3_l); +hdmi_reg_writeb (hdata,HDMI_TG_VACT_ST3_H , tg->vact_st3_h); +hdmi_reg_writeb (hdata,HDMI_TG_VACT_ST4_L , tg->vact_st4_l); +hdmi_reg_writeb (hdata,HDMI_TG_VACT_ST4_H , tg->vact_st4_h);hdmi_reg_writeb (hdata,HDMI_TG_VSYNC_TOP_HDMI_L , tg->vsync_top_hdmi_l);hdmi_reg_writeb (hdata,HDMI_TG_VSYNC_TOP_HDMI_H , tg->vsync_top_hdmi_h);hdmi_reg_writeb (hdata,HDMI_TG_VSYNC_BOT_HDMI_L , tg->vsync_bot_hdmi_l);
@@ -626,10 +1562,11 @@ static void hdmi_timing_apply(struct hdmi_context *hdata,hdmi_reg_writeb (hdata,HDMI_TG_FIELD_TOP_HDMI_H , tg->field_top_hdmi_h);hdmi_reg_writeb (hdata,HDMI_TG_FIELD_BOT_HDMI_L , tg->field_bot_hdmi_l);hdmi_reg_writeb (hdata,HDMI_TG_FIELD_BOT_HDMI_H , tg->field_bot_hdmi_h); +hdmi_reg_writeb (hdata,HDMI_TG_3D , tg->tg_3d);/* waiting for HDMIPHY's PLL to get to steady state */ for (tries =100 ; tries; --tries) { -u32 val =hdmi_reg_read (hdata,HDMI_PHY_STATUS ); +u32 val =hdmi_reg_read (hdata,HDMI_PHY_STATUS_0 );if (val &HDMI_PHY_STATUS_READY )break ;mdelay (1 );
@@ -653,9 +1590,18 @@ static void hdmi_timing_apply(struct hdmi_context *hdata,hdmi_reg_writemask (hdata,HDMI_TG_CMD , ~0 ,HDMI_TG_EN ); } +static void hdmi_timing_apply (struct hdmi_context *hdata) +{ +if (hdata->is_v13) +hdmi_v13_timing_apply (hdata); +else +hdmi_v14_timing_apply (hdata); +} +static void hdmiphy_conf_reset (struct hdmi_context *hdata) {u8 buffer[2 ]; +u32 reg;clk_disable (hdata->res.sclk_hdmi);clk_set_parent (hdata->res.sclk_hdmi, hdata->res.sclk_pixel);
@@ -668,15 +1614,21 @@ static void hdmiphy_conf_reset(struct hdmi_context *hdata)if (hdata->hdmiphy_port)i2c_master_send (hdata->hdmiphy_port, buffer,2 ); +if (hdata->is_v13) + reg =HDMI_V13_PHY_RSTOUT ; +else + reg =HDMI_PHY_RSTOUT ; +/* reset hdmiphy */ -hdmi_reg_writemask (hdata,HDMI_PHY_RSTOUT , ~0 ,HDMI_PHY_SW_RSTOUT ); +hdmi_reg_writemask (hdata, reg, ~0 ,HDMI_PHY_SW_RSTOUT );mdelay (10 ); -hdmi_reg_writemask (hdata,HDMI_PHY_RSTOUT ,0 ,HDMI_PHY_SW_RSTOUT ); +hdmi_reg_writemask (hdata, reg,0 ,HDMI_PHY_SW_RSTOUT );mdelay (10 ); }static void hdmiphy_conf_apply (struct hdmi_context *hdata) { +const u8 *hdmiphy_data;u8 buffer[32 ];u8 operation[2 ];u8 read_buffer[32 ] = {0 , };
@@ -689,7 +1641,12 @@ static void hdmiphy_conf_apply(struct hdmi_context *hdata) }/* pixel clock */ -memcpy (buffer, hdmi_confs[hdata->cur_conf].hdmiphy_data,32 ); +if (hdata->is_v13) + hdmiphy_data = hdmi_v13_confs[hdata->cur_conf].hdmiphy_data; +else + hdmiphy_data = hdmi_confs[hdata->cur_conf].hdmiphy_data; + +memcpy (buffer, hdmiphy_data,32 ); ret =i2c_master_send (hdata->hdmiphy_port, buffer,32 );if (ret !=32 ) {DRM_ERROR ("failed to configure HDMIPHY via I2C\n" );
@@ -721,9 +1678,6 @@ static void hdmiphy_conf_apply(struct hdmi_context *hdata)static void hdmi_conf_apply (struct hdmi_context *hdata) { -const struct hdmi_preset_conf *conf = - hdmi_confs[hdata->cur_conf].conf; -DRM_DEBUG_KMS ("[%d] %s\n" , __LINE__, __func__);hdmiphy_conf_reset (hdata);
@@ -733,7 +1687,7 @@ static void hdmi_conf_apply(struct hdmi_context *hdata)hdmi_conf_init (hdata);/* setting core registers */ -hdmi_timing_apply (hdata, conf); +hdmi_timing_apply (hdata);hdmi_regs_dump (hdata,"start" ); }
@@ -745,8 +1699,8 @@ static void hdmi_mode_set(void *ctx, void *mode)DRM_DEBUG_KMS ("[%d] %s\n" , __LINE__, __func__); - conf_idx =hdmi_conf_index (mode); -if (conf_idx >=0 && conf_idx <ARRAY_SIZE (hdmi_confs)) + conf_idx =hdmi_conf_index (hdata, mode); +if (conf_idx >=0 ) hdata->cur_conf = conf_idx;else DRM_DEBUG_KMS ("not supported mode\n" );
@@ -926,7 +1880,6 @@ static void hdmi_resource_poweron(struct hdmi_context *hdata)hdmiphy_conf_reset (hdata);hdmi_conf_reset (hdata);hdmi_conf_init (hdata); - }static void hdmi_resource_poweroff (struct hdmi_context *hdata)
@@ -1022,6 +1975,7 @@ static int __devinit hdmi_probe(struct platform_device *pdev)platform_set_drvdata (pdev, drm_hdmi_ctx); + hdata->is_v13 = pdata->is_v13; hdata->default_win = pdata->default_win; hdata->default_timing = &pdata->timing; hdata->default_bpp = pdata->bpp;
drivers/gpu/drm/exynos/exynos_hdmi.h +1 -9
@@ -28,15 +28,6 @@ #ifndef _EXYNOS_HDMI_H_ #define _EXYNOS_HDMI_H_ -struct hdmi_conf { - int width; - int height; - int vrefresh; - bool interlace; - const u8 *hdmiphy_data; - const struct hdmi_preset_conf *conf; -}; - struct hdmi_resources { struct clk *hdmi; struct clk *sclk_hdmi;
@@ -51,6 +42,7 @@ struct hdmi_context {struct device *dev;struct drm_device *drm_dev;struct fb_videomode *default_timing; + unsigned int is_v13:1;unsigned int default_win;unsigned int default_bpp;bool hpd_handle;
drivers/gpu/drm/exynos/regs-hdmi.h +269 -37
335 lines not on this page · raw message
include/drm/exynos_drm.h +2 -0
@@ -147,11 +147,13 @@ struct exynos_drm_common_hdmi_pd {* @timing: default video mode for initializing * @default_win: default window layer number to be used for UI. * @bpp: default bit per pixel. +* @is_v13: set if hdmi version 13 is. */ struct exynos_drm_hdmi_pdata {struct fb_videomode timing;unsigned int default_win;unsigned int bpp; +unsigned int is_v13:1 ; };#endif /* __KERNEL__ */
Signature · 1 line
1.7.4.1
Inki Dae
maintainerPATCH RESEND 9/10 drm/exynos: add G2D driver
From: Joonyoung Shim <[email protected]>
G2D is a 2D graphic accelerator that supports Bit Block Transfer. This G2D driver is exynos drm specific.
This adds below three exynos specific ioctl and one event for G2D.
- DRM_EXYNOS_G2D_GET_VER
- DRM_EXYNOS_G2D_SET_CMDLIST
- DRM_EXYNOS_G2D_EXEC
- DRM_EXYNOS_G2D_EVENT
--- drivers/gpu/drm/exynos/Kconfig | 6 + drivers/gpu/drm/exynos/Makefile | 1 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 31 ++ drivers/gpu/drm/exynos/exynos_drm_drv.h | 13 + drivers/gpu/drm/exynos/exynos_drm_g2d.c | 885 +++++++++++++++++++++++++++++++ drivers/gpu/drm/exynos/exynos_drm_g2d.h | 36 ++ include/drm/exynos_drm.h | 56 ++ 7 files changed, 1028 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_g2d.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_g2d.h
drivers/gpu/drm/exynos/Kconfig +6 -0
@@ -21,3 +21,9 @@ config DRM_EXYNOS_HDMI depends on DRM_EXYNOS && !VIDEO_SAMSUNG_S5P_TV help Choose this option if you want to use Exynos HDMI for DRM. + +config DRM_EXYNOS_G2D + bool "Exynos DRM G2D" + depends on DRM_EXYNOS + help + Choose this option if you want to use Exynos G2D for DRM.
drivers/gpu/drm/exynos/Makefile +1 -0
@@ -12,5 +12,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD) += exynos_drm_fimd.o exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI) += exynos_hdmi.o exynos_mixer.o \ exynos_ddc.o exynos_hdmiphy.o \ exynos_drm_hdmi.o +exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o
drivers/gpu/drm/exynos/exynos_drm_drv.c +31 -0
@@ -37,6 +37,7 @@#include "exynos_drm_fbdev.h" #include "exynos_drm_fb.h" #include "exynos_drm_gem.h" +#include "exynos_drm_g2d.h" #include "exynos_drm_plane.h" #define DRIVER_NAME "exynos"
@@ -146,8 +147,16 @@ static int exynos_drm_unload(struct drm_device *dev)static int exynos_drm_open (struct drm_device *dev,struct drm_file *file) { +struct drm_exynos_file_private *file_priv; +DRM_DEBUG_DRIVER ("%s\n" , __FILE__); + file_priv =kzalloc (sizeof (*file_priv),GFP_KERNEL ); +if (!file_priv) +return -ENOMEM ; + + file->driver_priv = file_priv; +return exynos_drm_subdrv_open (dev, file); }
@@ -208,6 +217,13 @@ static struct drm_ioctl_desc exynos_ioctls[] = { exynos_drm_gem_mmap_ioctl, DRM_UNLOCKED | DRM_AUTH),DRM_IOCTL_DEF_DRV (EXYNOS_PLANE_SET_ZPOS , exynos_plane_set_zpos_ioctl,DRM_UNLOCKED |DRM_AUTH ), + +DRM_IOCTL_DEF_DRV (EXYNOS_G2D_GET_VER , + exynos_g2d_get_ver_ioctl,DRM_UNLOCKED |DRM_AUTH ), +DRM_IOCTL_DEF_DRV (EXYNOS_G2D_SET_CMDLIST , + exynos_g2d_set_cmdlist_ioctl,DRM_UNLOCKED |DRM_AUTH ), +DRM_IOCTL_DEF_DRV (EXYNOS_G2D_EXEC , + exynos_g2d_exec_ioctl, DRM_UNLOCKED | DRM_AUTH), }; static const struct file_operations exynos_drm_driver_fops = {
@@ -298,6 +314,12 @@ static int __init exynos_drm_init(void) goto out_common_hdmi;#endif +#ifdef CONFIG_DRM_EXYNOS_G2D + ret =platform_driver_register (&g2d_driver); +if (ret <0 ) + goto out_g2d; +#endif + ret =platform_driver_register (&exynos_drm_platform_driver);if (ret <0 ) goto out;
@@ -305,6 +327,11 @@ static int __init exynos_drm_init(void)return 0 ; out: +#ifdef CONFIG_DRM_EXYNOS_G2D +platform_driver_unregister (&g2d_driver); +out_g2d: +#endif +#ifdef CONFIG_DRM_EXYNOS_HDMI platform_driver_unregister (&exynos_drm_common_hdmi_driver); out_common_hdmi:
@@ -327,6 +354,10 @@ static void __exit exynos_drm_exit(void)platform_driver_unregister (&exynos_drm_platform_driver); +#ifdef CONFIG_DRM_EXYNOS_G2D +platform_driver_unregister (&g2d_driver); +#endif +#ifdef CONFIG_DRM_EXYNOS_HDMI platform_driver_unregister (&exynos_drm_common_hdmi_driver);platform_driver_unregister (&mixer_driver);
drivers/gpu/drm/exynos/exynos_drm_drv.h +13 -0
@@ -203,6 +203,18 @@ struct exynos_drm_manager {struct exynos_drm_display_ops *display_ops; }; +struct exynos_drm_g2d_private { +struct device *dev; +struct list_head inuse_cmdlist; +struct list_head event_list; +struct list_head gem_list; +unsigned int gem_nr; +}; + +struct drm_exynos_file_private { +struct exynos_drm_g2d_private *g2d_priv; +}; +/* * Exynos drm private structure. */
@@ -284,4 +296,5 @@ extern struct platform_driver fimd_driver;extern struct platform_driver hdmi_driver;extern struct platform_driver mixer_driver;extern struct platform_driver exynos_drm_common_hdmi_driver; +extern struct platform_driver g2d_driver;#endif
drivers/gpu/drm/exynos/exynos_drm_g2d.c new file +885 -0
885 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_drm_g2d.h new file +36 -0
@@ -0,0 +1,36 @@ +/* +* Copyright (C) 2012 Samsung Electronics Co.Ltd +* Authors: Joonyoung Shim <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundationr +*/ + +#ifdef CONFIG_DRM_EXYNOS_G2D +extern int exynos_g2d_get_ver_ioctl (struct drm_device *dev,void *data, +struct drm_file *file_priv); +extern int exynos_g2d_set_cmdlist_ioctl (struct drm_device *dev,void *data, +struct drm_file *file_priv); +extern int exynos_g2d_exec_ioctl (struct drm_device *dev,void *data, +struct drm_file *file_priv); +#else +static inline int exynos_g2d_get_ver_ioctl (struct drm_device *dev,void *data, +struct drm_file *file_priv) +{ +return -ENODEV ; +} + +static inline int exynos_g2d_set_cmdlist_ioctl (struct drm_device *dev, +void *data, +struct drm_file *file_priv) +{ +return -ENODEV ; +} + +static inline int exynos_g2d_exec_ioctl (struct drm_device *dev,void *data, +struct drm_file *file_priv) +{ +return -ENODEV ; +} +#endif
include/drm/exynos_drm.h +56 -0
80 lines not on this page · raw message
Signature · 1 line
1.7.4.1
Dave Airlie
maintainerRe: [RESEND][PATCH 01/10] drm/exynos: add HDMI version 1.4 support
In reply to Inki DaeQuoted 5 lines
index 1ed3aae..aff2313 100644
include/drm/exynos_drm.h +0
-0@@ -147,11 +147,13 @@ struct exynos_drm_common_hdmi_pd { * @timing: default video mode for initializing
include/drm/exynos_drm.h struct exynos_drm_common_hdmi_pd { · line 157
Quoted 10 lines
include/drm/exynos_drm.h +2
-0* @default_win: default window layer number to be used for UI. * @bpp: default bit per pixel. +* @is_v13: set if hdmi version 13 is. */ struct exynos_drm_hdmi_pdata { struct fb_videomode timing; unsigned int default_win; unsigned int bpp; + unsigned int is_v13:1; };
Is this an ABI change, where do you document to userspace that it can use this field, have you bumped some userspace accessible version?
Dave.
Re: [RESEND][PATCH 01/10] drm/exynos: add HDMI version 1.4 support
Quoted 9 lines · Dave Airlie
Quoted 9 lines
index 1ed3aae..aff2313 100644
include/drm/exynos_drm.h +1
-0@@ -147,11 +147,13 @@ struct exynos_drm_common_hdmi_pd {* @timing: default video mode for initializing * @default_win: default window layer number to be used for UI. * @bpp: default bit per pixel. +* @is_v13: set if hdmi version 13 is. */
Quoted 9 lines
include/drm/exynos_drm.h struct exynos_drm_common_hdmi_pd { · line 157
Quoted 6 lines
include/drm/exynos_drm.h +1
-0struct exynos_drm_hdmi_pdata {struct fb_videomode timing;unsigned int default_win;unsigned int bpp; +unsigned int is_v13:1 ; };Is this an ABI change, where do you document to userspace that it can use this field, have you bumped some userspace accessible version?
No, this doesn't related with user space currently.
Inki Dae
maintainerPATCH 2/10 drm/exynos: added mode_fixup feature and code clean.
In reply to Inki Daethis patch adds mode_fixup feature for hdmi module that specific driver changes current mode to driver desired mode properly.
--- drivers/gpu/drm/exynos/exynos_drm_connector.c | 25 +++++++- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 6 ++- drivers/gpu/drm/exynos/exynos_drm_drv.h | 8 +++ drivers/gpu/drm/exynos/exynos_drm_encoder.c | 17 ++++- drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 28 +++++++++ drivers/gpu/drm/exynos/exynos_drm_hdmi.h | 5 ++ drivers/gpu/drm/exynos/exynos_hdmi.c | 81 ++++++++++++++++++++++-- 7 files changed, 157 insertions(+), 13 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_connector.c +24 -1
@@ -225,6 +225,29 @@ static struct drm_connector_helper_funcs exynos_connector_helper_funcs = { .best_encoder = exynos_drm_best_encoder, }; +static int exynos_drm_connector_fill_modes (struct drm_connector *connector, +unsigned int max_width,unsigned int max_height) +{ +struct exynos_drm_connector *exynos_connector = +to_exynos_connector (connector); +struct exynos_drm_manager *manager = exynos_connector->manager; +struct exynos_drm_manager_ops *ops = manager->ops; +unsigned int width, height; + + width = max_width; + height = max_height; + +/* +* if specific driver want to find desired_mode using maxmum +* resolution then get max width and height from that driver. +*/ +if (ops && ops->get_max_resol) + ops->get_max_resol (manager->dev, &width, &height); + +return drm_helper_probe_single_connector_modes (connector, width, + height); +} +/* get detection status of display device. */ static enum drm_connector_status exynos_drm_connector_detect (struct drm_connector *connector,bool force)
@@ -262,7 +285,7 @@ static void exynos_drm_connector_destroy(struct drm_connector *connector)static struct drm_connector_funcs exynos_connector_funcs = { .dpms = drm_helper_connector_dpms, - .fill_modes = drm_helper_probe_single_connector_modes, + .fill_modes = exynos_drm_connector_fill_modes, .detect = exynos_drm_connector_detect, .destroy = exynos_drm_connector_destroy, };
drivers/gpu/drm/exynos/exynos_drm_crtc.c +5 -1
@@ -249,7 +249,11 @@ exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode, {DRM_DEBUG_KMS ("%s\n" , __FILE__); - mode = adjusted_mode; +/* +* copy the mode data adjusted by mode_fixup() into crtc->mode +* so that hardware can be seet to proper mode. +*/ +memcpy (&crtc->mode, adjusted_mode,sizeof (*adjusted_mode));return exynos_drm_crtc_update (crtc); }
drivers/gpu/drm/exynos/exynos_drm_drv.h +8 -0
@@ -155,8 +155,10 @@ struct exynos_drm_display_ops {* * @dpms: control device power. * @apply: set timing, vblank and overlay data to registers. +* @mode_fixup: fix mode data comparing to hw specific display mode. * @mode_set: convert drm_display_mode to hw specific display mode and * would be called by encoder->mode_set(). +* @get_max_resol: get maximum resolution to specific hardware. * @commit: set current hw specific display mode to hw. * @enable_vblank: specific driver callback for enabling vblank interrupt. * @disable_vblank: specific driver callback for disabling vblank interrupt.
@@ -164,7 +166,13 @@ struct exynos_drm_display_ops {struct exynos_drm_manager_ops {void (*dpms)(struct device *subdrv_dev,int mode);void (*apply)(struct device *subdrv_dev); +void (*mode_fixup)(struct device *subdrv_dev, +struct drm_connector *connector, +struct drm_display_mode *mode, +struct drm_display_mode *adjusted_mode);void (*mode_set)(struct device *subdrv_dev,void *mode); +void (*get_max_resol)(struct device *subdrv_dev,unsigned int *width, +unsigned int *height);void (*commit)(struct device *subdrv_dev);int (*enable_vblank)(struct device *subdrv_dev);void (*disable_vblank)(struct device *subdrv_dev);
drivers/gpu/drm/exynos/exynos_drm_encoder.c +13 -4
@@ -111,9 +111,19 @@ exynos_drm_encoder_mode_fixup(struct drm_encoder *encoder,struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { + struct drm_device *dev = encoder->dev; +struct drm_connector *connector; +struct exynos_drm_manager *manager =exynos_drm_get_manager (encoder); +struct exynos_drm_manager_ops *manager_ops = manager->ops; +DRM_DEBUG_KMS ("%s\n" , __FILE__); -/* drm framework doesn't check NULL. */ +list_for_each_entry (connector, &dev->mode_config.connector_list, head) { +if (connector->encoder == encoder) +if (manager_ops && manager_ops->mode_fixup) + manager_ops->mode_fixup (manager->dev, connector, + mode, adjusted_mode); + }return true; }
@@ -132,12 +142,11 @@ static void exynos_drm_encoder_mode_set(struct drm_encoder *encoder,DRM_DEBUG_KMS ("%s\n" , __FILE__); - mode = adjusted_mode; -list_for_each_entry (connector, &dev->mode_config.connector_list, head) {if (connector->encoder == encoder) {if (manager_ops && manager_ops->mode_set) - manager_ops->mode_set (manager->dev, mode); + manager_ops->mode_set (manager->dev, + adjusted_mode);if (overlay_ops && overlay_ops->mode_set) overlay_ops->mode_set (manager->dev, overlay);
drivers/gpu/drm/exynos/exynos_drm_hdmi.c +28 -0
@@ -155,6 +155,20 @@ static void drm_hdmi_disable_vblank(struct device *subdrv_dev)return hdmi_overlay_ops->disable_vblank (ctx->mixer_ctx->ctx); } +static void drm_hdmi_mode_fixup (struct device *subdrv_dev, +struct drm_connector *connector, +struct drm_display_mode *mode, +struct drm_display_mode *adjusted_mode) +{ +struct drm_hdmi_context *ctx =to_context (subdrv_dev); + +DRM_DEBUG_KMS ("%s\n" , __FILE__); + +if (hdmi_manager_ops && hdmi_manager_ops->mode_fixup) + hdmi_manager_ops->mode_fixup (ctx->hdmi_ctx->ctx, connector, + mode, adjusted_mode); +} +static void drm_hdmi_mode_set (struct device *subdrv_dev,void *mode) {struct drm_hdmi_context *ctx =to_context (subdrv_dev);
@@ -165,6 +179,18 @@ static void drm_hdmi_mode_set(struct device *subdrv_dev, void *mode) hdmi_manager_ops->mode_set (ctx->hdmi_ctx->ctx, mode); } +static void drm_hdmi_get_max_resol (struct device *subdrv_dev, +unsigned int *width,unsigned int *height) +{ +struct drm_hdmi_context *ctx =to_context (subdrv_dev); + +DRM_DEBUG_KMS ("%s\n" , __FILE__); + +if (hdmi_manager_ops && hdmi_manager_ops->get_max_resol) + hdmi_manager_ops->get_max_resol (ctx->hdmi_ctx->ctx, width, + height); +} +static void drm_hdmi_commit (struct device *subdrv_dev) {struct drm_hdmi_context *ctx =to_context (subdrv_dev);
@@ -200,7 +226,9 @@ static struct exynos_drm_manager_ops drm_hdmi_manager_ops = { .dpms = drm_hdmi_dpms, .enable_vblank = drm_hdmi_enable_vblank, .disable_vblank = drm_hdmi_disable_vblank, + .mode_fixup = drm_hdmi_mode_fixup, .mode_set = drm_hdmi_mode_set, + .get_max_resol = drm_hdmi_get_max_resol, .commit = drm_hdmi_commit, };
drivers/gpu/drm/exynos/exynos_drm_hdmi.h +5 -0
@@ -47,7 +47,12 @@ struct exynos_hdmi_display_ops { };struct exynos_hdmi_manager_ops { +void (*mode_fixup)(void *ctx,struct drm_connector *connector, +struct drm_display_mode *mode, +struct drm_display_mode *adjusted_mode);void (*mode_set)(void *ctx,void *mode); +void (*get_max_resol)(void *ctx,unsigned int *width, +unsigned int *height);void (*commit)(void *ctx);void (*disable)(void *ctx); };
drivers/gpu/drm/exynos/exynos_hdmi.c +74 -7
148 lines not on this page · raw message
Signature · 1 line
1.7.4.1
Dave Airlie
maintainerRe: [PATCH 02/10] drm/exynos: added mode_fixup feature and code clean.
Quoted 6 lines
};
drivers/gpu/drm/exynos/exynos_drm_crtc.c +0
-0
drivers/gpu/drm/exynos/exynos_drm_crtc.c exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode, · line 256
Quoted 9 lines
drivers/gpu/drm/exynos/exynos_drm_crtc.c +5
-1@@ -249,7 +249,11 @@ exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode, { DRM_DEBUG_KMS("%s\n", __FILE__); - mode = adjusted_mode; + /* + * copy the mode data adjusted by mode_fixup() into crtc->mode + * so that hardware can be seet to proper mode. + */ + memcpy(&crtc->mode, adjusted_mode, sizeof(*adjusted_mode));
This just seems wrong on lots of levels, if you get an error how are you going to fallback?
You should be passing the modes into the crtc_update function and doing things like other drivers here.
Dave.
Inki Dae
maintainerRE: [PATCH 02/10] drm/exynos: added mode_fixup feature and code clean.
Quoted 27 lines
-----Original Message-----
From: Dave Airlie [mailto:[email protected]]
Sent: Thursday, March 15, 2012 7:40 PM
To: Inki Dae
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 02/10] drm/exynos: addedmode_fixupfeature and code clean.Review
Quoted 2 lines
};
(quoted diff) +0
-0
b/drivers/gpu/drm/exynos/exynos_drm_crtc.cdrivers/gpu/drm/exynos/exynos_drm_crtc.c exynos_drm_crtc_mode_set(struct drm_crtc *crtc,
Quoted 4 lines
index de81883..2d9a0e6 100644
drivers/gpu/drm/exynos/exynos_drm_crtc.c +0
-0@@ -249,7 +249,11 @@ exynos_drm_crtc_mode_set(struct drm_crtc *crtc,struct
drm_display_mode*mode,drivers/gpu/drm/exynos/exynos_drm_crtc.c exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode, · line 256
Quoted 9 lines
drivers/gpu/drm/exynos/exynos_drm_crtc.c +5
-1{ DRM_DEBUG_KMS("%s\n", __FILE__); - mode = adjusted_mode; + /* + * copy the mode data adjusted by mode_fixup() into crtc->mode + * so that hardware can be seet to proper mode. + */ + memcpy(&crtc->mode, adjusted_mode, sizeof(*adjusted_mode));
Quoted 7 lines
This just seems wrong on lots of levels, if you get an error how are you going to fallback?
You should be passing the modes into the
crtc_updatefunction and doing things like other drivers here.Dave.
Got it. I will check return value from crtc_update and if it gets an error then I will handle it properly.
Thanks,
Inki Dae
Re: [PATCH 02/10] drm/exynos: added mode_fixup feature and code clean.
Hi Dave.
2012년 3월 15일 오후 8:21, Inki Dae <[email protected]>님의 말:
Quoted 27 lines
Quoted 27 lines
-----Original Message-----
From: Dave Airlie [mailto:[email protected]]
Sent: Thursday, March 15, 2012 7:40 PM
To: Inki Dae
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 02/10] drm/exynos: addedmode_fixupfeature and code clean.Review
Quoted 2 lines
};
(quoted diff) +0
-0
b/drivers/gpu/drm/exynos/exynos_drm_crtc.cdrivers/gpu/drm/exynos/exynos_drm_crtc.c exynos_drm_crtc_mode_set(struct drm_crtc *crtc,
Quoted 4 lines
index de81883..2d9a0e6 100644
drivers/gpu/drm/exynos/exynos_drm_crtc.c +0
-0@@ -249,7 +249,11 @@ exynos_drm_crtc_mode_set(struct drm_crtc *crtc,struct
drm_display_mode*mode,Quoted 9 lines
drivers/gpu/drm/exynos/exynos_drm_crtc.c +5
-1{DRM_DEBUG_KMS ("%s\n" , __FILE__); - mode = adjusted_mode; +/* +* copy the mode data adjusted by mode_fixup() into crtc->mode +* so that hardware can be seet to proper mode. +*/ +memcpy (&crtc->mode, adjusted_mode,sizeof (*adjusted_mode));
Quoted 8 lines
Quoted 7 lines
This just seems wrong on lots of levels, if you get an error how are you going to fallback?
You should be passing the modes into the
crtc_updatefunction and doing things like other drivers here.Dave.
I have looked into the part you pointed out but I think it's ok. exynos_drm_crtc_update just sets mode values to overlay structure and overlay structure is common data structure that all hardware can use and exynos crtc has no hardware defendency so we could use it commoly for all hardware such as FIMD, HDMI and Virtual Display. so with exynos_drm_crtc_update call, any hardward isn't updated. if exynos_drm_crtc_update is fail then adjusted_mode would be released and back to saved_mode. only if crtc_func->mode_set is true then hardware would be updated. please let me know if there is my missing point.
Thanks,
Inki Dae
Quoted 10 lines
Got it. I will check return value from
crtc_updateand if it gets an error then I will handle it properly.Thanks,
Inki Dae_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Inki Dae
maintainerPATCH 3/10 drm/exynos: added buffer allocation type.
In reply to Inki Daewith this patch, we can allocate physically continuous or non-continuous memory and also it creates scatterlist for iommu support so allocated memory region can be mapped to iommu page table using scatterlist.
--- drivers/gpu/drm/exynos/exynos_drm_buf.c | 148 +++++++++++++-- drivers/gpu/drm/exynos/exynos_drm_buf.h | 4 +- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 4 +- drivers/gpu/drm/exynos/exynos_drm_gem.c | 284 ++++++++++++++++++++++++++--- drivers/gpu/drm/exynos/exynos_drm_gem.h | 11 +- include/drm/exynos_drm.h | 6 + 6 files changed, 407 insertions(+), 50 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_buf.c +127 -21
@@ -25,45 +25,151 @@#include "drmP.h" #include "drm.h" +#include "exynos_drm.h" #include "exynos_drm_drv.h" #include "exynos_drm_gem.h" #include "exynos_drm_buf.h" static int lowlevel_buffer_allocate (struct drm_device *dev, -struct exynos_drm_gem_buf *buffer) +unsigned int flags,struct exynos_drm_gem_buf *buf) { +int ret =0 ; +DRM_DEBUG_KMS ("%s\n" , __FILE__); - buffer->kvaddr =dma_alloc_writecombine (dev->dev, buffer->size, - &buffer->dma_addr,GFP_KERNEL ); -if (!buffer->kvaddr) { -DRM_ERROR ("failed to allocate buffer.\n" ); -return -ENOMEM ; +/* +* allocate only physically continuous memory and +* non-continuous memory would be allocated by exynos +* gem framework. +*/ +if (!(flags &EXYNOS_BO_NONCONTIG )) { +dma_addr_t start_addr, end_addr; +unsigned int npages, page_size, i =0 ; +struct scatterlist *sgl; + +if (buf->dma_addr) { +DRM_DEBUG_KMS ("already allocated.\n" ); +return -EINVAL ; + } + +/* +* according to desired size, it sets page size +* for performance with using iommu so physically +* continuous memory could be mapped to iommu in +* multiple page size. +*/ +if (buf->size >=SZ_1M ) { + npages = (buf->size >>SECTION_SHIFT ) +1 ; + page_size =SECTION_SIZE ; + }else if (buf->size >=SZ_64K ) { + npages = (buf->size >>16 ) +1 ; + page_size =SZ_64K ; + }else { + npages = (buf->size >>PAGE_SHIFT ) +1 ; + page_size =PAGE_SIZE ; + } + + buf->sgt =kzalloc (sizeof (struct sg_table ),GFP_KERNEL ); +if (!buf->sgt) { +DRM_ERROR ("failed to allocate sg table.\n" ); +return -ENOMEM ; + } + + ret =sg_alloc_table (buf->sgt, npages,GFP_KERNEL ); +if (ret <0 ) { +DRM_ERROR ("failed to initialize sg table.\n" ); +kfree (buf->sgt); + buf->sgt =NULL ; +return -ENOMEM ; + } + + buf->kvaddr =dma_alloc_writecombine (dev->dev, buf->size, + &buf->dma_addr,GFP_KERNEL ); +if (!buf->kvaddr) { +DRM_ERROR ("failed to allocate buffer.\n" ); + ret = -ENOMEM ; + goto err1; + } + + start_addr = buf->dma_addr; + end_addr = buf->dma_addr + buf->size; + + buf->pages =kzalloc (sizeof (struct page ) * npages,GFP_KERNEL ); +if (!buf->pages) { +DRM_ERROR ("failed to allocate pages.\n" ); + ret = -ENOMEM ; + goto err2; + } + + sgl = buf->sgt->sgl; + +while (i < npages) { + buf->pages[i] =phys_to_page (start_addr); +sg_set_page (sgl, buf->pages[i], page_size,0 ); +sg_dma_address (sgl) = start_addr; + start_addr += page_size; +if (end_addr - start_addr < page_size) +break ; + sgl =sg_next (sgl); + i++; + } + + buf->pages[i] =phys_to_page (start_addr); + + sgl =sg_next (sgl); +sg_set_page (sgl, buf->pages[i+1 ], end_addr - start_addr,0 ); }DRM_DEBUG_KMS ("vaddr(0x%lx), dma_addr(0x%lx), size(0x%lx)\n" , - (unsigned long )buffer->kvaddr, - (unsigned long )buffer->dma_addr, - buffer->size); - -return 0 ; + (unsigned long )buf->kvaddr, + (unsigned long )buf->dma_addr, + buf->size); + +return ret; +err2: +dma_free_writecombine (dev->dev, buf->size, buf->kvaddr, + (dma_addr_t )buf->dma_addr); + buf->dma_addr = (dma_addr_t )NULL ; +err1: +sg_free_table (buf->sgt); +kfree (buf->sgt); + buf->sgt =NULL ; + +return ret; }static void lowlevel_buffer_deallocate (struct drm_device *dev, -struct exynos_drm_gem_buf *buffer) +unsigned int flags,struct exynos_drm_gem_buf *buf) {DRM_DEBUG_KMS ("%s.\n" , __FILE__); -if (buffer->dma_addr && buffer->size) -dma_free_writecombine (dev->dev, buffer->size, buffer->kvaddr, - (dma_addr_t )buffer->dma_addr); -else -DRM_DEBUG_KMS ("buffer data are invalid.\n" ); +/* +* release only physically continuous memory and +* non-continuous memory would be released by exynos +* gem framework. +*/ +if (!(flags &EXYNOS_BO_NONCONTIG )) { +sg_free_table (buf->sgt); + +kfree (buf->sgt); + buf->sgt =NULL ; + +kfree (buf->pages); + buf->pages =NULL ; + +if (buf->dma_addr && buf->size) +dma_free_writecombine (dev->dev, buf->size, buf->kvaddr, + (dma_addr_t )buf->dma_addr); +else +DRM_DEBUG_KMS ("buffer data are invalid.\n" ); + + buf->dma_addr = (dma_addr_t )NULL ; + } }struct exynos_drm_gem_buf *exynos_drm_buf_create (struct drm_device *dev, -unsigned int size) +unsigned int flags,unsigned int size) {struct exynos_drm_gem_buf *buffer;
@@ -82,7 +188,7 @@ struct exynos_drm_gem_buf *exynos_drm_buf_create(struct drm_device *dev,* allocate memory region with size and set the memory information * to vaddr and dma_addr of a buffer object. */ -if (lowlevel_buffer_allocate (dev, buffer) <0 ) { +if (lowlevel_buffer_allocate (dev, flags, buffer) <0 ) {kfree (buffer);return NULL ; }
@@ -91,7 +197,7 @@ struct exynos_drm_gem_buf *exynos_drm_buf_create(struct drm_device *dev, }void exynos_drm_buf_destroy (struct drm_device *dev, -struct exynos_drm_gem_buf *buffer) +unsigned int flags,struct exynos_drm_gem_buf *buffer) {DRM_DEBUG_KMS ("%s.\n" , __FILE__);
@@ -100,7 +206,7 @@ void exynos_drm_buf_destroy(struct drm_device *dev,return ; } -lowlevel_buffer_deallocate (dev, buffer); +lowlevel_buffer_deallocate (dev, flags, buffer);kfree (buffer); buffer =NULL ;
drivers/gpu/drm/exynos/exynos_drm_buf.h +2 -2
@@ -28,10 +28,10 @@/* allocate physical memory. */ struct exynos_drm_gem_buf *exynos_drm_buf_create (struct drm_device *dev, -unsigned int size); +unsigned int flags,unsigned int size);/* remove allocated physical memory. */ void exynos_drm_buf_destroy (struct drm_device *dev, -struct exynos_drm_gem_buf *buffer); +unsigned int flags,struct exynos_drm_gem_buf *buffer);#endif
drivers/gpu/drm/exynos/exynos_drm_fbdev.c +3 -1
@@ -151,7 +151,9 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper, } size = mode_cmd.pitches[0 ] * mode_cmd.height; - exynos_gem_obj =exynos_drm_gem_create (dev, size); + +/* 0 means to allocate physically continuous memory */ + exynos_gem_obj =exynos_drm_gem_create (dev,0 , size);if (IS_ERR (exynos_gem_obj)) { ret =PTR_ERR (exynos_gem_obj); goto out;
drivers/gpu/drm/exynos/exynos_drm_gem.c +259 -25
379 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_drm_gem.h +10 -1
@@ -36,11 +36,15 @@* @dma_addr: bus address(accessed by dma) to allocated memory region. * - this address could be physical address without IOMMU and * device address with IOMMU. +* @sgt: sg table to transfer page data. +* @pages: contain all pages to allocated memory region. * @size: size of allocated memory region. */ struct exynos_drm_gem_buf {void __iomem *kvaddr;dma_addr_t dma_addr; +struct sg_table *sgt; +struct page **pages;unsigned long size; };
@@ -55,6 +59,8 @@ struct exynos_drm_gem_buf {* by user request or at framebuffer creation. * continuous memory region allocated by user request * or at framebuffer creation. +* @size: total memory size to physically non-continuous memory region. +* @flags: indicate memory type to allocated buffer and cache attruibute. * * P.S. this object would be transfered to user as kms_bo.handle so * user can access the buffer through kms_bo.handle.
@@ -62,6 +68,8 @@ struct exynos_drm_gem_buf {struct exynos_drm_gem_obj {struct drm_gem_object base;struct exynos_drm_gem_buf *buffer; +unsigned long size; +unsigned int flags; };/* destroy a buffer with gem object */
@@ -69,7 +77,8 @@ void exynos_drm_gem_destroy(struct exynos_drm_gem_obj *exynos_gem_obj);/* create a new buffer with gem object */ struct exynos_drm_gem_obj *exynos_drm_gem_create (struct drm_device *dev, -unsigned long size); +unsigned int flags, +unsigned long size);/* * request gem object creation and buffer allocation as the size
include/drm/exynos_drm.h +6 -0
@@ -79,6 +79,12 @@ struct drm_exynos_plane_set_zpos {__s32 zpos; }; +/* memory type definitions. */ +enum e_drm_exynos_gem_mem_type { +/* Physically Non-Continuous memory. */ +EXYNOS_BO_NONCONTIG =1 <<0 +}; +#define DRM_EXYNOS_GEM_CREATE 0x00#define DRM_EXYNOS_GEM_MAP_OFFSET 0x01#define DRM_EXYNOS_GEM_MMAP 0x02
Signature · 1 line
1.7.4.1
Inki Dae
maintainerPATCH 4/10 drm/exynos: added new funtion to get/put dma address.
In reply to Inki Daethis function would be used for drm based 2d acceleration driver to get/put dma address through gem handle.
when exynos_drm_get_dma_address is called reference count of gem object would be increased not to be released by gem close and when exynos_drm_put_dma_address is called the reference count of this gem object would be decreased to be released.
--- drivers/gpu/drm/exynos/exynos_drm_gem.c | 58 +++++++++++++++++++++++++++++++ drivers/gpu/drm/exynos/exynos_drm_gem.h | 18 +++++++++ 2 files changed, 76 insertions(+), 0 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_gem.c +58 -0
@@ -377,6 +377,64 @@ int exynos_drm_gem_create_ioctl(struct drm_device *dev, void *data,return 0 ; } +void *exynos_drm_gem_get_dma_addr (struct drm_device *dev, +unsigned int gem_handle, +struct drm_file *file_priv) +{ +struct exynos_drm_gem_obj *exynos_gem_obj; +struct drm_gem_object *obj; + + obj =drm_gem_object_lookup (dev, file_priv, gem_handle); +if (!obj) { +DRM_ERROR ("failed to lookup gem object.\n" ); +return ERR_PTR (-EINVAL ); + } + + exynos_gem_obj =to_exynos_gem_obj (obj); + +if (exynos_gem_obj->flags &EXYNOS_BO_NONCONTIG ) { +DRM_DEBUG_KMS ("not support NONCONTIG type.\n" ); +drm_gem_object_unreference_unlocked (obj); + +/* TODO */ +return ERR_PTR (-EINVAL ); + } + +return &exynos_gem_obj->buffer->dma_addr; +} + +void exynos_drm_gem_put_dma_addr (struct drm_device *dev, +unsigned int gem_handle, +struct drm_file *file_priv) +{ +struct exynos_drm_gem_obj *exynos_gem_obj; +struct drm_gem_object *obj; + + obj =drm_gem_object_lookup (dev, file_priv, gem_handle); +if (!obj) { +DRM_ERROR ("failed to lookup gem object.\n" ); +return ; + } + + exynos_gem_obj =to_exynos_gem_obj (obj); + +if (exynos_gem_obj->flags &EXYNOS_BO_NONCONTIG ) { +DRM_DEBUG_KMS ("not support NONCONTIG type.\n" ); +drm_gem_object_unreference_unlocked (obj); + +/* TODO */ +return ; + } + +drm_gem_object_unreference_unlocked (obj); + +/* +* decrease obj->refcount one more time because we has already +* increased it at exynos_drm_gem_get_dma_addr(). +*/ +drm_gem_object_unreference_unlocked (obj); +} +int exynos_drm_gem_map_offset_ioctl (struct drm_device *dev,void *data,struct drm_file *file_priv) {
drivers/gpu/drm/exynos/exynos_drm_gem.h +18 -0
@@ -88,6 +88,24 @@ struct exynos_drm_gem_obj *exynos_drm_gem_create(struct drm_device *dev,int exynos_drm_gem_create_ioctl (struct drm_device *dev,void *data,struct drm_file *file_priv); +/* +* get dma address from gem handle and this function could be used for +* other drivers such as 2d/3d acceleration drivers. +* with this function call, gem object reference count would be increased. +*/ +void *exynos_drm_gem_get_dma_addr (struct drm_device *dev, +unsigned int gem_handle, +struct drm_file *file_priv); + +/* +* put dma address from gem handle and this function could be used for +* other drivers such as 2d/3d acceleration drivers. +* with this function call, gem object reference count would be decreased. +*/ +void exynos_drm_gem_put_dma_addr (struct drm_device *dev, +unsigned int gem_handle, +struct drm_file *file_priv); +/* get buffer offset to map to user space. */ int exynos_drm_gem_map_offset_ioctl (struct drm_device *dev,void *data,struct drm_file *file_priv);
Signature · 1 line
1.7.4.1
Inki Dae
maintainerPATCH 5/10 drm/exynos: release pending pageflip events when closed
In reply to Inki DaeFrom: Joonyoung Shim <[email protected]>
We should release pending pageflip events when closed. If not, they will be dangling events.
--- drivers/gpu/drm/exynos/exynos_drm_drv.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_drv.c +14 -0
@@ -147,8 +147,22 @@ static int exynos_drm_unload(struct drm_device *dev)static void exynos_drm_preclose (struct drm_device *dev,struct drm_file *file) { +struct exynos_drm_private *private = dev->dev_private; +struct drm_pending_vblank_event *e, *t; +unsigned long flags; +DRM_DEBUG_DRIVER ("%s\n" , __FILE__); +/* release events of current file */ +spin_lock_irqsave (&dev->event_lock, flags); +list_for_each_entry_safe (e, t, &private->pageflip_event_list, + base.link) { +if (e->base.file_priv == file) { +list_del (&e->base.link); + e->base.destroy (&e->base); + } + } +spin_unlock_irqrestore (&dev->event_lock, flags); }static void exynos_drm_postclose (struct drm_device *dev,struct drm_file *file)
Signature · 1 line
1.7.4.1
Inki Dae
maintainerPATCH 6/10 drm/exynos: remove module of exynos drm subdrv
In reply to Inki DaeFrom: Joonyoung Shim <[email protected]>
The exynos drm driver has several subdrv. They each can be module but it causes unfixed probe order of exynodr drm driver and each subdrv. It also needs some weird codes such as exynos_drm_fbdev_reinit and exynos_drm_mode_group_reinit. This patch can remove weird codes and clear codes through we doesn't modularity each subdrv.
Also this removes unnecessary codes related module.
--- drivers/gpu/drm/exynos/Kconfig | 8 +-- drivers/gpu/drm/exynos/Makefile | 10 ++- drivers/gpu/drm/exynos/exynos_ddc.c | 1 - drivers/gpu/drm/exynos/exynos_drm_buf.c | 4 - drivers/gpu/drm/exynos/exynos_drm_connector.c | 6 -- drivers/gpu/drm/exynos/exynos_drm_core.c | 112 ++----------------------- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 6 -- drivers/gpu/drm/exynos/exynos_drm_drv.c | 52 +++++++++++- drivers/gpu/drm/exynos/exynos_drm_drv.h | 12 ++-- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 6 -- drivers/gpu/drm/exynos/exynos_drm_fb.c | 6 -- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 86 ------------------- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 20 +---- drivers/gpu/drm/exynos/exynos_drm_gem.c | 4 - drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 87 +------------------ drivers/gpu/drm/exynos/exynos_hdmi.c | 9 -- drivers/gpu/drm/exynos/exynos_mixer.c | 7 -- 17 files changed, 77 insertions(+), 359 deletions(-)
drivers/gpu/drm/exynos/Kconfig +2 -6
@@ -1,7 +1,6 @@ config DRM_EXYNOS tristate "DRM Support for Samsung SoC EXYNOS Series" depends on DRM && PLAT_SAMSUNG - default n select DRM_KMS_HELPER select FB_CFB_FILLRECT select FB_CFB_COPYAREA
@@ -12,16 +11,13 @@ config DRM_EXYNOS If M is selected the module will be called exynosdrm. config DRM_EXYNOS_FIMD - tristate "Exynos DRM FIMD" + bool "Exynos DRM FIMD" depends on DRM_EXYNOS && !FB_S3C - default n help Choose this option if you want to use Exynos FIMD for DRM. - If M is selected, the module will be called exynos_drm_fimd config DRM_EXYNOS_HDMI - tristate "Exynos DRM HDMI" + bool "Exynos DRM HDMI" depends on DRM_EXYNOS && !VIDEO_SAMSUNG_S5P_TV help Choose this option if you want to use Exynos HDMI for DRM. - If M is selected, the module will be called exynos_drm_hdmi
drivers/gpu/drm/exynos/Makefile +6 -4
@@ -8,7 +8,9 @@ exynosdrm-y := exynos_drm_drv.o exynos_drm_encoder.o exynos_drm_connector.o \ exynos_drm_buf.o exynos_drm_gem.o exynos_drm_core.o \ exynos_drm_plane.o -obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o -obj-$(CONFIG_DRM_EXYNOS_FIMD) += exynos_drm_fimd.o -obj-$(CONFIG_DRM_EXYNOS_HDMI) += exynos_hdmi.o exynos_mixer.o exynos_ddc.o \ - exynos_hdmiphy.o exynos_drm_hdmi.o +exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD) += exynos_drm_fimd.o +exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI) += exynos_hdmi.o exynos_mixer.o \ + exynos_ddc.o exynos_hdmiphy.o \ + exynos_drm_hdmi.o + +obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o
drivers/gpu/drm/exynos/exynos_ddc.c +0 -1
@@ -55,4 +55,3 @@ struct i2c_driver ddc_driver = { .remove = __devexit_p(s5p_ddc_remove), .command = NULL, }; -EXPORT_SYMBOL (ddc_driver);
drivers/gpu/drm/exynos/exynos_drm_buf.c +0 -4
@@ -211,7 +211,3 @@ void exynos_drm_buf_destroy(struct drm_device *dev,kfree (buffer); buffer =NULL ; } - -MODULE_AUTHOR ("Inki Dae <[email protected]>" ); -MODULE_DESCRIPTION ("Samsung SoC DRM Buffer Management Module" ); -MODULE_LICENSE ("GPL" );
drivers/gpu/drm/exynos/exynos_drm_connector.c +0 -6
@@ -348,9 +348,3 @@ err_connector:kfree (exynos_connector);return NULL ; } - -MODULE_AUTHOR ("Inki Dae <[email protected]>" ); -MODULE_AUTHOR ("Joonyoung Shim <[email protected]>" ); -MODULE_AUTHOR ("Seung-Woo Kim <[email protected]>" ); -MODULE_DESCRIPTION ("Samsung SoC DRM Connector Driver" ); -MODULE_LICENSE ("GPL" );
drivers/gpu/drm/exynos/exynos_drm_core.c +7 -105
168 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_drm_crtc.c +0 -6
@@ -430,9 +430,3 @@ void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int crtc)exynos_drm_fn_encoder (private->crtc[crtc], &crtc, exynos_drm_disable_vblank); } - -MODULE_AUTHOR ("Inki Dae <[email protected]>" ); -MODULE_AUTHOR ("Joonyoung Shim <[email protected]>" ); -MODULE_AUTHOR ("Seung-Woo Kim <[email protected]>" ); -MODULE_DESCRIPTION ("Samsung SoC DRM CRTC Driver" ); -MODULE_LICENSE ("GPL" );
drivers/gpu/drm/exynos/exynos_drm_drv.c +51 -1
66 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_drm_drv.h +6 -6
@@ -262,15 +262,15 @@ int exynos_drm_device_unregister(struct drm_device *dev);* this function would be called by sub drivers such as display controller * or hdmi driver to register this sub driver object to exynos drm driver * and when a sub driver is registered to exynos drm driver a probe callback -* of the sub driver is called and creates its own encoder and connector -* and then fb helper and drm mode group would be re-initialized. +* of the sub driver is called and creates its own encoder and connector. */ int exynos_drm_subdrv_register (struct exynos_drm_subdrv *drm_subdrv); -/* -* this function removes subdrv list from exynos drm driver and fb helper -* and drm mode group would be re-initialized. -*/ +/* this function removes subdrv list from exynos drm driver */ int exynos_drm_subdrv_unregister (struct exynos_drm_subdrv *drm_subdrv); +extern struct platform_driver fimd_driver; +extern struct platform_driver hdmi_driver; +extern struct platform_driver mixer_driver; +extern struct platform_driver exynos_drm_common_hdmi_driver;#endif
drivers/gpu/drm/exynos/exynos_drm_encoder.c +0 -6
@@ -442,9 +442,3 @@ void exynos_drm_encoder_crtc_disable(struct drm_encoder *encoder, void *data)if (overlay_ops && overlay_ops->disable) overlay_ops->disable (manager->dev, zpos); } - -MODULE_AUTHOR ("Inki Dae <[email protected]>" ); -MODULE_AUTHOR ("Joonyoung Shim <[email protected]>" ); -MODULE_AUTHOR ("Seung-Woo Kim <[email protected]>" ); -MODULE_DESCRIPTION ("Samsung SoC DRM Encoder Driver" ); -MODULE_LICENSE ("GPL" );
drivers/gpu/drm/exynos/exynos_drm_fb.c +0 -6
@@ -211,9 +211,3 @@ void exynos_drm_mode_config_init(struct drm_device *dev) dev->mode_config.funcs = &exynos_drm_mode_config_funcs; } - -MODULE_AUTHOR ("Inki Dae <[email protected]>" ); -MODULE_AUTHOR ("Joonyoung Shim <[email protected]>" ); -MODULE_AUTHOR ("Seung-Woo Kim <[email protected]>" ); -MODULE_DESCRIPTION ("Samsung SoC DRM FB Driver" ); -MODULE_LICENSE ("GPL" );
drivers/gpu/drm/exynos/exynos_drm_fbdev.c +0 -86
89 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_drm_fimd.c +1 -19
@@ -1007,7 +1007,7 @@ static const struct dev_pm_ops fimd_pm_ops = {SET_RUNTIME_PM_OPS (fimd_runtime_suspend, fimd_runtime_resume,NULL ) }; -static struct platform_driver fimd_driver = { +struct platform_driver fimd_driver = { .probe = fimd_probe, .remove =__devexit_p (fimd_remove), .driver = {
@@ -1016,21 +1016,3 @@ static struct platform_driver fimd_driver = { .pm = &fimd_pm_ops, }, }; - -static int __init fimd_init (void ) -{ -return platform_driver_register (&fimd_driver); -} - -static void __exit fimd_exit(void) -{ -platform_driver_unregister (&fimd_driver); -} - -module_init (fimd_init); -module_exit (fimd_exit); - -MODULE_AUTHOR ("Joonyoung Shim <[email protected]>" ); -MODULE_AUTHOR ("Inki Dae <[email protected]>" ); -MODULE_DESCRIPTION ("Samsung DRM FIMD Driver" ); -MODULE_LICENSE ("GPL" );
drivers/gpu/drm/exynos/exynos_drm_gem.c +0 -4
@@ -727,7 +727,3 @@ int exynos_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma)return ret; } - -MODULE_AUTHOR ("Inki Dae <[email protected]>" ); -MODULE_DESCRIPTION ("Samsung SoC DRM GEM Module" ); -MODULE_LICENSE ("GPL" );
drivers/gpu/drm/exynos/exynos_drm_hdmi.c +4 -83
161 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_hdmi.c +0 -9
@@ -1998,14 +1998,12 @@ void hdmi_attach_ddc_client(struct i2c_client *ddc)if (ddc) hdmi_ddc = ddc; } -EXPORT_SYMBOL (hdmi_attach_ddc_client);void hdmi_attach_hdmiphy_client (struct i2c_client *hdmiphy) {if (hdmiphy) hdmi_hdmiphy = hdmiphy; } -EXPORT_SYMBOL (hdmi_attach_hdmiphy_client);static int __devinit hdmi_probe (struct platform_device *pdev) {
@@ -2188,10 +2186,3 @@ struct platform_driver hdmi_driver = { .pm = &hdmi_pm_ops, }, }; -EXPORT_SYMBOL (hdmi_driver); - -MODULE_AUTHOR ("Seung-Woo Kim, <[email protected]>" ); -MODULE_AUTHOR ("Inki Dae <[email protected]>" ); -MODULE_AUTHOR ("Joonyoung Shim <[email protected]>" ); -MODULE_DESCRIPTION ("Samsung DRM HDMI core Driver" ); -MODULE_LICENSE ("GPL" );
drivers/gpu/drm/exynos/exynos_mixer.c +0 -7
@@ -1066,10 +1066,3 @@ struct platform_driver mixer_driver = { .probe = mixer_probe, .remove = __devexit_p(mixer_remove), }; -EXPORT_SYMBOL (mixer_driver); - -MODULE_AUTHOR ("Seung-Woo Kim, <[email protected]>" ); -MODULE_AUTHOR ("Inki Dae <[email protected]>" ); -MODULE_AUTHOR ("Joonyoung Shim <[email protected]>" ); -MODULE_DESCRIPTION ("Samsung DRM HDMI mixer Driver" ); -MODULE_LICENSE ("GPL" );
Signature · 1 line
1.7.4.1
Inki Dae
maintainerPATCH 7/10 drm/exynos: add subdrv open/close functions
In reply to Inki DaeFrom: Joonyoung Shim <[email protected]>
Some subdrv need open and close functions call when open and close drm.
--- drivers/gpu/drm/exynos/exynos_drm_core.c | 35 ++++++++++++++++++++++++++++++ drivers/gpu/drm/exynos/exynos_drm_drv.c | 10 ++++++++ drivers/gpu/drm/exynos/exynos_drm_drv.h | 9 +++++++ 3 files changed, 54 insertions(+), 0 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_core.c +35 -0
@@ -175,3 +175,38 @@ int exynos_drm_subdrv_unregister(struct exynos_drm_subdrv *subdrv)return 0 ; }EXPORT_SYMBOL_GPL (exynos_drm_subdrv_unregister); + +int exynos_drm_subdrv_open (struct drm_device *dev,struct drm_file *file) +{ +struct exynos_drm_subdrv *subdrv; +int ret; + +list_for_each_entry (subdrv, &exynos_drm_subdrv_list, list) { +if (subdrv->open) { + ret = subdrv->open (dev, subdrv->manager.dev, file); +if (ret) + goto err; + } + } + +return 0 ; + +err: +list_for_each_entry_reverse (subdrv, &subdrv->list, list) { +if (subdrv->close) + subdrv->close (dev, subdrv->manager.dev, file); + } +return ret; +} +EXPORT_SYMBOL_GPL (exynos_drm_subdrv_open); + +void exynos_drm_subdrv_close (struct drm_device *dev,struct drm_file *file) +{ +struct exynos_drm_subdrv *subdrv; + +list_for_each_entry (subdrv, &exynos_drm_subdrv_list, list) { +if (subdrv->close) + subdrv->close (dev, subdrv->manager.dev, file); + } +} +EXPORT_SYMBOL_GPL (exynos_drm_subdrv_close);
drivers/gpu/drm/exynos/exynos_drm_drv.c +10 -0
@@ -144,6 +144,13 @@ static int exynos_drm_unload(struct drm_device *dev)return 0 ; } +static int exynos_drm_open (struct drm_device *dev,struct drm_file *file) +{ +DRM_DEBUG_DRIVER ("%s\n" , __FILE__); + +return exynos_drm_subdrv_open (dev, file); +} +static void exynos_drm_preclose (struct drm_device *dev,struct drm_file *file) {
@@ -163,6 +170,8 @@ static void exynos_drm_preclose(struct drm_device *dev, } }spin_unlock_irqrestore (&dev->event_lock, flags); + +exynos_drm_subdrv_close (dev, file); }static void exynos_drm_postclose (struct drm_device *dev,struct drm_file *file)
@@ -216,6 +225,7 @@ static struct drm_driver exynos_drm_driver = { DRIVER_MODESET | DRIVER_GEM, .load = exynos_drm_load, .unload = exynos_drm_unload, + .open = exynos_drm_open, .preclose = exynos_drm_preclose, .lastclose = exynos_drm_lastclose, .postclose = exynos_drm_postclose,
drivers/gpu/drm/exynos/exynos_drm_drv.h +9 -0
@@ -229,6 +229,8 @@ struct exynos_drm_private {* subdrv is registered to it. * @remove: this callback is used to release resources created * by probe callback. +* @open: this would be called with drm device file open. +* @close: this would be called with drm device file close. * @manager: subdrv has its own manager to control a hardware appropriately * and we can access a hardware drawing on this manager. * @encoder: encoder object owned by this sub driver.
@@ -240,6 +242,10 @@ struct exynos_drm_subdrv {int (*probe)(struct drm_device *drm_dev,struct device *dev);void (*remove)(struct drm_device *dev); +int (*open)(struct drm_device *drm_dev,struct device *dev, +struct drm_file *file); +void (*close)(struct drm_device *drm_dev,struct device *dev, +struct drm_file *file);struct exynos_drm_manager manager;struct drm_encoder *encoder;
@@ -269,6 +275,9 @@ int exynos_drm_subdrv_register(struct exynos_drm_subdrv *drm_subdrv);/* this function removes subdrv list from exynos drm driver */ int exynos_drm_subdrv_unregister (struct exynos_drm_subdrv *drm_subdrv); +int exynos_drm_subdrv_open (struct drm_device *dev,struct drm_file *file); +void exynos_drm_subdrv_close (struct drm_device *dev,struct drm_file *file); +extern struct platform_driver fimd_driver;extern struct platform_driver hdmi_driver;extern struct platform_driver mixer_driver;
Signature · 1 line
1.7.4.1
Inki Dae
maintainerPATCH 8/10 drm/exynos: add is_local member in exynos_drm_subdrv struct
In reply to Inki DaeFrom: Joonyoung Shim <[email protected]>
The is_local member indicates unused subdrv such connector and encoder so doesn't make resources for them.
--- drivers/gpu/drm/exynos/exynos_drm_core.c | 3 +++ drivers/gpu/drm/exynos/exynos_drm_drv.h | 2 ++ 2 files changed, 5 insertions(+), 0 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_core.c +3 -0
@@ -59,6 +59,9 @@ static int exynos_drm_subdrv_probe(struct drm_device *dev,return ret; } +if (subdrv->is_local) +return 0 ; +/* create and initialize a encoder for this sub driver. */ encoder =exynos_drm_encoder_create (dev, &subdrv->manager, (1 <<MAX_CRTC ) -1 );
drivers/gpu/drm/exynos/exynos_drm_drv.h +2 -0
@@ -225,6 +225,7 @@ struct exynos_drm_private {* @list: sub driver has its own list object to register to exynos drm driver. * @drm_dev: pointer to drm_device and this pointer would be set * when sub driver calls exynos_drm_subdrv_register(). +* @is_local: appear encoder and connector disrelated device. * @probe: this callback would be called by exynos drm driver after * subdrv is registered to it. * @remove: this callback is used to release resources created
@@ -239,6 +240,7 @@ struct exynos_drm_private {struct exynos_drm_subdrv {struct list_head list;struct drm_device *drm_dev; +bool is_local;int (*probe)(struct drm_device *drm_dev,struct device *dev);void (*remove)(struct drm_device *dev);
Signature · 1 line
1.7.4.1
Inki Dae
maintainerPATCH 9/10 drm/exynos: add G2D driver
In reply to Inki DaeFrom: Joonyoung Shim <[email protected]>
G2D is a 2D graphic accelerator that supports Bit Block Transfer. This G2D driver is exynos drm specific and supports only exynos4x12 series. user application fills command set in cmdlist and once dma start request these cmdlists are parsed and performed by dma.
This adds below three exynos specific ioctl and one event for G2D.
- DRM_EXYNOS_G2D_GET_VER
- DRM_EXYNOS_G2D_SET_CMDLIST
- DRM_EXYNOS_G2D_EXEC
- DRM_EXYNOS_G2D_EVENT
--- drivers/gpu/drm/exynos/Kconfig | 6 + drivers/gpu/drm/exynos/Makefile | 1 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 31 ++ drivers/gpu/drm/exynos/exynos_drm_drv.h | 11 + drivers/gpu/drm/exynos/exynos_drm_g2d.c | 864 +++++++++++++++++++++++++++++++ drivers/gpu/drm/exynos/exynos_drm_g2d.h | 36 ++ include/drm/exynos_drm.h | 56 ++ 7 files changed, 1005 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_g2d.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_g2d.h
drivers/gpu/drm/exynos/Kconfig +6 -0
@@ -21,3 +21,9 @@ config DRM_EXYNOS_HDMI depends on DRM_EXYNOS && !VIDEO_SAMSUNG_S5P_TV help Choose this option if you want to use Exynos HDMI for DRM. + +config DRM_EXYNOS_G2D + bool "Exynos DRM G2D" + depends on DRM_EXYNOS + help + Choose this option if you want to use Exynos G2D for DRM.
drivers/gpu/drm/exynos/Makefile +1 -0
@@ -12,5 +12,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD) += exynos_drm_fimd.o exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI) += exynos_hdmi.o exynos_mixer.o \ exynos_ddc.o exynos_hdmiphy.o \ exynos_drm_hdmi.o +exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o
drivers/gpu/drm/exynos/exynos_drm_drv.c +31 -0
@@ -37,6 +37,7 @@#include "exynos_drm_fbdev.h" #include "exynos_drm_fb.h" #include "exynos_drm_gem.h" +#include "exynos_drm_g2d.h" #include "exynos_drm_plane.h" #define DRIVER_NAME "exynos"
@@ -146,8 +147,16 @@ static int exynos_drm_unload(struct drm_device *dev)static int exynos_drm_open (struct drm_device *dev,struct drm_file *file) { +struct drm_exynos_file_private *file_priv; +DRM_DEBUG_DRIVER ("%s\n" , __FILE__); + file_priv =kzalloc (sizeof (*file_priv),GFP_KERNEL ); +if (!file_priv) +return -ENOMEM ; + + file->driver_priv = file_priv; +return exynos_drm_subdrv_open (dev, file); }
@@ -208,6 +217,13 @@ static struct drm_ioctl_desc exynos_ioctls[] = { exynos_drm_gem_mmap_ioctl, DRM_UNLOCKED | DRM_AUTH),DRM_IOCTL_DEF_DRV (EXYNOS_PLANE_SET_ZPOS , exynos_plane_set_zpos_ioctl,DRM_UNLOCKED |DRM_AUTH ), + +DRM_IOCTL_DEF_DRV (EXYNOS_G2D_GET_VER , + exynos_g2d_get_ver_ioctl,DRM_UNLOCKED |DRM_AUTH ), +DRM_IOCTL_DEF_DRV (EXYNOS_G2D_SET_CMDLIST , + exynos_g2d_set_cmdlist_ioctl,DRM_UNLOCKED |DRM_AUTH ), +DRM_IOCTL_DEF_DRV (EXYNOS_G2D_EXEC , + exynos_g2d_exec_ioctl, DRM_UNLOCKED | DRM_AUTH), }; static const struct file_operations exynos_drm_driver_fops = {
@@ -298,6 +314,12 @@ static int __init exynos_drm_init(void) goto out_common_hdmi;#endif +#ifdef CONFIG_DRM_EXYNOS_G2D + ret =platform_driver_register (&g2d_driver); +if (ret <0 ) + goto out_g2d; +#endif + ret =platform_driver_register (&exynos_drm_platform_driver);if (ret <0 ) goto out;
@@ -305,6 +327,11 @@ static int __init exynos_drm_init(void)return 0 ; out: +#ifdef CONFIG_DRM_EXYNOS_G2D +platform_driver_unregister (&g2d_driver); +out_g2d: +#endif +#ifdef CONFIG_DRM_EXYNOS_HDMI platform_driver_unregister (&exynos_drm_common_hdmi_driver); out_common_hdmi:
@@ -327,6 +354,10 @@ static void __exit exynos_drm_exit(void)platform_driver_unregister (&exynos_drm_platform_driver); +#ifdef CONFIG_DRM_EXYNOS_G2D +platform_driver_unregister (&g2d_driver); +#endif +#ifdef CONFIG_DRM_EXYNOS_HDMI platform_driver_unregister (&exynos_drm_common_hdmi_driver);platform_driver_unregister (&mixer_driver);
drivers/gpu/drm/exynos/exynos_drm_drv.h +11 -0
@@ -203,6 +203,16 @@ struct exynos_drm_manager {struct exynos_drm_display_ops *display_ops; }; +struct exynos_drm_g2d_private { +struct device *dev; +struct list_head inuse_cmdlist; +struct list_head event_list; +}; + +struct drm_exynos_file_private { +struct exynos_drm_g2d_private *g2d_priv; +}; +/* * Exynos drm private structure. */
@@ -284,4 +294,5 @@ extern struct platform_driver fimd_driver;extern struct platform_driver hdmi_driver;extern struct platform_driver mixer_driver;extern struct platform_driver exynos_drm_common_hdmi_driver; +extern struct platform_driver g2d_driver;#endif
drivers/gpu/drm/exynos/exynos_drm_g2d.c new file +864 -0
864 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_drm_g2d.h new file +36 -0
@@ -0,0 +1,36 @@ +/* +* Copyright (C) 2012 Samsung Electronics Co.Ltd +* Authors: Joonyoung Shim <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundationr +*/ + +#ifdef CONFIG_DRM_EXYNOS_G2D +extern int exynos_g2d_get_ver_ioctl (struct drm_device *dev,void *data, +struct drm_file *file_priv); +extern int exynos_g2d_set_cmdlist_ioctl (struct drm_device *dev,void *data, +struct drm_file *file_priv); +extern int exynos_g2d_exec_ioctl (struct drm_device *dev,void *data, +struct drm_file *file_priv); +#else +static inline int exynos_g2d_get_ver_ioctl (struct drm_device *dev,void *data, +struct drm_file *file_priv) +{ +return -ENODEV ; +} + +static inline int exynos_g2d_set_cmdlist_ioctl (struct drm_device *dev, +void *data, +struct drm_file *file_priv) +{ +return -ENODEV ; +} + +static inline int exynos_g2d_exec_ioctl (struct drm_device *dev,void *data, +struct drm_file *file_priv) +{ +return -ENODEV ; +} +#endif
include/drm/exynos_drm.h +56 -0
80 lines not on this page · raw message
Signature · 1 line
1.7.4.1
Dave Airlie
maintainerRe: [PATCH 09/10] drm/exynos: add G2D driver
Quoted 5 lines
G2D is a 2D graphic accelerator that supports Bit Block Transfer. This G2D driver is exynos drm specific and supports only exynos4x12 series. user application fills command set in cmdlist and once dma start request these cmdlists are parsed and performed by dma.
Where is this block documented or a pointer to the corresponding open userspace user code?
Again the ioctls look like they need to be depointered and use __u64.
It would be nice if you could document how the command stream and engine work.
How does userspace pass addresses to it? straight or via gem objects? how does it
stop userspace blt to places it shouldn't etc.
I'm getting the feeling this accel enabled driver needs a lot more of a commit message
and lot more documentation on what it can be used for.
Dave.
Re: [PATCH 09/10] drm/exynos: add G2D driver
Quoted 11 lines · Dave Airlie
Quoted 4 lines
G2D is a 2D graphic accelerator that supports Bit Block Transfer. This G2D driver is exynos drm specific and supports only exynos4x12 series. user application fills command set in cmdlist and once dma start request these cmdlists are parsed and performed by dma.
Where is this block documented or a pointer to the corresponding open userspace user code?
Again the ioctls look like they need to be depointered and use
__u64.It would be nice if you could document how the command stream and engine work.
Quoted 7 lines
How does userspace pass addresses to it? straight or via gem objects? how does it
stop userspace blt to places it shouldn't etc.I'm getting the feeling this accel enabled driver needs a lot more of a commit message
and lot more documentation on what it can be used for.
OK, i will update the more documentation and simple user space program.
Thanks.
Re: [PATCH 09/10] drm/exynos: add G2D driver
In reply to Dave AirlieQuoted 6 lines · Dave Airlie
Quoted 4 lines
G2D is a 2D graphic accelerator that supports Bit Block Transfer. This G2D driver is exynos drm specific and supports only exynos4x12 series. user application fills command set in cmdlist and once dma start request these cmdlists are parsed and performed by dma.
Where is this block documented or a pointer to the corresponding open userspace user code?
I attach simple g2dtest program patch. The base of this patch is master branch of lastest libdrm git.
This user progrem can test just solid color fill example. I will cleanup and update it for more operations later.
Thanks.
Quoted 12 lines
Again the ioctls look like they need to be depointered and use
__u64.It would be nice if you could document how the command stream and engine work.
How does userspace pass addresses to it? straight or via gem objects? how does it
stop userspace blt to places it shouldn't etc.I'm getting the feeling this accel enabled driver needs a lot more of a commit message
and lot more documentation on what it can be used for.
Quoted 8 lines
Dave.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-develFrom
845c0a1bbf67b342099c5eae6f573063af8fc023Mon Sep 17 00:00:00 2001
From: Joonyoung Shim <[email protected]>
Date: Fri, 16 Mar 2012 15:13:45 +0900
Subject: [PATCH] Add simple g2dtest
This can test only solid color fill.
--- configure.ac | 1 + include/drm/exynos_drm.h | 185 ++++++++++++++ tests/Makefile.am | 2 +- tests/g2dtest/Makefile.am | 16 ++ tests/g2dtest/g2d.h | 64 +++++ tests/g2dtest/g2d_reg.h | 108 ++++++++ tests/g2dtest/g2dtest.c | 612 +++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 987 insertions(+), 1 deletions(-) create mode 100644 include/drm/exynos_drm.h create mode 100644 tests/g2dtest/Makefile.am create mode 100644 tests/g2dtest/g2d.h create mode 100644 tests/g2dtest/g2d_reg.h create mode 100644 tests/g2dtest/g2dtest.c
configure.ac +1 -0
@@ -297,6 +297,7 @@ AC_CONFIG_FILES([ tests/kmstest/Makefile tests/radeon/Makefile tests/vbltest/Makefile + tests/g2dtest/Makefile include/Makefile include/drm/Makefile libdrm.pc])
include/drm/exynos_drm.h new file +185 -0
185 lines not on this page · raw message
tests/Makefile.am +1 -1
@@ -13,7 +13,7 @@ check_PROGRAMS = \ SUBDIRS = modeprint if HAVE_LIBKMS -SUBDIRS += kmstest modetest +SUBDIRS += kmstest modetest g2dtest endif if HAVE_RADEON
tests/g2dtest/Makefile.am new file +16 -0
@@ -0,0 +1,16 @@ +AM_CFLAGS = \ + -I$(top_srcdir)/include/drm \ + -I$(top_srcdir)/libkms/ \ + -I$(top_srcdir) \ + $(CAIRO_CFLAGS) + +noinst_PROGRAMS = \ + g2dtest + +g2dtest_SOURCES = \ + g2dtest.c + +g2dtest_LDADD = \ + $(top_builddir)/libdrm.la \ + $(top_builddir)/libkms/libkms.la \ + $(CAIRO_LIBS)
tests/g2dtest/g2d.h new file +64 -0
64 lines not on this page · raw message
tests/g2dtest/g2d_reg.h new file +108 -0
108 lines not on this page · raw message
tests/g2dtest/g2dtest.c new file +612 -0
612 lines not on this page · raw message
Signature · 1 line
1.7.5.4
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 09/10] drm/exynos: add G2D driver
I don't suppose you could send a libdrm patch to the list with an up to date version of the g2dtest code so we can get it in libdrm tree?
BR,
-R
Quoted 46 lines · Joonyoung Shim
Quoted 8 lines · Dave Airlie
Quoted 5 lines
G2D is a 2D graphic accelerator that supports Bit Block Transfer. This G2D driver is exynos drm specific and supports only exynos4x12 series. user application fills command set in cmdlist and once dma start request these cmdlists are parsed and performed by dma.
Where is this block documented or a pointer to the corresponding open userspace user code?
I attach simple g2dtest program patch. The base of this patch is master branch of lastest libdrm git.
This user progrem can test just solid color fill example. I will cleanup and update it for more operations later.
Thanks.
Quoted 13 lines
Again the ioctls look like they need to be depointered and use
__u64.It would be nice if you could document how the command stream and engine work.
How does userspace pass addresses to it? straight or via gem objects? how does it
stop userspace blt to places it shouldn't etc.I'm getting the feeling this accel enabled driver needs a lot more of a commit message
and lot more documentation on what it can be used for.Quoted 6 lines
Dave.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Inki Dae
maintainerRe: [PATCH 09/10] drm/exynos: add G2D driver
2013/1/21 Rob Clark <[email protected]>:
Quoted 3 lines
I don't suppose you could send a libdrm patch to the list with an up to date version of the g2dtest code so we can get it in libdrm tree?
We are planning on updating exynos drm for libdrm. At that time, the up to date version of the g2dtest will be posted. Joonyoung, let it post. And I will post other things except g2dtest.
Thanks,
Inki Dae
Quoted 54 lines
BR,
-RQuoted 41 lines · Joonyoung Shim
Quoted 8 lines · Dave Airlie
Quoted 5 lines
G2D is a 2D graphic accelerator that supports Bit Block Transfer. This G2D driver is exynos drm specific and supports only exynos4x12 series. user application fills command set in cmdlist and once dma start request these cmdlists are parsed and performed by dma.
Where is this block documented or a pointer to the corresponding open userspace user code?
I attach simple g2dtest program patch. The base of this patch is master branch of lastest libdrm git.
This user progrem can test just solid color fill example. I will cleanup and update it for more operations later.
Thanks.
Quoted 13 lines
Again the ioctls look like they need to be depointered and use
__u64.It would be nice if you could document how the command stream and engine work.
How does userspace pass addresses to it? straight or via gem objects? how does it
stop userspace blt to places it shouldn't etc.I'm getting the feeling this accel enabled driver needs a lot more of a commit message
and lot more documentation on what it can be used for.Quoted 6 lines
Dave.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-develQuoted 5 lines
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 09/10] drm/exynos: add G2D driver
Quoted 8 lines · Inki Dae
2013/1/21 Rob Clark <[email protected]>:
Quoted 3 lines
I don't suppose you could send a libdrm patch to the list with an up to date version of the g2dtest code so we can get it in libdrm tree?
We are planning on updating exynos drm for libdrm. At that time, the up to date version of the g2dtest will be posted. Joonyoung, let it post. And I will post other things except g2dtest.
thanks, I just want to make sure this doesn't get lost
BR,
-R
Quoted 57 lines
Thanks,
Inki DaeQuoted 54 lines
BR,
-RQuoted 41 lines · Joonyoung Shim
Quoted 8 lines · Dave Airlie
Quoted 5 lines
G2D is a 2D graphic accelerator that supports Bit Block Transfer. This G2D driver is exynos drm specific and supports only exynos4x12 series. user application fills command set in cmdlist and once dma start request these cmdlists are parsed and performed by dma.
Where is this block documented or a pointer to the corresponding open userspace user code?
I attach simple g2dtest program patch. The base of this patch is master branch of lastest libdrm git.
This user progrem can test just solid color fill example. I will cleanup and update it for more operations later.
Thanks.
Quoted 13 lines
Again the ioctls look like they need to be depointered and use
__u64.It would be nice if you could document how the command stream and engine work.
How does userspace pass addresses to it? straight or via gem objects? how does it
stop userspace blt to places it shouldn't etc.I'm getting the feeling this accel enabled driver needs a lot more of a commit message
and lot more documentation on what it can be used for.Quoted 6 lines
Dave.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-develQuoted 5 lines
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Inki Dae
maintainerPATCH 10/10 drm/exynos: added virtual display driver.
In reply to Inki Daethis driver would be used for wireless display. virtual display driver has independent crtc, encoder and connector and to use this driver, user application should send edid data to this driver from wireless display.
--- drivers/gpu/drm/exynos/Kconfig | 6 + drivers/gpu/drm/exynos/Makefile | 1 + drivers/gpu/drm/exynos/exynos_drm_connector.c | 4 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 18 + drivers/gpu/drm/exynos/exynos_drm_drv.h | 7 +- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 1 + drivers/gpu/drm/exynos/exynos_drm_vidi.c | 677 +++++++++++++++++++++++++ drivers/gpu/drm/exynos/exynos_drm_vidi.h | 36 ++ include/drm/exynos_drm.h | 20 + 9 files changed, 768 insertions(+), 2 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_vidi.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_vidi.h
drivers/gpu/drm/exynos/Kconfig +6 -0
@@ -22,6 +22,12 @@ config DRM_EXYNOS_HDMI help Choose this option if you want to use Exynos HDMI for DRM. +config DRM_EXYNOS_VIDI + bool "Samsung DRM Virtual Display" + depends on DRM_EXYNOS + help + Choose this option if you want to use Samsung VIDI for DRM. + config DRM_EXYNOS_G2D bool "Exynos DRM G2D" depends on DRM_EXYNOS
drivers/gpu/drm/exynos/Makefile +1 -0
@@ -12,6 +12,7 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD) += exynos_drm_fimd.o exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI) += exynos_hdmi.o exynos_mixer.o \ exynos_ddc.o exynos_hdmiphy.o \ exynos_drm_hdmi.o +exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI) += exynos_drm_vidi.o exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o
drivers/gpu/drm/exynos/exynos_drm_connector.c +4 -0
@@ -315,6 +315,10 @@ struct drm_connector *exynos_drm_connector_create(struct drm_device *dev, connector->interlace_allowed = true; connector->polled =DRM_CONNECTOR_POLL_HPD ;break ; +case EXYNOS_DISPLAY_TYPE_VIDI : + type =DRM_MODE_CONNECTOR_VIRTUAL ; + connector->polled =DRM_CONNECTOR_POLL_HPD ; +break ;default : type = DRM_MODE_CONNECTOR_Unknown;break ;
drivers/gpu/drm/exynos/exynos_drm_drv.c +18 -0
@@ -39,6 +39,7 @@#include "exynos_drm_gem.h" #include "exynos_drm_g2d.h" #include "exynos_drm_plane.h" +#include "exynos_drm_vidi.h" #define DRIVER_NAME "exynos"#define DRIVER_DESC "Samsung SoC DRM"
@@ -217,6 +218,8 @@ static struct drm_ioctl_desc exynos_ioctls[] = { exynos_drm_gem_mmap_ioctl, DRM_UNLOCKED | DRM_AUTH),DRM_IOCTL_DEF_DRV (EXYNOS_PLANE_SET_ZPOS , exynos_plane_set_zpos_ioctl,DRM_UNLOCKED |DRM_AUTH ), +DRM_IOCTL_DEF_DRV (EXYNOS_VIDI_CONNECTION , + vidi_connection_ioctl,DRM_UNLOCKED |DRM_AUTH ),DRM_IOCTL_DEF_DRV (EXYNOS_G2D_GET_VER , exynos_g2d_get_ver_ioctl, DRM_UNLOCKED | DRM_AUTH),
@@ -314,6 +317,12 @@ static int __init exynos_drm_init(void) goto out_common_hdmi;#endif +#ifdef CONFIG_DRM_EXYNOS_VIDI + ret =platform_driver_register (&vidi_driver); +if (ret <0 ) + goto out_vidi; +#endif +#ifdef CONFIG_DRM_EXYNOS_G2D ret =platform_driver_register (&g2d_driver);if (ret <0 )
@@ -332,6 +341,11 @@ out: out_g2d:#endif +#ifdef CONFIG_DRM_EXYNOS_VIDI +platform_driver_unregister (&vidi_driver); +out_vidi: +#endif +#ifdef CONFIG_DRM_EXYNOS_HDMI platform_driver_unregister (&exynos_drm_common_hdmi_driver); out_common_hdmi:
@@ -358,6 +372,10 @@ static void __exit exynos_drm_exit(void)platform_driver_unregister (&g2d_driver);#endif +#ifdef CONFIG_DRM_EXYNOS_VIDI +platform_driver_unregister (&vidi_driver); +#endif +#ifdef CONFIG_DRM_EXYNOS_HDMI platform_driver_unregister (&exynos_drm_common_hdmi_driver);platform_driver_unregister (&mixer_driver);
drivers/gpu/drm/exynos/exynos_drm_drv.h +5 -2
@@ -32,9 +32,9 @@#include <linux/module.h> #include "drm.h" -#define MAX_CRTC 2 +#define MAX_CRTC 3#define MAX_PLANE 5 -#define MAX_FB_BUFFER 3 +#define MAX_FB_BUFFER 4#define DEFAULT_ZPOS -1struct drm_device ;
@@ -50,6 +50,8 @@ enum exynos_drm_output_type {EXYNOS_DISPLAY_TYPE_LCD ,/* HDMI Interface. */ EXYNOS_DISPLAY_TYPE_HDMI , +/* Virtual Display Interface. */ + EXYNOS_DISPLAY_TYPE_VIDI, };/*
@@ -294,5 +296,6 @@ extern struct platform_driver fimd_driver;extern struct platform_driver hdmi_driver;extern struct platform_driver mixer_driver;extern struct platform_driver exynos_drm_common_hdmi_driver; +extern struct platform_driver vidi_driver;extern struct platform_driver g2d_driver;#endif
drivers/gpu/drm/exynos/exynos_drm_encoder.c +1 -0
@@ -218,6 +218,7 @@ static unsigned int exynos_drm_encoder_clones(struct drm_encoder *encoder)switch (display_ops->type) {case EXYNOS_DISPLAY_TYPE_LCD :case EXYNOS_DISPLAY_TYPE_HDMI : +case EXYNOS_DISPLAY_TYPE_VIDI : clone_mask |= (1 << (cnt++));break ;default :
drivers/gpu/drm/exynos/exynos_drm_vidi.c new file +677 -0
677 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_drm_vidi.h new file +36 -0
@@ -0,0 +1,36 @@ +/* exynos_drm_vidi.h +* +* Copyright (c) 2012 Samsung Electronics Co., Ltd. +* Author: Inki Dae <[email protected]> +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice (including the next +* paragraph) shall be included in all copies or substantial portions of the +* Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef _EXYNOS_DRM_VIDI_H_ +#define _EXYNOS_DRM_VIDI_H_ + +#ifdef CONFIG_DRM_EXYNOS_VIDI +int vidi_connection_ioctl (struct drm_device *drm_dev,void *data, +struct drm_file *file_priv); +#else +#define vidi_connection_ioctl NULL +#endif + +#endif
include/drm/exynos_drm.h +20 -0
@@ -76,6 +76,22 @@ struct drm_exynos_gem_mmap {uint64_t mapped; }; +/** +* A structure for user connection request of virtual display. +* +* @connection: indicate whether doing connetion or not by user. +* @extensions: if this value is 1 then the vidi driver would need additional +* 128bytes edid data. +* @pad: just padding to be 64-bit aligned. +* @edid: the edid data pointer from user side. +*/ +struct drm_exynos_vidi_connection { +unsigned int connection; +unsigned int extensions; +unsigned int pad; +void *edid; +}; +struct drm_exynos_plane_set_zpos {__u32 plane_id;__s32 zpos;
@@ -123,6 +139,7 @@ struct drm_exynos_g2d_exec {#define DRM_EXYNOS_GEM_MMAP 0x02/* Reserved 0x03 ~ 0x05 for exynos specific gem ioctl */ #define DRM_EXYNOS_PLANE_SET_ZPOS 0x06 +#define DRM_EXYNOS_VIDI_CONNECTION 0x07/* G2D */ #define DRM_EXYNOS_G2D_GET_VER 0x20
@@ -141,6 +158,9 @@ struct drm_exynos_g2d_exec {#define DRM_IOCTL_EXYNOS_PLANE_SET_ZPOS DRM_IOWR(DRM_COMMAND_BASE + \ DRM_EXYNOS_PLANE_SET_ZPOS, struct drm_exynos_plane_set_zpos) +#define DRM_IOCTL_EXYNOS_VIDI_CONNECTION DRM_IOWR(DRM_COMMAND_BASE + \ + DRM_EXYNOS_VIDI_CONNECTION, struct drm_exynos_vidi_connection) +#define DRM_IOCTL_EXYNOS_G2D_GET_VER DRM_IOWR(DRM_COMMAND_BASE + \ DRM_EXYNOS_G2D_GET_VER, struct drm_exynos_g2d_get_ver)#define DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST DRM_IOWR(DRM_COMMAND_BASE + \
Signature · 1 line
1.7.4.1
Dave Airlie
maintainerRe: [PATCH 10/10] drm/exynos: added virtual display driver.
Quoted 14 lines
include/drm/exynos_drm.h +6
-0@@ -76,6 +76,22 @@ struct drm_exynos_gem_mmap { uint64_t mapped; }; +/** +* A structure for user connection request of virtual display. +* +* @connection: indicate whether doing connetion or not by user. +* @extensions: if this value is 1 then the vidi driver would need additional +* 128bytes edid data.
include/drm/exynos_drm.h struct drm_exynos_gem_mmap { · line 94
Quoted 10 lines
include/drm/exynos_drm.h +10
-0+* @pad: just padding to be 64-bit aligned. +* @edid: the edid data pointer from user side. +*/ +struct drm_exynos_vidi_connection { + unsigned int connection; + unsigned int extensions; + unsigned int pad; + void *edid; +}; +
No void * in ioctl structs use u64, also not sure why you have a 32-bit pad since you probably want it padded to 64-bit.
Dave.
Inki Dae
maintainerRE: [PATCH 10/10] drm/exynos: added virtual display driver.
Quoted 39 lines
-----Original Message-----
From: Dave Airlie [mailto:[email protected]]
Sent: Thursday, March 15, 2012 7:44 PM
To: Inki Dae
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 10/10] drm/exynos: added virtual display driver.include/drm/exynos_drm.h struct drm_exynos_gem_mmap { · line 83
Quoted 13 lines
include/drm/exynos_drm.h +5
-0@@ -76,6 +76,22 @@ struct drm_exynos_gem_mmap { uint64_t mapped; }; +/** +* A structure for user connection request of virtual display. +* +* @connection: indicate whether doing connetion or not by user. +* @extensions: if this value is 1 then the vidi driver would need additional
include/drm/exynos_drm.h struct drm_exynos_gem_mmap { · line 94
Quoted 11 lines
include/drm/exynos_drm.h +11
-0+* 128bytes edid data. +* @pad: just padding to be 64-bit aligned. +* @edid: the edid data pointer from user side. +*/ +struct drm_exynos_vidi_connection { + unsigned int connection; + unsigned int extensions; + unsigned int pad; + void *edid; +}; +No void * in ioctl structs use u64, also not sure why you have a 32-bit pad since you probably want it padded to 64-bit.
Quoted 1 line
Dave.
Yes, right. I wanted it to be padded to 64-bit. and edid would point to buffer containing edit data and it would be passed from user to kernel side so for this, is it right to use u64? I will change variable type to "void __user *" if your missing point. please let me know if there is any problem.
Thanks,
Inki Dae
Re: [PATCH 10/10] drm/exynos: added virtual display driver.
----- Original Message -----
Quoted 50 lines
From: "Inki Dae" <[email protected]>
To: "Dave Airlie" <[email protected]>
Cc: "kyungmin park" <[email protected]>, "sw0312 kim" <[email protected]>, [email protected]
Sent: Thursday, 15 March, 2012 11:36:14 AM
Subject: RE: [PATCH 10/10] drm/exynos: added virtual display driver.Quoted 39 lines
-----Original Message-----
From: Dave Airlie [mailto:[email protected]]
Sent: Thursday, March 15, 2012 7:44 PM
To: Inki Dae
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 10/10] drm/exynos: added virtual display driver.Quoted 13 lines
include/drm/exynos_drm.h +5
-0@@ -76,6 +76,22 @@ struct drm_exynos_gem_mmap { uint64_t mapped; }; +/** +* A structure for user connection request of virtual display. +* +* @connection: indicate whether doing connetion or not by user. +* @extensions: if this value is 1 then the vidi driver would Quoted 1 line
need
additional
include/drm/exynos_drm.h struct drm_exynos_gem_mmap { · line 94
Quoted 11 lines
+ * 128bytes edid data.
+ * @pad: just padding to be 64-bit aligned.
+ * @edid: the edid data pointer from user side.
+ */include/drm/exynos_drm.h +7
-0+struct drm_exynos_vidi_connection { + unsigned int connection; + unsigned int extensions; + unsigned int pad; + void *edid; +}; +No void * in ioctl structs use u64, also not sure why you have a 32-bit pad since you probably want it padded to 64-bit.
Quoted 1 line
Dave.
Quoted 9 lines
Yes, right. I wanted it to be padded to 64-bit. and edid would point to
buffer containing edit data and it would be passed from user to kernel side
so for this, is it right to use u64? I will change variable type to "void__user*" if your missing point. please let me know if there is any problem.
You need to use __u64 instead of a void, since void * isn't a fixed length across 32/64-bit.
You'll notice this done a few places in the drm kms interfaces.
Dave.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Inki Dae
maintainerRE: [PATCH 10/10] drm/exynos: added virtual display driver.
Quoted 74 lines
-----Original Message-----
From: David Airlie [mailto:[email protected]]
Sent: Thursday, March 15, 2012 8:44 PM
To: Inki Dae
Cc: kyungmin park; sw0312 kim; [email protected]; Dave Airlie
Subject: Re: [PATCH 10/10] drm/exynos: added virtual display driver.----- Original Message -----
Quoted 3 lines
From: "Inki Dae" <[email protected]>
To: "Dave Airlie" <[email protected]>
Cc: "kyungmin park" <[email protected]>, "sw0312 kim"Quoted 47 lines
[email protected]
Sent: Thursday, 15 March, 2012 11:36:14 AM
Subject: RE: [PATCH 10/10] drm/exynos: added virtual display driver.Quoted 39 lines
-----Original Message-----
From: Dave Airlie [mailto:[email protected]]
Sent: Thursday, March 15, 2012 7:44 PM
To: Inki Dae
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 10/10] drm/exynos: added virtual display driver.Quoted 13 lines
include/drm/exynos_drm.h +5
-0@@ -76,6 +76,22 @@ struct drm_exynos_gem_mmap {uint64_t mapped; }; +/** +* A structure for user connection request of virtual display. +* +* @connection: indicate whether doing connetion or not by user. +* @extensions: if this value is 1 then the vidi driver would Quoted 1 line
need
additional
include/drm/exynos_drm.h struct drm_exynos_gem_mmap { · line 94
Quoted 11 lines
+ * 128bytes edid data.
+ * @pad: just padding to be 64-bit aligned.
+ * @edid: the edid data pointer from user side.
+ */include/drm/exynos_drm.h +7
-0+struct drm_exynos_vidi_connection { +unsigned int connection; +unsigned int extensions; +unsigned int pad; +void *edid; +}; +No void * in ioctl structs use u64, also not sure why you have a 32-bit pad since you probably want it padded to 64-bit.
Quoted 1 line
Dave.
Quoted 9 lines
Yes, right. I wanted it to be padded to 64-bit. and edid would point to
buffer containing edit data and it would be passed from user to kernel side
so for this, is it right to use u64? I will change variable type to "void__user*" if your missing point. please let me know if there is any problem.
Quoted 6 lines
You need to use
__u64instead of a void, since void * isn't a fixed length across 32/64-bit.You'll notice this done a few places in the drm kms interfaces.
Dave.
Ok, got it. thanks for your comment.
Inki Dae