Media Controller (MC) and OMAP2+ Display Subsystem (DSS) Embedded Linux Conference, SFO, 2011 Sumit Semwal

Similar documents
Display and Kernel Review and Future

Marek Szyprowski Samsung R&D Institute Poland

DRM(Direct Rendering Manager) of Tizen Kernel Joonyoung Shim

Linux DRM Developer s Guide

Embedded Linux Conference EU Complex Cameras on Linux. Mauro Carvalho Chehab. Oct, SRBR Samsung R&D Institute Brazil

A Linux multimedia platform for SH-Mobile processors

Bringing display and 3D to the C.H.I.P computer

Linux DRM Developer s Guide

Bringing display and 3D to the C.H.I.P computer

Video4Linux: Current Status and Future Work

Intel Atom x3-c3200rk Processor (Formerly SoFIA 3G R) Simple V4L2- based Capture Method for MIPI-CSI2 Smart Camera Sensors

OMAP Android Integration

Memory Management in Tizen. SW Platform Team, SW R&D Center

Multimedia SoC System Solutions

Sync Points in the Intel Gfx Driver. Jesse Barnes Intel Open Source Technology Center

AM57x Sitara Processors Multimedia and Graphics

Building X 2D rendering acceleration with OpenGL. Eric Anholt Intel Open Source Technology Center

Generic Buffer Sharing Mechanism for Mediated Devices

DSS Bit Exact Output. Application Report. 1 Display Subsystem (DSS) Overview. Prasad Konnur, Sivaraj R, Brijesh Jadav

LCA14-417: mmap, allocators & sharing buffers - userland experience. Thu 6 March, 4:10pm, S.Semwal, B.Gaignard

DirectFB Overview (v0.1)

Efficient Video Processing on Embedded GPU

Display Virtualization with KVM for Automotive Systems

Driving 4K High-Resolution Embedded Displays in New Applications with MIPI DSI and VESA DSC (Synopsys & Arm)

ECE 598 Advanced Operating Systems Lecture 18

Running Android on the Mainline Graphics Stack. Robert

Mainline Explicit Fencing

Simple Plugin API. Wim Taymans Principal Software Engineer October 10, Pinos Wim Taymans

Windowing System on a 3D Pipeline. February 2005

GstShark profiling: a real-life example. Michael Grüner - David Soto -

Porting Tizen-IVI 3.0 to an ARM based SoC Platform

Methods to protect proprietary components in device drivers

MAGEWELL Pro Capture HDMI Technical Specification

Recommended OS (tested)

HDVPSS DRIVER USER GUIDE

NVJPEG. DA _v0.2.0 October nvjpeg Libary Guide

UI, Graphics & EFL. Carsten Haitzler Principal Engineer Samsung Electronics Korea Founder/Leader Enlightenment / EFL

Specifications are based on current hardware, firmware and software revisions, and are subject to change without notice.

EXPLICIT SYNCHRONIZATION

Android Multimedia Framework Overview. Li Li, Solution and Service Wind River

Status Report 2015/09. Alexandre Courbot Martin Peres. Logo by Valeria Aguilera, CC BY-ND

Hot Chips Bringing Workstation Graphics Performance to a Desktop Near You. S3 Incorporated August 18-20, 1996

The Linux graphics stack, Optimus and the Nouveau driver

What s an API? Do we need standardization?

Exporting virtual memory as dmabuf. Nikhil Devshatwar Texas Instruments, India

0;L$+LJK3HUIRUPDQFH ;3URFHVVRU:LWK,QWHJUDWHG'*UDSKLFV

UFG-10 MC. Frame Grabbers LINUX SOFTWARE PROGRAMMING GUIDE. Customized Property

VP13 Dual Input LCD Controller

The Serial Device Bus

PRIME Synchronization. XDC 2016 Alex Goins, Andy Ritger

Porting Tizen-IVI 3.0 to an ARM based SoC Platform. Damian Hobson-Garcia, IGEL Co., Ltd.

Software Driven Verification at SoC Level. Perspec System Verifier Overview

ECE 571 Advanced Microprocessor-Based Design Lecture 20

The DRM/KMS subsystem from a newbie s point of view

AMD E8860 2GB PCIEx16 Mini DP X6 GFX-AE8860F16-5J

Optimizing Film, Media with OpenCL & Intel Quick Sync Video

Kodi and Embedded Linux

Microsecond Latency, Real-Time, Multi-Input/Output Control using GPU Processing

4K HEVC Video Processing with GPU Optimization on Jetson TX1

NVIDIA SLI Mosaic Mode

NVJPEG. DA _v0.1.4 August nvjpeg Libary Guide

E Paper Displays. 5 minutes of Physics & Chemistry :-) Linux, Fbdev, & Deferred IO Demo Future work, controllers, technology

A brief overview of DRM/KMS and its status in NetBSD

Exam C Foundations of IBM Cloud Reference Architecture V5

AMD HD5450 PCIe X1 ADD-IN BOARD. Datasheet. Advantech model number: GFX-A3T5-71FST1

4K Video Processing and Streaming Platform on TX1

DevKit8500D Evaluation Kit

ST 软件 软件平台 2. TouchGFX

OpenAMP Discussion - Linaro2018HK. Copyright 2018 Xilinx

How to: Record from Hardware Inputs

Contiguous memory allocation in Linux user-space

Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions

Introduction to creating 3D UI with BeagleBoard. ESC-341 Presented by Diego Dompe

NVIDIA CUDA VIDEO DECODER

Operating Systems 2010/2011

Metal. GPU-accelerated advanced 3D graphics rendering and data-parallel computation. source rebelsmarket.com

Mainline on form-factor devices / Improving AOSP

Why Choose Nevron Chart for SQL Server Reporting Services

Making C Less Dangerous

1x (IN A Loop) Reclocked, 10-bit SD, HD, 3 Gb/s HD, 2K switchable. 1x (IN B Loop) Reclocked, 10-bit SD, HD, 3 Gb/s HD, 2K switchable.

Media Resource Sharing Through The Media Controller API

System-on-Chip Architecture for Mobile Applications. Sabyasachi Dey

libtheora Reference Manual

Matrox MXO Product Guide

SFO15-200: TEE kernel driver

Design Overview of the FreeBSD Kernel CIS 657

Design Overview of the FreeBSD Kernel. Organization of the Kernel. What Code is Machine Independent?

4K Video Processing and Streaming Platform on TX1

ECE 571 Advanced Microprocessor-Based Design Lecture 18

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

AMD HD5450 PCIe ADD-IN BOARD. Datasheet AEGX-A3T5-01FST1

GRATE LIBERATING NVIDIA'S TEGRA GPU. February Erik "kusma" Faye-Lund.

Team Up: Contributing to the Tizen Platform. Narasimha Swamy Sanjay NM

Black Hat Europe 2012 March 14 th 2012

Completing the Multimedia Architecture

Future Internet - ANA. INF5090 Thomas Plagemann

Build cost-effective, reliable signage solutions with the 8 display output, single slot form factor NVIDIA NVS 810

GStreamer Daemon - Building a media server under 30min. Michael Grüner - David Soto -

Model: LT-101-USB. LT-101 For USB

Virtual File System. Don Porter CSE 306

Transcription:

Controller (MC) and OMAP+ Display Subsystem (DSS) Embedded Linux Conference, SFO, Sumit Semwal

Agenda OMAP+ Display Subsystem (DSS) Overview of OMAP+ DSS Current software design DSS framework Interesting Display Use cases Controller (MC) Overview MC how it helps DSS MC mapping to DSS, pads, links and registration MC DSS: Userspace API MC DSS: Writeback (mem--mem) MC DSS: Writeback (capture) Limitations in moving to MC + V4L Direct Rendering Manager (DRM) Overview DRM Nice features Gaps Inter-op need between MC and DRM Summary Q & A

Overview of OMAP+ DSS 3

OMAP+ DSS hardware: Overview GFX VID VID VID3 WB DISPC LCD mgr LCD mgr TV mgr DSI encoder RFBI DSI encoder DPI HDMI encoder VENC Display Interfaces Display Panels Primary DSI RFBI Secondary DSI DPI HDMI SDTV OMAP,3,4 OMAP3,4 OMAP4 Gfx, vid-vid3 are overlays, which colorconvert, scale each frame Managers can compose, overlay multiple streams into one. Writeback is a device to writeback to memory. Not all paths are shown: All overlays connect to all overlay managers, and WB. In addition, all overlay managers can also give output in parallel to WB. DSS hardware WB, or writeback can take inputs from either overlays' or managers' output. 4

Current software design DSS framework User space UI / Graphics Userspace app /dev/fb /dev/fb Framebuffer APIs Video playback Userspace app /dev/video /dev/video V4L APIs Control sysfs Kernel space omapfb driver Panel drivers omap_vout driver gfx vid vid vid3 DSS lcd-mgr lcd-mgr tv-mgr OMAP DSS hardware Display hardware HDMI TV LCD panels 5

