Graphics Development User Guide
Graphics Development User Guide
User Guide
Issue 01
Date 2018-05-15
Copyright © HiSilicon Technologies Co., Ltd. 2018. All rights reserved.
No part of this document may be reproduced or transmitted in any form or by any means without prior
written consent of HiSilicon Technologies Co., Ltd.
, , and other HiSilicon icons are trademarks of HiSilicon Technologies Co., Ltd.
All other trademarks and trade names mentioned in this document are the property of their respective
holders.
Notice
The purchased products, services and features are stipulated by the contract made between HiSilicon and
the customer. All or part of the products, services and features described in this document may not be
within the purchase scope or the usage scope. Unless otherwise specified in the contract, all statements,
information, and recommendations in this document are provided "AS IS" without warranties, guarantees or
representations of any kind, either express or implied.
The information in this document is subject to change without notice. Every effort has been made in the
preparation of this document to ensure accuracy of the contents, but all statements, information, and
recommendations in this document do not constitute a warranty of any kind, express or implied.
Email: support@hisilicon.com
Graphics Development
User Guide About This Document
Purpose
This document provides one schemes for graphics development. The schemes include scheme
description, derivative scheme, development process, application scenarios, and advantages
and limitations.
Related Versions
The following table lists the product versions related to this document.
Hi3536 V100
Hi3521A V100
Hi3520D V300
Hi3531A V100
Hi3531D V100
Hi3521D V100
Hi3536C V100
Hi3536D V100
Hi3520D V400
Intended Audience
This document is intended for:
Technical support personnel
Software development engineers
Symbol Conventions
The symbols that may be found in this document are defined as follows.
Symbol Description
Alerts you to a high risk hazard that could, if not avoided,
result in serious injury or death.
Change History
Updates between document issues are cumulative. Therefore, the latest document issue
contains all updates made in previous issues.
Issue 01(2018-05-15)
This issue is the first official release.
The sction 1.2.3 is modified.
Issue 00B07(2017-11-20)
This issue is the seventh draft release, which incorporates the following changes:
In section 1.2, table 1-1 to table 1-4 are updated.
Issue 00B06(2017-09-08)
This issue is the sixth draft release, which incorporates the following changes:
The description of the Hi3536D V100 is added.
Contents
Figures
Figure 2-1 Schematic diagram of the scheme with a graphics layer ..................................................................... 7
Figure 2-2 Schematic diagram of the derivative scheme ....................................................................................... 8
Tables
Table 1-1 Relationships among the FB device files of the Hi3536, graphics layers, and output devices .............. 1
Table 1-2 Relationships among the FB device files of the Hi3521A, graphics layers, and output devices ........... 2
Table 1-3 Relationships among the FB device files of the Hi3531A/Hi3531D V100/Hi3521D V100/Hi3536C
V100, graphics layers, and output devices ............................................................................................................. 3
Table 1-4 Relationships among the FB device files of the Hi3536D V100, graphics layers, and output devices . 4
1.1 Overview
The HiSilicon digital media processing platform (HiMPP) provides a set of mechanisms for
developing graphical user interfaces (GUIs). The mechanisms consist of:
Two-dimensional engine (TDE). It processes graphics through hardware acceleration.
HiSilicon frame buffer (HiFB). It manages graphics layers. Besides the basic functions
of the Linux FB, it also provides the extended functions such as inter-layer colorkey and
inter-layer alpha.
For details on how to use the TDE, see the TDE API Reference.
For details on how to use the HiFB, see the HiFB Development Guide and HiFB API Reference.
Unless otherwise stated, Hi3521A and Hi3520D V300 contents are consistent.
Unless otherwise stated, Hi3521DV100 and Hi3520D V400 contents are consistent.
For details about the interfaces and timings supported by each output device, see section 11.2 "VDP" in
the Hi3536 H.265 Decoder Processor Data Sheet .
Table 1-1 shows the relationships among the FB device files of the Hi3536, graphics layers,
and output devices.
Table 1-1 Relationships among the FB device files of the Hi3536, graphics layers, and output
devices
FB Device Graphics Layer Corresponding Display Device
File
To display graphics layers, you must configure and enable VO devices by calling the interfaces of the
VOU, and operate graphics layers by calling the interfaces of the Hi3536 HiFB.
For details about the interfaces and timings supported by each output device, see section 10.2 "VDP" in
the Hi3521A/Hi3520DV300 H.264 CODEC Processor Data Sheet
Table 1-2 shows the relationships among the FB device files of the Hi3521A, graphics layers,
and output devices.
Table 1-2 Relationships among the FB device files of the Hi3521A, graphics layers, and output
devices
To display graphics layers, you must configure and enable VO devices by calling the interfaces of the
VOU, and operate graphics layers by calling the interfaces of the Hi3521A HiFB.
For details about the interfaces and timings supported by each output device, see section 10.2 "VDP"
in the Hi3531A H.264 CODEC Processor Data Sheet.
For details about the interfaces and timings supported by each output device, see section 11.2 "VDP"
in the Hi3531D V100 H.265 CODEC Processor Data Sheet
For details about the interfaces and timings supported by each output device, see section 11.2 "VDP"
in the Hi3521D V100 H.265 CODEC Processor Data Sheet
For details about the interfaces and timings supported by each output device, see section 11.2 "VDP"
in the Hi3520D V400 H.265 CODEC Processor Data Sheet
For details about the interfaces and timings supported by each output device, see section 11.1 "VDP"
in the Hi3536C V100 H.265 CODEC Processor Data Sheet
Table 1-3 shows the relationships among the FB device files of the Hi3531A/Hi3531D
V100/Hi3521D V100/Hi3536C V100, graphics layers, and output devices.
Table 1-3 Relationships among the FB device files of the Hi3531A/Hi3531D V100/Hi3521D
V100/Hi3536C V100, graphics layers, and output devices
FB Device Graphics Layer Corresponding Display Device
File
To display graphics layers, you must configure and enable VO devices by calling the interfaces of the
VOU, and operate graphics layers by calling the interfaces of the Hi3531A/Hi3531D V100/Hi3521D
V100/Hi3536C V100 HiFB.
For details about the interfaces and timings supported by each output device, see section 9.1 "VDP" in
the Hi3536D V100 H.265/H.264 Decoder Processor Data Sheet
Table 1-4 shows the relationships among the FB device files of the Hi3536D V100, graphics
layers, and output devices.
Table 1-4 Relationships among the FB device files of the Hi3536D V100, graphics layers, and
output devices
To display graphics layers, you must configure and enable VO devices by calling the interfaces of the
VOU, and operate graphics layers by calling the interfaces of the Hi3536D V100 HiFB.
2.1 Overview
In the surveillance field, the GUI contents of an output device include:
Backend OSD: It includes the dividing lines of the displayed picture, channel IDs, and
time that specify the display layout of multiple pictures.
GUI: It includes various menus and progress bars. You can configure devices through the
GUI.
Cursor: It provides user-friendly and convenient menus.
The preceding GUI contents can be implemented through one or more graphics layers. As the
Hi3536, Hi3521A, Hi3531A, Hi3531D V100, Hi3521D V100, or Hi3536C V100 provides
multiple graphics layers, this chapter describes the following recommended schemes to
instruct you to use those graphics layers in a correct, reasonable, and effective manner,
satisfying the requirements in various output GUI applications.
That is, each device draws the GUI by using an independent buffer (also known as GUI
canvas). This canvas needs to be updated partially when the GUI changes.
The GUI canvas is entirely transferred to the display buffer of the corresponding
graphics layer.
When a drawn canvas is entirely transferred to the corresponding display buffer,
transparent blending between the GUI and OSD can be implemented through the TDE.
Each time the GUI or OSD changes, the blended area between the GUI and OSD does
not need to be calculated based on the local information, because blending is performed
on the entire canvas and OSD.
Dual display buffers
To avoid the drawing process being visible when a display buffer is used for drawing and
displaying concurrently, dual display buffers, HIFB_LAYER_BUF_DOUBLE or
HIFB_LAYER_BUF_DOUBLE_IMMEDIATE in the extended mode is recommended.
That is, the HiFB module assigns dual display buffers with the same size for drawing and
displaying alternatively. For example, when buffer 2 is displayed on the VOU, buffer 1 is
used for drawing. For the FB standard mode, after PAN_DISPLAY and
FBIOFLIP_SURFACE of the HiFB are called, the VO device is notified that buffer 1
should be displayed. For the FB extended mode, after FBIO_REFRESH of the HiFB is
called, the VO device is notified that buffer 1 should be displayed.
Figure 2-1 shows the schematic diagram of the scheme with a graphics layer
th bu
e ff
co er
nt
en
ts
When the backend OSD or GUI changes, the OSD or GUI needs to be drawn again in the
display buffer.
When the backend OSD changes (such as the 16-picture dividing line is switched to the
9-picture dividing line), you need to empty the display buffer, draw a new OSD, and then
transfer the entire GUI to the display buffer.
When the GUI changes, you also need to empty the display buffer, draw a new OSD, and
then entirely transfer the new GUI to the display buffer.
Implementing transparency blending between the GUI and OSD through an easy-to-use
process. Each time the GUI or OSD changes, the blended area between the GUI and
OSD does not need to be calculated based on the local information, because blending is
performed on the entire canvas and OSD.
In the derivative scheme, only a set of GUI pictures are required. In this case, the GUI
requirements of the devices with different solutions are met and the space of the flash
memory is saved.
The limitation on the derivative scheme is as follows:
The GUI displayed on the SD device is not as clear as that on the HD device, because the GUI
displayed on the SD device is obtained after being scaled.