updated exynos-drm-next.
Subsystems (3)
Inki Dae
maintainerv2 cover updated exynos-drm-next.
Hi, Dave and all.
this update adds new features below:
- add HDMI version 1.4 and Audio support.
- add mode_fixup feature.
. hdmi module would change current mode to driver desired mode properly.
- updated gem and buffer framework.
. 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.
Links to previous versions of the patchset:
v1: < http://permalink.gmane.org/gmane.comp.video.dri.devel/66247 >
Changelog v2:
- add HDMI Audio support.
- add descriptions for direct rendering based g2d driver and user application for it.
. for user application, you can refer to this link below:
http://www.spinics.net/lists/dri-devel/msg20014.html
- fix variable type Dave pointed out.
. use __u64 __user * instead of void *
- code clean to exynos gem and buffer framework.
- add default pixel format for plane.
this patch set is based on git repository below:
git://people.freedesktop.org/~airlied/linux.git drm-core-next commit-id: 8229c885fe361e521ac64de36b16011e54a30de0
and you can refer to our working git repository below:
git://git.infradead.org/users/kmpark/linux-samsung exynos-drm-next
Thanks.
Eunchul Kim (1):
drm/exynos: add default pixel format for plane
Inki Dae (4):
drm/exynos: added mode_fixup feature and code clean. drm/exynos: update gem and buffer framework. drm/exynos: added new funtion to get/put dma address. drm/exynos: added virtual display driver.
Joonyoung Shim (8):
drm/exynos: add HDMI version 1.4 support 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
drm/exynos: remove exynos_mixer.h
drm/exynos: cleanup exynos_hdmi.h
Seung-Woo Kim (1):
drm/exynos: enable hdmi audio feature
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 | 191 +++- drivers/gpu/drm/exynos/exynos_drm_buf.h | 22 +- 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 | 51 +- 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 | 885 +++++++++++++++ drivers/gpu/drm/exynos/exynos_drm_g2d.h | 36 + drivers/gpu/drm/exynos/exynos_drm_gem.c | 363 ++++++- 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_plane.c | 8 +- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 676 ++++++++++++ drivers/gpu/drm/exynos/exynos_drm_vidi.h | 36 + drivers/gpu/drm/exynos/exynos_hdmi.c | 1437 +++++++++++++++++++++++-- drivers/gpu/drm/exynos/exynos_hdmi.h | 50 - drivers/gpu/drm/exynos/exynos_mixer.c | 57 +- drivers/gpu/drm/exynos/exynos_mixer.h | 92 -- drivers/gpu/drm/exynos/regs-hdmi.h | 488 ++++++++- include/drm/exynos_drm.h | 83 ++ 29 files changed, 4394 insertions(+), 715 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 delete mode 100644 drivers/gpu/drm/exynos/exynos_mixer.h
Signature · 1 line
1.7.4.1
Inki Dae
maintainerPATCH v2 1/14 drm/exynos: add HDMI version 1.4 support
From: Joonyoung Shim <[email protected]>
Later Exynos series from Exynos4X12 support HDMI version 1.4. We will distinguish to use which version via platform data. This patch supports only default features of HDMI version 1.4(The 3D, sound and etc don't support yet)
--- 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 v2 2/14 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
Inki Dae
maintainerPATCH v2 3/14 drm/exynos: update gem and buffer framework.
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 | 191 +++++++++++++++---- drivers/gpu/drm/exynos/exynos_drm_buf.h | 22 ++- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 4 +- drivers/gpu/drm/exynos/exynos_drm_gem.c | 301 ++++++++++++++++++++++++++--- drivers/gpu/drm/exynos/exynos_drm_gem.h | 11 +- include/drm/exynos_drm.h | 6 + 6 files changed, 463 insertions(+), 72 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_buf.c +156 -35
@@ -25,45 +25,161 @@#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) { +dma_addr_t start_addr, end_addr; +unsigned int npages, page_size, i =0 ; +struct scatterlist *sgl; +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" ); +if (flags &EXYNOS_BO_NONCONTIG ) { +DRM_DEBUG_KMS ("not support allocation type.\n" ); +return -EINVAL ; + } + +if (buf->dma_addr) { +DRM_DEBUG_KMS ("already allocated.\n" ); +return 0 ; + } + +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 ; } -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); + 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 ; + } -return 0 ; + 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; + } + + 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 )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 ) { +DRM_DEBUG_KMS ("not support allocation type.\n" ); +return ; + } + +if (!buf->dma_addr) { +DRM_DEBUG_KMS ("dma_addr is invalid.\n" ); +return ; + } + +DRM_DEBUG_KMS ("vaddr(0x%lx), dma_addr(0x%lx), size(0x%lx)\n" , + (unsigned long )buf->kvaddr, + (unsigned long )buf->dma_addr, + buf->size); + +sg_free_table (buf->sgt); + +kfree (buf->sgt); + buf->sgt =NULL ; + +kfree (buf->pages); + buf->pages =NULL ; + +dma_free_writecombine (dev->dev, buf->size, buf->kvaddr, + (dma_addr_t )buf->dma_addr); + buf->dma_addr = (dma_addr_t )NULL ; } -struct exynos_drm_gem_buf *exynos_drm_buf_create (struct drm_device *dev, -unsigned int size) +struct exynos_drm_gem_buf *exynos_drm_init_buf (struct drm_device *dev, +unsigned int size) {struct exynos_drm_gem_buf *buffer;
@@ -77,21 +193,11 @@ struct exynos_drm_gem_buf *exynos_drm_buf_create(struct drm_device *dev, } buffer->size = size; - -/* -* 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 ) { -kfree (buffer); -return NULL ; - } -return buffer; } -void exynos_drm_buf_destroy (struct drm_device *dev, -struct exynos_drm_gem_buf *buffer) +void exynos_drm_fini_buf (struct drm_device *dev, +struct exynos_drm_gem_buf *buffer) {DRM_DEBUG_KMS ("%s.\n" , __FILE__);
@@ -100,12 +206,27 @@ void exynos_drm_buf_destroy(struct drm_device *dev,return ; } -lowlevel_buffer_deallocate (dev, buffer); -kfree (buffer); buffer =NULL ; } -MODULE_AUTHOR ("Inki Dae <[email protected]>" ); -MODULE_DESCRIPTION ("Samsung SoC DRM Buffer Management Module" ); -MODULE_LICENSE ("GPL" ); +int exynos_drm_alloc_buf (struct drm_device *dev, +struct exynos_drm_gem_buf *buf,unsigned int flags) +{ + +/* +* allocate memory region and set the memory information +* to vaddr and dma_addr of a buffer object. +*/ +if (lowlevel_buffer_allocate (dev, flags, buf) <0 ) +return -ENOMEM ; + +return 0 ; +} + +void exynos_drm_free_buf (struct drm_device *dev, +unsigned int flags,struct exynos_drm_gem_buf *buffer) +{ + +lowlevel_buffer_deallocate (dev, flags, buffer); +}
drivers/gpu/drm/exynos/exynos_drm_buf.h +16 -6
@@ -26,12 +26,22 @@#ifndef _EXYNOS_DRM_BUF_H_#define _EXYNOS_DRM_BUF_H_ -/* allocate physical memory. */ -struct exynos_drm_gem_buf *exynos_drm_buf_create (struct drm_device *dev, -unsigned int size); +/* create and initialize buffer object. */ +struct exynos_drm_gem_buf *exynos_drm_init_buf (struct drm_device *dev, +unsigned int size); -/* remove allocated physical memory. */ -void exynos_drm_buf_destroy (struct drm_device *dev, -struct exynos_drm_gem_buf *buffer); +/* destroy buffer object. */ +void exynos_drm_fini_buf (struct drm_device *dev, +struct exynos_drm_gem_buf *buffer); + +/* allocate physical memory region and setup sgt and pages. */ +int exynos_drm_alloc_buf (struct drm_device *dev, +struct exynos_drm_gem_buf *buf, +unsigned int flags); + +/* release physical memory region, sgt and pages. */ +void exynos_drm_free_buf (struct drm_device *dev, +unsigned int flags, +struct exynos_drm_gem_buf *buffer);#endif
drivers/gpu/drm/exynos/exynos_drm_fbdev.c +3 -1
@@ -125,7 +125,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 +272 -29
398 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 v2 4/14 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
@@ -386,6 +386,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 v2 5/14 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 v2 6/14 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_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 -- 16 files changed, 77 insertions(+), 355 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_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
@@ -1012,7 +1012,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 = {
@@ -1021,21 +1021,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
@@ -735,7 +735,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 v2 7/14 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 v2 8/14 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 v2 9/14 drm/exynos: add G2D driver
In reply to Inki DaeFrom: Joonyoung Shim <[email protected]>
The G2D is a 2D graphic accelerator that supports Bit Block Transfer. This G2D driver is exynos drm specific and supports only G2D(version 4.1) of later Exynos series from Exynos4X12 because supporting DMA.
The G2D is performed by two tasks simply.
1. Configures the rendering parameters, such as foreground color and coordinates data by setting the drawing context registers.
2. Start the rendering process by setting thre relevant command registers accordingly.
The G2D version 4.1 supports DMA mode as host interface. User can make command list to reduce HOST(ARM) loads. The contents of The command list is setted to relevant registers of G2D by DMA.
The command list is composed Header and command sets and Tail.
- Header: The number of command set(4Bytes)
- Command set: Register offset(4Bytes) + Register data(4Bytes)
- Tail: Pointer of base address of the other command list(4Bytes)
By Tail field, the G2D can process many command lists without halt at one go.
The G2D has following the rendering pipeline.
--> Primitive Drawing --> Rotation --> Clipping --> Bilinear Sampling --> Color Key --> ROP --> Mask Operation --> Alpha Blending --> Dithering --> FrameBuffer
And supports various operations from the rendering pipeline.
- copy
- fast solid color fill
- window clipping
- rotation
- flip
- 4 operand raster operation(ROP4)
- masking operation
- alpha blending
- color key
- dithering
- etc
User should make the command list to data and registers needed by operation to use. The Exynos G2D driver only manages the command lists received from user. Some registers needs memory base address(physical address) of image. User doesn't know its physical address, so fills the gem handle of that memory than address to command sets, then G2D driver converts it to memory base address.
We adds three ioctls and one event for Exynos G2D.
- ioctlsDRM_EXYNOS_G2D_GET_VER: get the G2D hardware version DRM_EXYNOS_G2D_SET_CMDLIST: set the command list from user to driverDRM_EXYNOS_G2D_EXEC: execute the command lists setted to driver
- eventDRM_EXYNOS_G2D_EVENT: event to give notification completion of the
command list to user
--- 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 | 57 ++ 7 files changed, 1029 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 +57 -0
81 lines not on this page · raw message
Signature · 1 line
1.7.4.1
Inki Dae
maintainerPATCH v2 12/14 drm/exynos: cleanup exynos_hdmi.h
In reply to Inki DaeFrom: Joonyoung Shim <[email protected]>
The some contents of the exynos_hdmi.h are used only in exynos_hdmi.c, so move them to exynos_hdmi.c.
--- drivers/gpu/drm/exynos/exynos_hdmi.c | 36 ++++++++++++++++++++++++++++ drivers/gpu/drm/exynos/exynos_hdmi.h | 42 --------------------------------- drivers/gpu/drm/exynos/exynos_mixer.c | 1 - 3 files changed, 36 insertions(+), 43 deletions(-)
drivers/gpu/drm/exynos/exynos_hdmi.c +36 -0
@@ -45,6 +45,42 @@#define MAX_HEIGHT 1080#define get_hdmi_context (dev) platform_get_drvdata(to_platform_device(dev)) +struct hdmi_resources { +struct clk *hdmi; +struct clk *sclk_hdmi; +struct clk *sclk_pixel; +struct clk *sclk_hdmiphy; +struct clk *hdmiphy; +struct regulator_bulk_data *regul_bulk; +int regul_count; +}; + +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; +bool enabled; + +struct resource *regs_res; +void __iomem *regs; +unsigned int irq; +struct workqueue_struct *wq; +struct work_struct hotplug_work; + +struct i2c_client *ddc_port; +struct i2c_client *hdmiphy_port; + +/* current hdmiphy conf index */ +int cur_conf; + +struct hdmi_resources res; +void *parent_ctx; +}; +/* HDMI Version 1.3 */ static const u8 hdmiphy_v13_conf27[32 ] = {0x01 ,0x05 ,0x00 ,0xD8 ,0x10 ,0x1C ,0x30 ,0x40 ,
drivers/gpu/drm/exynos/exynos_hdmi.h +0 -42
48 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_mixer.c +0 -1
@@ -36,7 +36,6 @@#include "exynos_drm_drv.h" #include "exynos_drm_hdmi.h" -#include "exynos_hdmi.h" #define HDMI_OVERLAY_NUMBER 3
Signature · 1 line
1.7.4.1
Inki Dae
maintainerPATCH v2 10/14 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 | 676 +++++++++++++++++++++++++ drivers/gpu/drm/exynos/exynos_drm_vidi.h | 36 ++ include/drm/exynos_drm.h | 18 + 9 files changed, 765 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
@@ -27,3 +27,9 @@ config DRM_EXYNOS_G2D depends on DRM_EXYNOS help Choose this option if you want to use Exynos G2D for DRM. + +config DRM_EXYNOS_VIDI + bool "Exynos DRM Virtual Display" + depends on DRM_EXYNOS + help + Choose this option if you want to use Exynos VIDI for DRM.
drivers/gpu/drm/exynos/Makefile +1 -0
@@ -13,5 +13,6 @@ 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 +exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI) += exynos_drm_vidi.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, };/*
@@ -296,5 +298,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 +676 -0
676 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 +18 -0
@@ -76,6 +76,20 @@ 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. +* @edid: the edid data pointer from user side. +*/ +struct drm_exynos_vidi_connection { +unsigned int connection; +unsigned int extensions; +__u64 __user *edid; +}; +struct drm_exynos_plane_set_zpos {__u32 plane_id;__s32 zpos;
@@ -123,6 +137,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 +156,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
Inki Dae
maintainerPATCH v2 11/14 drm/exynos: remove exynos_mixer.h
In reply to Inki DaeFrom: Joonyoung Shim <[email protected]>
The contents of exynos_mixer.h are used only in exynos_mixer.c, so separated header is unnecessary.
--- drivers/gpu/drm/exynos/exynos_mixer.c | 49 +++++++++++++++++- drivers/gpu/drm/exynos/exynos_mixer.h | 92 --------------------------------- 2 files changed, 48 insertions(+), 93 deletions(-) delete mode 100644 drivers/gpu/drm/exynos/exynos_mixer.h
drivers/gpu/drm/exynos/exynos_mixer.c +48 -1
@@ -37,10 +37,57 @@#include "exynos_drm_drv.h" #include "exynos_drm_hdmi.h" #include "exynos_hdmi.h" -#include "exynos_mixer.h" + +#define HDMI_OVERLAY_NUMBER 3#define get_mixer_context (dev) platform_get_drvdata(to_platform_device(dev)) +struct hdmi_win_data { +dma_addr_t dma_addr; +void __iomem *vaddr; +dma_addr_t chroma_dma_addr; +void __iomem *chroma_vaddr; +uint32_t pixel_format; +unsigned int bpp; +unsigned int crtc_x; +unsigned int crtc_y; +unsigned int crtc_width; +unsigned int crtc_height; +unsigned int fb_x; +unsigned int fb_y; +unsigned int fb_width; +unsigned int fb_height; +unsigned int mode_width; +unsigned int mode_height; +unsigned int scan_flags; +}; + +struct mixer_resources { +struct device *dev; +int irq; +void __iomem *mixer_regs; +void __iomem *vp_regs; +spinlock_t reg_slock; +struct clk *mixer; +struct clk *vp; +struct clk *sclk_mixer; +struct clk *sclk_hdmi; +struct clk *sclk_dac; +}; + +struct mixer_context { +struct fb_videomode *default_timing; +unsigned int default_win; +unsigned int default_bpp; +unsigned int irq; +int pipe; +bool interlace; +bool vp_enabled; + +struct mixer_resources mixer_res; +struct hdmi_win_data win_data[HDMI_OVERLAY_NUMBER ]; +}; +static const u8 filter_y_horiz_tap8[] = {0 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1 ,0 ,0 ,0 ,
drivers/gpu/drm/exynos/exynos_mixer.h deleted +0 -92
92 lines not on this page · raw message
Signature · 1 line
1.7.4.1
Inki Dae
maintainerPATCH v2 13/14 drm/exynos: add default pixel format for plane
In reply to Inki DaeFrom: Eunchul Kim <[email protected]>
DRM checks whether the plane supports a pixel format of fb when plane is updated. This adds a default pixel format supporting format exynos drm plane.
--- drivers/gpu/drm/exynos/exynos_drm_plane.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_plane.c +6 -2
@@ -22,6 +22,10 @@ struct exynos_plane {bool enabled; }; +static const uint32_t formats[] = { +DRM_FORMAT_XRGB8888 , +}; + static int exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, struct drm_framebuffer *fb, int crtc_x, int crtc_y,
@@ -115,9 +119,9 @@ int exynos_plane_init(struct drm_device *dev, unsigned int nr) exynos_plane->overlay.zpos =DEFAULT_ZPOS ; -/* TODO: format */ return drm_plane_init (dev, &exynos_plane->base, possible_crtcs, - &exynos_plane_funcs,NULL ,0 , false); + &exynos_plane_funcs, formats,ARRAY_SIZE (formats), + false); } int exynos_plane_set_zpos_ioctl(struct drm_device *dev, void *data,
Signature · 1 line
1.7.4.1
Inki Dae
maintainerPATCH v2 14/14 drm/exynos: enable hdmi audio feature
In reply to Inki DaeFrom: Seung-Woo Kim <[email protected]>
This patch adds hdmi audio feature for exynos drm.
With this patch, i2s channel feeds audio data in hdmi when hdmi is connected.
--- drivers/gpu/drm/exynos/exynos_hdmi.c | 167 +++++++++++++++++++++++++++++++ drivers/gpu/drm/exynos/regs-hdmi.h | 182 ++++++++++++++++++++++++++++++++++ 2 files changed, 349 insertions(+), 0 deletions(-)
drivers/gpu/drm/exynos/exynos_hdmi.c +167 -0
@@ -1319,6 +1319,169 @@ static struct exynos_hdmi_display_ops display_ops = { .power_on = hdmi_display_power_on, }; +static void hdmi_set_acr (u32 freq,u8 *acr) +{ +u32 n, cts; + +switch (freq) { +case 32000 : + n =4096 ; + cts =27000 ; +break ; +case 44100 : + n =6272 ; + cts =30000 ; +break ; +case 88200 : + n =12544 ; + cts =30000 ; +break ; +case 176400 : + n =25088 ; + cts =30000 ; +break ; +case 48000 : + n =6144 ; + cts =27000 ; +break ; +case 96000 : + n =12288 ; + cts =27000 ; +break ; +case 192000 : + n =24576 ; + cts =27000 ; +break ; +default : + n =0 ; + cts =0 ; +break ; + } + + acr[1 ] = cts >>16 ; + acr[2 ] = cts >>8 &0xff ; + acr[3 ] = cts &0xff ; + + acr[4 ] = n >>16 ; + acr[5 ] = n >>8 &0xff ; + acr[6 ] = n &0xff ; +} + +static void hdmi_reg_acr (struct hdmi_context *hdata,u8 *acr) +{ +hdmi_reg_writeb (hdata,HDMI_ACR_N0 , acr[6 ]); +hdmi_reg_writeb (hdata,HDMI_ACR_N1 , acr[5 ]); +hdmi_reg_writeb (hdata,HDMI_ACR_N2 , acr[4 ]); +hdmi_reg_writeb (hdata,HDMI_ACR_MCTS0 , acr[3 ]); +hdmi_reg_writeb (hdata,HDMI_ACR_MCTS1 , acr[2 ]); +hdmi_reg_writeb (hdata,HDMI_ACR_MCTS2 , acr[1 ]); +hdmi_reg_writeb (hdata,HDMI_ACR_CTS0 , acr[3 ]); +hdmi_reg_writeb (hdata,HDMI_ACR_CTS1 , acr[2 ]); +hdmi_reg_writeb (hdata,HDMI_ACR_CTS2 , acr[1 ]); + +if (hdata->is_v13) +hdmi_reg_writeb (hdata,HDMI_V13_ACR_CON ,4 ); +else +hdmi_reg_writeb (hdata,HDMI_ACR_CON ,4 ); +} + +static void hdmi_audio_init (struct hdmi_context *hdata) +{ +u32 sample_rate, bits_per_sample, frame_size_code; +u32 data_num, bit_ch, sample_frq; +u32 val; +u8 acr[7 ]; + + sample_rate =44100 ; + bits_per_sample =16 ; + frame_size_code =0 ; + +switch (bits_per_sample) { +case 20 : + data_num =2 ; + bit_ch =1 ; +break ; +case 24 : + data_num =3 ; + bit_ch =1 ; +break ; +default : + data_num =1 ; + bit_ch =0 ; +break ; + } + +hdmi_set_acr (sample_rate, acr); +hdmi_reg_acr (hdata, acr); + +hdmi_reg_writeb (hdata,HDMI_I2S_MUX_CON ,HDMI_I2S_IN_DISABLE + |HDMI_I2S_AUD_I2S |HDMI_I2S_CUV_I2S_ENABLE + |HDMI_I2S_MUX_ENABLE ); + +hdmi_reg_writeb (hdata,HDMI_I2S_MUX_CH ,HDMI_I2S_CH0_EN + |HDMI_I2S_CH1_EN |HDMI_I2S_CH2_EN ); + +hdmi_reg_writeb (hdata,HDMI_I2S_MUX_CUV ,HDMI_I2S_CUV_RL_EN ); + + sample_frq = (sample_rate ==44100 ) ?0 : + (sample_rate ==48000 ) ?2 : + (sample_rate ==32000 ) ?3 : + (sample_rate ==96000 ) ?0xa :0x0 ; + +hdmi_reg_writeb (hdata,HDMI_I2S_CLK_CON ,HDMI_I2S_CLK_DIS ); +hdmi_reg_writeb (hdata,HDMI_I2S_CLK_CON ,HDMI_I2S_CLK_EN ); + + val =hdmi_reg_read (hdata,HDMI_I2S_DSD_CON ) |0x01 ; +hdmi_reg_writeb (hdata,HDMI_I2S_DSD_CON , val); + +/* Configuration I2S input ports. Configure I2S_PIN_SEL_0~4 */ +hdmi_reg_writeb (hdata,HDMI_I2S_PIN_SEL_0 ,HDMI_I2S_SEL_SCLK (5 ) + |HDMI_I2S_SEL_LRCK (6 )); +hdmi_reg_writeb (hdata,HDMI_I2S_PIN_SEL_1 ,HDMI_I2S_SEL_SDATA1 (1 ) + |HDMI_I2S_SEL_SDATA2 (4 )); +hdmi_reg_writeb (hdata,HDMI_I2S_PIN_SEL_2 ,HDMI_I2S_SEL_SDATA3 (1 ) + |HDMI_I2S_SEL_SDATA2 (2 )); +hdmi_reg_writeb (hdata,HDMI_I2S_PIN_SEL_3 ,HDMI_I2S_SEL_DSD (0 )); + +/* I2S_CON_1 & 2 */ +hdmi_reg_writeb (hdata,HDMI_I2S_CON_1 ,HDMI_I2S_SCLK_FALLING_EDGE + |HDMI_I2S_L_CH_LOW_POL ); +hdmi_reg_writeb (hdata,HDMI_I2S_CON_2 ,HDMI_I2S_MSB_FIRST_MODE + |HDMI_I2S_SET_BIT_CH (bit_ch) + |HDMI_I2S_SET_SDATA_BIT (data_num) + |HDMI_I2S_BASIC_FORMAT ); + +/* Configure register related to CUV information */ +hdmi_reg_writeb (hdata,HDMI_I2S_CH_ST_0 ,HDMI_I2S_CH_STATUS_MODE_0 + |HDMI_I2S_2AUD_CH_WITHOUT_PREEMPH + |HDMI_I2S_COPYRIGHT + |HDMI_I2S_LINEAR_PCM + |HDMI_I2S_CONSUMER_FORMAT ); +hdmi_reg_writeb (hdata,HDMI_I2S_CH_ST_1 ,HDMI_I2S_CD_PLAYER ); +hdmi_reg_writeb (hdata,HDMI_I2S_CH_ST_2 ,HDMI_I2S_SET_SOURCE_NUM (0 )); +hdmi_reg_writeb (hdata,HDMI_I2S_CH_ST_3 ,HDMI_I2S_CLK_ACCUR_LEVEL_2 + |HDMI_I2S_SET_SMP_FREQ (sample_frq)); +hdmi_reg_writeb (hdata,HDMI_I2S_CH_ST_4 , +HDMI_I2S_ORG_SMP_FREQ_44_1 + |HDMI_I2S_WORD_LEN_MAX24_24BITS + |HDMI_I2S_WORD_LEN_MAX_24BITS ); + +hdmi_reg_writeb (hdata,HDMI_I2S_CH_ST_CON ,HDMI_I2S_CH_STATUS_RELOAD ); +} + +static void hdmi_audio_control (struct hdmi_context *hdata,bool onoff) +{ +u32 mod; + + mod =hdmi_reg_read (hdata,HDMI_MODE_SEL ); +if (mod &HDMI_DVI_MODE_EN ) +return ; + +hdmi_reg_writeb (hdata,HDMI_AUI_CON , onoff ?2 :0 ); +hdmi_reg_writemask (hdata,HDMI_CON_0 , onoff ? +HDMI_ASP_EN :HDMI_ASP_DIS ,HDMI_ASP_MASK ); +} +static void hdmi_conf_reset (struct hdmi_context *hdata) {u32 reg;
@@ -1737,9 +1900,11 @@ static void hdmi_conf_apply(struct hdmi_context *hdata)hdmi_conf_reset (hdata);hdmi_conf_init (hdata); +hdmi_audio_init (hdata);/* setting core registers */ hdmi_timing_apply (hdata); +hdmi_audio_control (hdata, true);hdmi_regs_dump (hdata,"start" ); }
@@ -1825,6 +1990,7 @@ static void hdmi_disable(void *ctx)DRM_DEBUG_KMS ("[%d] %s\n" , __LINE__, __func__);if (hdata->enabled) { +hdmi_audio_control (hdata, false);hdmiphy_conf_reset (hdata);hdmi_conf_reset (hdata); }
@@ -1983,6 +2149,7 @@ static void hdmi_resource_poweron(struct hdmi_context *hdata)hdmiphy_conf_reset (hdata);hdmi_conf_reset (hdata);hdmi_conf_init (hdata); +hdmi_audio_init (hdata); }static void hdmi_resource_poweroff (struct hdmi_context *hdata)
drivers/gpu/drm/exynos/regs-hdmi.h +182 -0
212 lines not on this page · raw message
Signature · 1 line
1.7.4.1
Dave Airlie
maintainerRe: [PATCH v2 09/14] drm/exynos: add G2D driver
In reply to Inki DaeQuoted 5 lines · Inki Dae
From: Joonyoung Shim <[email protected]>
The G2D is a 2D graphic accelerator that supports Bit Block Transfer. This G2D driver is exynos drm specific and supports only G2D(version 4.1) of later Exynos series from Exynos4X12 because supporting DMA.
So just to make sure I understand, userspace generates two command streams, one containing registers that don't need base addresses and one containing registers that do contain it.
Now tell me how this address security wise, since non-root users have the ability to use this interface.
can userspace put registers that require a base address into the first command stream and specify any phy addr in the system? If not, please explain in comments where this is blocked. Where is the list of registers the first command stream and second command stream can access specified?
I'm not really happy about this appearing so late on the radar for 3.4, you really want new major userspace security features to turn up a lot earlier for review.
Dave.
Re: [PATCH v2 09/14] drm/exynos: add G2D driver
Quoted 10 lines · Dave Airlie
Quoted 5 lines · Inki Dae
From: Joonyoung Shim<[email protected]>
The G2D is a 2D graphic accelerator that supports Bit Block Transfer. This G2D driver is exynos drm specific and supports only G2D(version 4.1) of later Exynos series from Exynos4X12 because supporting DMA.
So just to make sure I understand, userspace generates two command streams, one containing registers that don't need base addresses and one containing registers that do contain it.
Quoted 5 lines
Now tell me how this address security wise, since non-root users have the ability to use this interface.
can userspace put registers that require a base address into the first command stream and specify any phy addr in the system?
Right, it's possible scenario. I will add codes to check it.
Quoted 8 lines
If not, please
explain in comments where this is blocked. Where is the list of registers the first command stream and second command stream can access specified?I'm not really happy about this appearing so late on the radar for 3.4, you really want new major userspace security features to turn up a lot earlier for review.
I post the patch to get the review like this and i think time posting patch can be open always. If the patch has serious problem, certainly don't apply it. I don't want it too, but i will try to solve it and resend updated patch.
Thanks.
Dave Airlie
maintainerQuoted 1 line · Inki Dae
Hi, Dave and all.
Hi Inki,
I've taken most of these patches except for the G2D and Virtual drivers,
If you can make the virtual driver rebase without G2D I don't see an issue with merging it, it didn't seem to apply cleanly here.
But I don't think G2D is close enough for this merge window considering the security issues with exposing DMA engines without a lot of review.
Dave.
Inki Dae
maintainerHi Dave,
Quoted 15 lines
-----Original Message-----
From: Dave Airlie [mailto:[email protected]]
Sent: Tuesday, March 20, 2012 6:49 PM
To: Inki Dae
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH v2 00/14] updated exynos-drm-next.Quoted 1 line · Inki Dae
Hi, Dave and all.
Hi Inki,
I've taken most of these patches except for the G2D and Virtual drivers,
Quoted 8 lines
If you can make the virtual driver rebase without G2D I don't see an issue with merging it, it didn't seem to apply cleanly here.
But I don't think G2D is close enough for this merge window considering the security issues with exposing DMA engines without a lot of review.
Dave.
Ok, I will resend rebased Virtual Display Driver and we will consolidate the security part of g2d for next time.
Thanks,
Inki Dae.