Current software design DSS framework S/w maps one-to-one w/ DSS hardware: One overlay for each overlay One manager for each overlay manager One display interface for each type of panel connectable [DSI / DPI / SDI / HDMI interfaces] Panel drivers are written which adhere to OMAP panel driver APIs. Control via DSS sysfs entries, common to both UI and Video entries for overlays, managers and displays. Writeback is a kind of 'special' case right now, as it maps both as an overlay and an overlay manager. Users of DSS - FB and V4L. No common arbitrator between them. 'pre-defined' policy about allocation of pipelines to FB and V4L. 6

Interesting Display Use cases Writeback Memory-to-memory Store processed images (after color-space conversion, scaling, rotation, or even composition) Capture mode Display and also record composed content Dynamic configurability, parallel usage Switch output paths, using multiple paths simultaneously Handle audio interfacing additionally HDMI support DSI support in future Support for 'virtual' pipelines when we run out of video pipelines Co-use of D/3D graphics accelerator. Multi-display configurations Clone, Virtual. Display security 7

Controller (MC) - Overview 8

MC Overview What? Framework built to model device topology. Why? Userspace applications can have finer control over media device parameters. Allow configurability and flexibility of setting multiple, parallel execution paths. How? Expose media device topology to userspace, as a graph of building blocks called entities connected through pads. Enable/disable links from userspace. Give access to entities internal parameters through read/write/ioctl calls. Configure image streaming parameters at each pad. Ref: Laurent Pinchart's MC presentation at V4L summit 9

MC how it helps DSS Use cases that benefit Mapping of DSS elements, connections Each overlay, each manager map to an MC. Properties of each DSS element map to internal parameters. Connections between overlays and managers map as links. Dynamic reconfiguration The dynamic nature of links helps re-routing of content from one display to another, or from overlay to writeback (mem-to-mem mode), or display to writeback (capture mode) Handling of Audio and Video as separate MC entities Helps clean design of HDMI-like AV panels [with both Audio and Video] Writeback HDMI

MC mapping to DSS gfx ovl 3 LCD mgr 4 5 LCD DSS ovl ovl3 Overlay internal properties: Colorspace conversion, Scaling. 3 3 LCD mgr TV mgr 4 5 4 5 LCD picodlp HDMI Audio IN for HDMI wb Writeback internal properties: Colorspace conversion, Scaling. SDTV * doesn't show all paths possible, but I'm sure you get the drift :) - All overlays can connect to any one of (managers or WB) LCD Mgr can connect to LCD, LCD Mgr can connect to LCD or picodlp, TV Mgr to either HDMI or SDTV. WB can take input from either one of overlays, or from one of managers.

struct media_ { u3 id; const char *name; u3 type;... }; media_::type contains info about both type and subtype Type can be either a NODE or a SUBDEV Multiple subtype of DEVNODEs and SUBDEVs can be added MEDIA_ENT_T_DEVNODE MEDIA_ENT_T_DEVNODE_V4L : : (proposed) MEDIA_ENT_T_V4L_SUBDEV_DSS_OVL MEDIA_ENT_T_V4L_SUBDEV_DSS_MGR MEDIA_ENT_T_V4L_SUBDEV_DSS_WB

- pads struct media_ {... u6 num_pads; struct media_pad *pads;... }; struct media_pad { struct media_ *; u6 index; unsigned long flags; }; media_pad::flags - MEDIA_PAD_FL_SINK - MEDIA_PAD_FL_SOURCE 3

- links struct media_ {... u6 num_links; struct media_link *links;... }; struct media_link { struct media_pad *source; struct media_pad *sink; struct media_link *reverse; unsigned long flags; }; media_link::flags - MEDIA_LNK_FL_ENABLED - MEDIA_LNK_FL_IMMUTABLE - MEDIA_LNK_FL_DYNAMIC 4

5 registration Initialize media init() Create links media create_link() Register media_device_register_()

MC DSS: Userspace API int fd; fd = open( /dev/media, O_RDWR); while () { struct media desc ; struct media_links_enum links_enumerator; struct media_pad_desc *pads; struct media_link_desc *links;.id = MEDIA_ENT_ID_FLAG_NEXT; ret = ioctl(fd, MEDIA_IOC_ENUM_ENTITIES,&); if (ret < ) Break; links_enumerator. =.id; pads = (struct media_pad_desc*) malloc (sizeof(struct media_pad_desc) *.pads); links = (struct media_link_desc*) malloc (sizeof(struct media_link_desc) *.links); Open device Enumerate Entities, pads and links } links_enumerator.pads = pads; links_enumerator.links = links; ret = ioctl(fd, MEDIA_IOC_ENUM_LINKS, &links_enumerator); if (ret < ) break; 6

