Skip to content

Instantly share code, notes, and snippets.

@erwinchang
Last active February 21, 2017 03:59
Show Gist options
  • Save erwinchang/0a8d83c11489bf7c741756c98ba17451 to your computer and use it in GitHub Desktop.
Save erwinchang/0a8d83c11489bf7c741756c98ba17451 to your computer and use it in GitHub Desktop.
hi335板子 hifb log

HI3535 板子

  • HI3535 HiFb
    • 使用ARGB1555 , 16bit
    • Alpha Enable 關閉
    • colorkey 0x7c1f , 即為r(255),g(0),b(255)
# cat hifb0
layer name                       :layer_0 
Open count                       :2
Show state                       :ON
Start position                   :(0, 0)
xres, yres                       :(1280, 720)
xres_virtual, yres_virtual       :(1280, 720)
xoffset, yoffset                 :(0, 0)
fix.line_length                  :2560
Mem size:                        :8100 KB
Layer Scale (hw):                :NO 
ColorFormat:                     :ARGB1555
Alpha Enable                     :OFF
AlphaChannel Enable              :OFF
Alpha0, Alpha1                   :255, 0
Alpha Global                     :0
Colorkey Enable                  :ON
Colorkey value                   :0x7c1f
Deflicker Mode:                  :NONE
Deflicker Level:                 :AUTO
Display Buffer mode              :unkown
Displaying addr (register)       :0xa4e10000
display buffer[0] addr           :0xa4e10000
display buffer[1] addr           :0xa4fd2000
displayrect                      :(1280, 720)
screenrect                       :(1280, 720)
device max resolution            :1280, 720
IsNeedFlip(2buf)                 :NO
BufferIndexDisplaying(2buf)      :0
refresh request num(2buf)        :0
switch buf num(2buf)             :0
union rect (2buf)                :(0,0,0,0)
canavas updated addr             :0x0
canavas updated (w, h)           :0,0 
canvas width                     :0
canvas height                    :0
canvas pitch                     :0
canvas format                    :RGB565
IsCompress                       :NO
Is DDR Dettect                   :NO
DDR Detect Zones                 :0
  • vo 層無輸出(即無send to vdec)時背景顏色
    pstVoPubAttr->u32BgColor = VO_BKGRD_BLUE;
//    pstVoPubAttr->u32BgColor = 0x00001122;

測試圖

colorkey設定說明

  • ARGB1555 format

    • bit0-4 : B
    • bit5-9 : G
    • bit10-14: R
    • bit15 : A
  • hifb

    • ARGB1555 RED數值為0xFC00
	HIFB_COLORKEY_S colorkey;
	colorkey.bKeyEnable = HI_TRUE;
   colorkey.u32Key  =  0xFC00;
	s32Ret = ioctl(pstInfo->fd, FBIOPUT_COLORKEY_HIFB, &colorkey);
	if (s32Ret != HI_SUCCESS)
    {
   	    printf("Put colorkey failed!\n");
   	    return HI_FAILURE;
    }
  • qt
    • 設定背景為RED
#include "widget.h"
#include <QApplication>

#include <QDir>
#include <QScreen>
#include <QWSServer>
#include <QMutex>
#include <QtConcurrentRun>
#include <QFuture>
#include <QFutureWatcher>
#include <QQueue>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    Widget w;

    QWSServer *server = QWSServer::instance();
    QScreen *screen = QScreen::instance();

    server->enablePainting(false);
    screen->shutdownDevice();
    screen->disconnect();
    screen->connect("/dev/fb0");
    screen->initDevice();
    server->enablePainting(true);
    server->refresh();

    //http://blog.csdn.net/yihui8/article/details/43730673
    server->setBackground(QColor(0xff,0x00,0x0,0));

    w.setGeometry(0, 0, 100, 200);
    //w.setStyleSheet("background-color: rgba(0xff,0x0,0x0,0)");
    w.show();

    return a.exec();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment