On Thu, Sep 15, 2016 at 3:23 PM, Tomi Valkeinen wrote: > > > On 15/09/16 12:44, Vikas Patil wrote: >> On Wed, Sep 14, 2016 at 3:04 PM, Tomi Valkeinen wrote: >>> >>> >>> On 13/09/16 16:13, Vikas Patil wrote: >>>> Thanks Tomi for quick comment. >>>> >>>> I am thinking to base adv7393 driver on >>>> "drivers\gpu\drm\omapdrm\displays\encoder-tc358768.c" as I don't think >>>> any similar to adv7393 chip driver available. Could you please comment >>>> if this will help to get adv chip running? >>> >>> I presume you're not using mainline kernel, as that driver is not there. >>> I'm not familiar with adv7393, but yes, I think you can use that as an >>> example. >>> >> >> Thanks a lot for your comments. I am using latest (i.e. 3.00.00.03 ) >> Processor SDK Linux Automotive which is based on linux 4.4.14. >> >> As my display panel is connected as follows. I am little confused over >> the values I need to set for following properties in probe function. >> >> DPI1/VOUT1 -----16bit DRGB---> ADV7393 (Digital to Analog video >> encoder) ------> CVBS Out ------> Display Panel >> >> >> dssdev->ops.dpi = &adv7393_dpi_ops; (atv?) >> dssdev->type = OMAP_DISPLAY_TYPE_DPI; >> dssdev->output_type = OMAP_DISPLAY_TYPE_DPI; (Do I need to use >> OMAP_DISPLAY_TYPE_VENC, but DRA74x do not have VENC Encoder I think) >> dssdev->phy.dpi.data_lines = ddata->dpi_ndl; >> dssdev->port_num = 1; >> >> >> As adv7393 takes 16-bit DRGB as input and gives composite as output, >> does above configuration looks correct? or Do I need to change to >> something else (e.g. dpi,sdi,dvi, hdmi, atv, dsi)? > > The API is quite messy (full of legacy)... > > But the "ops" there are for the "downstream" direction, i.e. towards the > connector. So here you should have atv ops. You should then have > connector-analog-tv as a device after adv7393, and that connector driver > will be calling those atv ops. > > adv7393 itself will be calling dpi ops, offered by the DSS. > > You should set dssdev->type to DPI (that's the input). > dssdev->output_type to OMAP_DISPLAY_TYPE_VENC (output, although "venc" > is not quite correct here, but closest match we have). DRA74x doesn't > have VENC, but this is what the adv7393 outputs. > Thanks a lot for explaining it. It really helped. I have created the driver and configured the registers of ADV7393 as required. Even though encoders and connectors are visible using "modetest" now, but it seems adv7393 encoder and cvbs-out connector not connected (sttaus in modetest shows unknown) and might be failing in mode setting (from DRM logs). Could you please suggest where should I need to look for fixing this? Do I need to configure the display timing as per the ADV7393 configuration or as per the attached panel in \omapdrm\displays\connector-analog-tv.c ? Also one doubt I have is, as I know DRA74x has 1 GFX pipeline/overlay and 3 video pipeline/overlay and now with my first LCD display GFX pipeline would have been connected to vout3/lcd3/dpi3 to LCD panel. How could I now configure the GFX overlay to vout1/lcd1/dpi1 and further to adv7393 so that weston could show up on both the displays? Will second display show kmscube, weston etc? DRM log snippets: (Attached here the complete drm log when i run modetest) [ 226.862242] [drm:drm_ioctl] pid=1853, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETRESOURCES [ 226.862254] [drm:drm_mode_getresources] CRTC[2] CONNECTORS[2] ENCODERS[2] [ 226.862266] [drm:drm_ioctl] pid=1853, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETRESOURCES [ 226.862276] [drm:drm_mode_getresources] [CRTC:34] [ 226.862284] [drm:drm_mode_getresources] [CRTC:38] [ 226.862292] [drm:drm_mode_getresources] [ENCODER:31:TMDS-31] [ 226.862301] [drm:drm_mode_getresources] [ENCODER:35:TMDS-35] [ 226.862309] [drm:drm_mode_getresources] [CONNECTOR:32:Unknown-1] [ 226.862317] [drm:drm_mode_getresources] [CONNECTOR:36:Unknown-2] [ 226.862325] [drm:drm_mode_getresources] CRTC[2] CONNECTORS[2] ENCODERS[2] [ 226.862456] [drm:drm_ioctl] pid=1853, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETCRTC [ 226.862475] [drm:drm_ioctl] pid=1853, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETCRTC [ 226.862498] [drm:drm_ioctl] pid=1853, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETENCODER [ 226.862512] [drm:drm_ioctl] pid=1853, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETENCODER [ 226.862527] [drm:drm_ioctl] pid=1853, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETCONNECTOR [ 226.862536] [drm:drm_mode_getconnector] [CONNECTOR:32:?] [ 226.862547] [drm:drm_helper_probe_single_connector_modes_merge_bits] [CONNECTOR:32:Unknown-1] [ 226.862557] [drm:omap_connector_get_modes] cvbs_out [ 226.862571] ------>adv7393_check_timings: start [ 226.870369] [drm:omap_connector_mode_valid] connector: mode invalid: 42:"720x574i" 50 13500 720 732 796 864 574 579 584 625 0x48 0x2a00001a [ 226.870383] [drm:drm_mode_debug_printmodeline] Modeline 42:"720x574i" 50 13500 720 732 796 864 574 579 584 625 0x48 0x2a00001a [ 226.870392] [drm:drm_mode_prune_invalid] Not using 720x574i mode: BAD [ 226.870408] [drm:drm_ioctl] pid=1853, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETCONNECTOR [ 226.870418] [drm:drm_mode_getconnector] [CONNECTOR:32:?] [ 226.870436] [drm:drm_ioctl] pid=1853, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETCONNECTOR [ 226.870445] [drm:drm_mode_getconnector] [CONNECTOR:36:?] [ 226.870455] [drm:drm_helper_probe_single_connector_modes_merge_bits] [CONNECTOR:36:Unknown-2] [ 226.870463] [drm:omap_connector_get_modes] lcd [ 226.871670] [drm:omap_connector_mode_valid] connector: mode valid: 45:"800x480" 62 26999 800 815 822 829 480 520 523 527 0x48 0x2a000005 [ 226.871682] [drm:drm_helper_probe_single_connector_modes_merge_bits] [CONNECTOR:36:Unknown-2] probed modes : [ 226.871695] [drm:drm_mode_debug_printmodeline] Modeline 45:"800x480" 62 26999 800 815 822 829 480 520 523 527 0x48 0x2a000005 [ 226.871710] [drm:drm_ioctl] pid=1853, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETCONNECTOR [ 226.871719] [drm:drm_mode_getconnector] [CONNECTOR:36:?] [ 226.871760] [drm:drm_ioctl] pid=1853, dev=0xe200, auth=1, DRM_IOCTL_MODE_OBJ_GETPROPERTIES [ 226.871779] [drm:drm_ioctl] pid=1853, dev=0xe200, auth=1, DRM_IOCTL_MODE_OBJ_GETPROPERTIES root@dra7xx-evm:~# modetest trying to open device 'i915'...failed trying to open device 'radeon'...failed trying to open device 'nouveau'...failed trying to open device 'vmwgfx'...failed trying to open device 'omapdrm'...done[ 226.862571] ------>adv7393_check_timings: start Encoders: id crtc type possible crtcs possible clones 31 0 TMDS 0x00000001 0x00000000 35 38 TMDS 0x00000002 0x00000000 Connectors: id encoder status name size (mm) modes encoders 32 0 unknown unknown-1 0x0 0 31 props: 1 EDID: flags: immutable blob blobs: value: 2 DPMS: flags: enum enums: On=0 Standby=1 Suspend=2 Off=3 value: 0 36 35 connected unknown-2 0x0 1 35 modes: name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot) 800x480 62 800 815 822 829 480 520 523 527 flags: phsync, pvsync; type: preferred, driver props: 1 EDID: flags: immutable blob blobs: value: 2 DPMS: flags: enum enums: On=0 Standby=1 Suspend=2 Off=3 value: 0 CRTCs: id fb pos size 34 0 (0,0) (0x0) 0 0 0 0 0 0 0 0 0 flags: ; type: props: 27 trans-key-mode: flags: enum enums: disable=0 gfx-dst=1 vid-src=2 value: 0 28 trans-key: flags: range values: 0 16777215 value: 0 29 background: flags: range values: 0 16777215 value: 0 30 alpha_blender: flags: range values: 0 1 value: 0 21 GAMMA_LUT: flags: blob blobs: value: 22 GAMMA_LUT_SIZE: flags: immutable range values: 0 4294967295 value: 256 23 rotation: flags: bitmask values: rotate-0=0x1 rotate-90=0x2 rotate-180=0x4 rotate-270=0x8 reflect-x=0x10 reflect-y=0x20 value: 1 24 zorder: flags: range values: 0 3 value: 0 38 43 (0,0) (800x480) 800x480 62 800 815 822 829 480 520 523 527 flags: phsync, pvsync; type: preferred, driver props: 27 trans-key-mode: flags: enum enums: disable=0 gfx-dst=1 vid-src=2 value: 0 28 trans-key: flags: range values: 0 16777215 value: 0 29 background: flags: range values: 0 16777215 value: 0 30 alpha_blender: flags: range values: 0 1 value: 0 21 GAMMA_LUT: flags: blob blobs: value: 22 GAMMA_LUT_SIZE: flags: immutable range values: 0 4294967295 value: 256 23 rotation: flags: bitmask values: rotate-0=0x1 rotate-90=0x2 rotate-180=0x4 rotate-270=0x8 reflect-x=0x10 reflect-y=0x20 value: 1 24 zorder: flags: range values: 0 3 value: 0 Planes: id crtc fb CRTC x,y x,y gamma size possible crtcs 33 0 0 0,0 0,0 0 0x00000001 formats: RG16 RX12 XR12 RA12 AR12 XR15 AR15 RG24 RX24 XR24 RA24 AR24 props: 5 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 1 23 rotation: flags: bitmask values: rotate-0=0x1 rotate-90=0x2 rotate-180=0x4 rotate-270=0x8 reflect-x=0x10 reflect-y=0x20 value: 1 24 zorder: flags: range values: 0 3 value: 0 25 global_alpha: flags: range values: 0 255 value: 255 26 pre_mult_alpha: flags: range values: 0 1 value: 0 37 38 43 0,0 0,0 0 0x00000002 formats: RG16 RX12 XR12 RA12 AR12 XR15 AR15 RG24 RX24 XR24 RA24 AR24 NV12 YUYV UYVY props: 5 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 1 23 rotation: flags: bitmask values: rotate-0=0x1 rotate-90=0x2 rotate-180=0x4 rotate-270=0x8 reflect-x=0x10 reflect-y=0x20 value: 1 24 zorder: flags: range values: 0 3 value: 0 25 global_alpha: flags: range values: 0 255 value: 255 26 pre_mult_alpha: flags: range values: 0 1 value: 0 39 0 0 0,0 0,0 0 0x00000003 formats: RG16 RX12 XR12 RA12 AR12 XR15 AR15 RG24 RX24 XR24 RA24 AR24 NV12 YUYV UYVY props: 5 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 0 23 rotation: flags: bitmask values: rotate-0=0x1 rotate-90=0x2 rotate-180=0x4 rotate-270=0x8 reflect-x=0x10 reflect-y=0x20 value: 1 24 zorder: flags: range values: 0 3 value: 2 25 global_alpha: flags: range values: 0 255 value: 255 26 pre_mult_alpha: flags: range values: 0 1 value: 0 40 0 0 0,0 0,0 0 0x00000003 formats: RG16 RX12 XR12 RA12 AR12 XR15 AR15 RG24 RX24 XR24 RA24 AR24 NV12 YUYV UYVY props: 5 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 0 23 rotation: flags: bitmask values: rotate-0=0x1 rotate-90=0x2 rotate-180=0x4 rotate-270=0x8 reflect-x=0x10 reflect-y=0x20 value: 1 24 zorder: flags: range values: 0 3 value: 3 25 global_alpha: flags: range values: 0 255 value: 255 26 pre_mult_alpha: flags: range values: 0 1 value: 0 Frame buffers: id size pitch Here is the modetest output: root@dra7xx-evm:~# modetest trying to open device 'i915'...failed trying to open device 'radeon'...failed trying to open device 'nouveau'...failed trying to open device 'vmwgfx'...failed trying to open device 'omapdrm'...done[ 226.862571] ------>adv7393_check_timings: start Encoders: id crtc type possible crtcs possible clones 31 0 TMDS 0x00000001 0x00000000 35 38 TMDS 0x00000002 0x00000000 Connectors: id encoder status name size (mm) modes encoders 32 0 unknown unknown-1 0x0 0 31 props: 1 EDID: flags: immutable blob blobs: value: 2 DPMS: flags: enum enums: On=0 Standby=1 Suspend=2 Off=3 value: 0 36 35 connected unknown-2 0x0 1 35 modes: name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot) 800x480 62 800 815 822 829 480 520 523 527 flags: phsync, pvsync; type: preferred, driver props: 1 EDID: flags: immutable blob blobs: value: 2 DPMS: flags: enum enums: On=0 Standby=1 Suspend=2 Off=3 value: 0 CRTCs: id fb pos size 34 0 (0,0) (0x0) 0 0 0 0 0 0 0 0 0 flags: ; type: props: 27 trans-key-mode: flags: enum enums: disable=0 gfx-dst=1 vid-src=2 value: 0 28 trans-key: flags: range values: 0 16777215 value: 0 29 background: flags: range values: 0 16777215 value: 0 30 alpha_blender: flags: range values: 0 1 value: 0 21 GAMMA_LUT: flags: blob blobs: value: 22 GAMMA_LUT_SIZE: flags: immutable range values: 0 4294967295 value: 256 23 rotation: flags: bitmask values: rotate-0=0x1 rotate-90=0x2 rotate-180=0x4 rotate-270=0x8 reflect-x=0x10 reflect-y=0x20 value: 1 24 zorder: flags: range values: 0 3 value: 0 38 43 (0,0) (800x480) 800x480 62 800 815 822 829 480 520 523 527 flags: phsync, pvsync; type: preferred, driver props: 27 trans-key-mode: flags: enum enums: disable=0 gfx-dst=1 vid-src=2 value: 0 28 trans-key: flags: range values: 0 16777215 value: 0 29 background: flags: range values: 0 16777215 value: 0 30 alpha_blender: flags: range values: 0 1 value: 0 21 GAMMA_LUT: flags: blob blobs: value: 22 GAMMA_LUT_SIZE: flags: immutable range values: 0 4294967295 value: 256 23 rotation: flags: bitmask values: rotate-0=0x1 rotate-90=0x2 rotate-180=0x4 rotate-270=0x8 reflect-x=0x10 reflect-y=0x20 value: 1 24 zorder: flags: range values: 0 3 value: 0 Planes: id crtc fb CRTC x,y x,y gamma size possible crtcs 33 0 0 0,0 0,0 0 0x00000001 formats: RG16 RX12 XR12 RA12 AR12 XR15 AR15 RG24 RX24 XR24 RA24 AR24 props: 5 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 1 23 rotation: flags: bitmask values: rotate-0=0x1 rotate-90=0x2 rotate-180=0x4 rotate-270=0x8 reflect-x=0x10 reflect-y=0x20 value: 1 24 zorder: flags: range values: 0 3 value: 0 25 global_alpha: flags: range values: 0 255 value: 255 26 pre_mult_alpha: flags: range values: 0 1 value: 0 37 38 43 0,0 0,0 0 0x00000002 formats: RG16 RX12 XR12 RA12 AR12 XR15 AR15 RG24 RX24 XR24 RA24 AR24 NV12 YUYV UYVY props: 5 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 1 23 rotation: flags: bitmask values: rotate-0=0x1 rotate-90=0x2 rotate-180=0x4 rotate-270=0x8 reflect-x=0x10 reflect-y=0x20 value: 1 24 zorder: flags: range values: 0 3 value: 0 25 global_alpha: flags: range values: 0 255 value: 255 26 pre_mult_alpha: flags: range values: 0 1 value: 0 39 0 0 0,0 0,0 0 0x00000003 formats: RG16 RX12 XR12 RA12 AR12 XR15 AR15 RG24 RX24 XR24 RA24 AR24 NV12 YUYV UYVY props: 5 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 0 23 rotation: flags: bitmask values: rotate-0=0x1 rotate-90=0x2 rotate-180=0x4 rotate-270=0x8 reflect-x=0x10 reflect-y=0x20 value: 1 24 zorder: flags: range values: 0 3 value: 2 25 global_alpha: flags: range values: 0 255 value: 255 26 pre_mult_alpha: flags: range values: 0 1 value: 0 40 0 0 0,0 0,0 0 0x00000003 formats: RG16 RX12 XR12 RA12 AR12 XR15 AR15 RG24 RX24 XR24 RA24 AR24 NV12 YUYV UYVY props: 5 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 0 23 rotation: flags: bitmask values: rotate-0=0x1 rotate-90=0x2 rotate-180=0x4 rotate-270=0x8 reflect-x=0x10 reflect-y=0x20 value: 1 24 zorder: flags: range values: 0 3 value: 3 25 global_alpha: flags: range values: 0 255 value: 255 26 pre_mult_alpha: flags: range values: 0 1 value: 0 Frame buffers: id size pitch Thanks & Regards, Vikash