MC DSS: Writeback (mem--mem) gfx ovl UI Content Video content composition 3 LCD mgr 4 5 render LCD DSS ovl ovl3 3 LCD mgr 4 5 LCD picodlp Overlay internal properties: Colorspace conversion, Scaling. 3 TV mgr 4 5 HDMI Audio IN for HDMI wb Scale, color-convert, and store back to memory Writeback internal properties: Colorspace conversion, Scaling. SDTV 7

MC DSS: Writeback (mem--mem) struct media_link_desc link; link.source. = OMAP_DSS_ENTITY_OVERLAY; link.source.index = ; link.sink. = OMAP_DSS_ENTITY_MGR_LCD; link.sink.index = ; link.flags = MEDIA_LNK_FL_ENABLED; ioctl(fd, MEDIA_IOC_SETUP_LINK, &link); link.source. = OMAP_DSS_ENTITY_MGR_LCD; link.source.index = 4; link.sink. = OMAP_DSS_ENTITY_PANEL_LCD; link.sink.index = ; link.flags = MEDIA_LNK_FL_ENABLED; ioctl(fd, MEDIA_IOC_SETUP_LINK, &link); /* Writeback path */ link.source. = OMAP_DSS_ENTITY_OVERLAY; link.source.index = ; link.sink. = OMAP_DSS_ENTITY_WRITEBACK; link.sink.index = ; link.flags = MEDIA_LNK_FL_ENABLED; ioctl(fd, MEDIA_IOC_SETUP_LINK, &link); 8

MC DSS: Writeback (capture) gfx ovl ovl ovl3 UI content Video content 3 3 compose LCD mgr LCD mgr 4 5 4 5 render LCD LCD picodlp DSS Overlay internal properties: Colorspace conversion, Scaling. 3 TV mgr 4 5 HDMI Audio IN for HDMI wb Scale, color-convert, and store back composed frame to memory Writeback internal properties: Colorspace conversion, Scaling. SDTV 9

MC DSS: Writeback (capture) struct media_link_desc link; link.source. = OMAP_DSS_ENTITY_OVERLAY; link.source.index = ; link.sink. = OMAP_DSS_ENTITY_MGR_LCD; link.sink.index = ; link.flags = MEDIA_LNK_FL_ENABLED; ioctl(fd, MEDIA_IOC_SETUP_LINK, &link); link.source. = OMAP_DSS_ENTITY_OVERLAY; link.source.index = ; link.sink. = OMAP_DSS_ENTITY_MGR_LCD; link.sink.index = ; link.flags = MEDIA_LNK_FL_ENABLED; ioctl(fd, MEDIA_IOC_SETUP_LINK, &link); link.source. = OMAP_DSS_ENTITY_MGR_LCD; link.source.index = 4; link.sink. = OMAP_DSS_ENTITY_PANEL_LCD; link.sink.index = ; link.flags = MEDIA_LNK_FL_ENABLED; ioctl(fd, MEDIA_IOC_SETUP_LINK, &link); /* Writeback path */ link.source. = OMAP_DSS_ENTITY_MGR_LCD; link.source.index = 5; link.sink. = OMAP_DSS_ENTITY_WRITEBACK; link.sink.index = ; link.flags = MEDIA_LNK_FL_ENABLED; ioctl(fd, MEDIA_IOC_SETUP_LINK, &link);

Limitations in moving to MC + V4L DSS User management FB and V4L are still two 'disjoint' users Unless, we find a way of working with FB and V4L together? One proposal to explore is the option of building an FB on top of a V4L device.» This approach may not work in case of inter-op required with DRM (use case discussed in a later slide) Integration / inter-op with GPU No support available in V4L as of now Dependent subsystem needs to be MC-compliant Audio driver would need to 'adapt' to MC to be able to use Audio MC. SDRAM based DSI direct display (bypassing overlays)

Direct Rendering Manager (DRM) - Overview Slides on DRM attributed to Rob Clark rob@ti.com

DRM Overview The modern Linux (and *BSD) display driver framework The kernel component of DRI (Direct Rendering Infrastructure) But not just DRI: Hotplug XRandR/KMS EDID parsing Discussions have already been started to move out EDID parsing to make it non- DRM dependent Kernel Mode Setting (KMS) Setting screen resolution/timings Hotplug, and retrieving EDID Multi-display configurations 3

DRM Nice features Maps well to DSS drm_framebuffer a piece of memory drm_crtc overlay drm_encoder manager drm_connector omap_dss_device (represents dss panel) Separation of buffers from overlays Lets userspace dynamically reconnect buffers to overlays This lets us implement single buffer spanning multiple displays In userspace we can implement virtual overlays when we run out of video pipes And if we use this for video too we can dynamically switch between GPU (GL) and DSS composition Security is inherent in DRM 4

DRM gaps No clear way of handling Writeback Or any new components upcoming, since the component 'types' are predefined [crtc, connector, framebuffer, encoder] Audio interface doesn't seem to be too clear HDMI Aud+Vid, future DSI with Audio? 5

Inter-op need between MC and DRM 6

Need for inter-op between MC and DRM Usecase where there is a fallback capability available: We have gfx pipe, and 3 video pipes available. To render 4 surfaces, this is sufficient to use via V4L [MCF] and FB. What if we need to render 7 surfaces? One solution is to use 3 video pipes for three video surfaces, and use a D/3D Graphics Accelerator [like SGX54 in OMAP4] for composing remaining 4 surfaces which can then be rendered via gfx pipe. DRM framework is more suited for Graphics accelerator kind of devices. V4L camera, DRM-supported GPU. Buffer sharing V4L supports USERPTR, so if some way is available for DRM to share buffers, it would help. 7

Summary Controller seems quite adaptable to display sub systems in general. Flexibility in linking, defining new components, using different frameworks. Re configurability. Still needs to improve on certain key areas buffer-sharing, inter-op with the FB world (DRM), inter-working with GPUs 8

Acknowledgements Hans Verkuil Laurent Pinchart Rob Clark TI LDC display team :) References Laurent Pinchart's MC presentation at V4L summit 343 public Technical Reference Manual 443 public Technical Reference Manual 9

Q and A? 3

Thank You! 3

Backup 3

Acronyms DSI: Display Serial Interface: a MIPI standard interface for serial display panels. DPI: Display Pixel Interface: a MIPI standard interface for parallel display panels. RFBI: Remote Frame Buffer Interface: a MIPI standard interface for parallel display panels supporting remote frame buffer mechanism. HDMI: High Definition Multimedia Interface: a standard compact AV interface to transmit uncompressed digital data. VENC: Video ENCoder: standard interface to display content on standard definition TVs, using TV formats like NTSC / PAL. 33

Features of OMAP+ DSS Feature OMAP43 OMAP343 OMAP443 GFX overlay VID overlay 3 WB overlay - - LCD overlay manager TV overlay manager Rotation (per overlay) Via VRFB* Via VRFB* Via TILER* OMAP3/4 support ARGB color formats. OMAP4 additionally has native support for NV, configurable Z-order. Overlay perspective GFX overlay supports CLUT/gamma table, anti-flicker, replication logic primarily meant for UI. VID overlays support Multiple color formats(rgb, YUV, NV based on OMAP version), colorspace conversion, independent horizontal and vertical polyphase filter scaling, and VC- range mapping. WB overlay, in mem-to-mem mode: colorspace conversion, rescaling, compositing processes. Capture mode: allows composited encoded pixel data to be stored back into memory. Overlay perspective Each overlay supports: overlaying [fixed-order for OMAP/3, z-order per pipeline for OMAP4], transparency color-keys [source and destination] and global and pixel alpha blending [OMAP3/4], Gamma correction, Sync buffers. LCD overlays additionally support Active / Passive matrix dithering, color phase rotation. * Read more about Virtual Rotated Frame Buffer (VRFB) and TILER in the 343 public TRM and 443 public TRM respectively 34

Current architecture of Rob's omapgpu driver Xorg pvr_drv.so DRI proto GL app libdrm libdrm pvr 3d driver registers handlers for a set of custom ioctls related to gfx accel (and currently mmap() handler.. sharing mmap() is TBD) pvr /dev/dri/cardn omapgpu: VRAM allocation, kms, and flipping helpers for pvr omapgpu also implements fbdev legacy interface via drm helper fxns CRTC overlay Encoder manager Connector dssdev dss 35

Security Why does it matter? Say you had a multi-user system with user-a and user-b both are in video group So both have permissions to open /dev/fbn, /dev/videon.. Currently user-a is logged in and owns the display Normally x-server would enforce security so user-b could not pop up windows But current v4l driver interface (plus sysfs) lets user-b subvert this user-b opens /dev/video and displays a fake login screen and tricks user-a to type password, for example DRM/DRI, while it allows for rendering directly from other processes than the x- server, it still enforces a security model so the client process must authenticate with the x-server before being granted direct rendering access. Note: while DRM/DRI originated in the x-server world, Android also has a display server (SurfaceFlinger); while the security model maybe isn't much of a concern in Android, the DRM based gfx stack is starting to be used in Android for alignment with (generic) linux. 36