Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c9288149 authored by Petr Havlena's avatar Petr Havlena Committed by Gerrit Code Review
Browse files

exynos3: libhdmi: initial commit

Change-Id: Iee23cf3b6e746c3a20adf7b90ab930a3cba50d5c
parent 1386f44a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
ifeq ($(TARGET_BOARD_PLATFORM),s5pc110)

# audio, camera, sensor and light HALs are device specifc
s5pc110_dirs := libhwcomposer libs3cjpeg libstagefrighthw sec_mm power
s5pc110_dirs := libhdmi libhwcomposer libs3cjpeg libstagefrighthw sec_mm power

include $(call all-named-subdir-makefiles,$(s5pc110_dirs))

+189 −0
Original line number Diff line number Diff line
/*
 * Copyright@ Samsung Electronics Co. LTD
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef __S5P_TVOUT_H__
#define __S5P_TVOUT_H__

#include <linux/fb.h>
#include <linux/videodev2.h>

#ifdef __cplusplus
extern "C" {
#endif

/*******************************************
 * Define
 *******************************************/
/* TVOUT control */

#define TVOUT_DEV       "/dev/video14"
#define TVOUT_DEV_V     "/dev/video21"
#define TVOUT_DEV_V2    "/dev/video22"

/* ------------- Output -----------------*/
/* type */
#define V4L2_OUTPUT_TYPE_MSDMA          4
#define V4L2_OUTPUT_TYPE_COMPOSITE      5
#define V4L2_OUTPUT_TYPE_SVIDEO         6
#define V4L2_OUTPUT_TYPE_YPBPR_INERLACED   7
#define V4L2_OUTPUT_TYPE_YPBPR_PROGRESSIVE 8
#define V4L2_OUTPUT_TYPE_RGB_PROGRESSIVE   9
#define V4L2_OUTPUT_TYPE_DIGITAL        10
#define V4L2_OUTPUT_TYPE_HDMI           V4L2_OUTPUT_TYPE_DIGITAL
#define V4L2_OUTPUT_TYPE_HDMI_RGB       11
#define V4L2_OUTPUT_TYPE_DVI            12

/* ------------- STD -------------------*/
#define V4L2_STD_PAL_BDGHI\
 (V4L2_STD_PAL_B|V4L2_STD_PAL_D|V4L2_STD_PAL_G|V4L2_STD_PAL_H|V4L2_STD_PAL_I)

#define V4L2_STD_480P_60_16_9           ((v4l2_std_id)0x04000000)
#define V4L2_STD_480P_60_4_3            ((v4l2_std_id)0x05000000)
#define V4L2_STD_576P_50_16_9           ((v4l2_std_id)0x06000000)
#define V4L2_STD_576P_50_4_3            ((v4l2_std_id)0x07000000)
#define V4L2_STD_720P_60                ((v4l2_std_id)0x08000000)
#define V4L2_STD_720P_50                ((v4l2_std_id)0x09000000)
#define V4L2_STD_1080P_60               ((v4l2_std_id)0x0a000000)
#define V4L2_STD_1080P_50               ((v4l2_std_id)0x0b000000)
#define V4L2_STD_1080I_60               ((v4l2_std_id)0x0c000000)
#define V4L2_STD_1080I_50               ((v4l2_std_id)0x0d000000)
#define V4L2_STD_480P_59                ((v4l2_std_id)0x0e000000)
#define V4L2_STD_720P_59                ((v4l2_std_id)0x0f000000)
#define V4L2_STD_1080I_59               ((v4l2_std_id)0x10000000)
#define V4L2_STD_1080P_59               ((v4l2_std_id)0x11000000)
#define V4L2_STD_1080P_30               ((v4l2_std_id)0x12000000)
#define V4L2_STD_TVOUT_720P_60_SBS_HALF ((v4l2_std_id)0x13000000)
#define V4L2_STD_TVOUT_720P_59_SBS_HALF ((v4l2_std_id)0x14000000)
#define V4L2_STD_TVOUT_720P_50_TB       ((v4l2_std_id)0x15000000)
#define V4L2_STD_TVOUT_1080P_24_TB      ((v4l2_std_id)0x16000000)
#define V4L2_STD_TVOUT_1080P_23_TB      ((v4l2_std_id)0x17000000)

/* ------------- Input ------------------*/
/* type */
#define V4L2_INPUT_TYPE_MSDMA           3
#define V4L2_INPUT_TYPE_FIFO            4

/* TVOUT video */
#define PFX_NODE_FB "/dev/graphics/fb"

/*******************************************
 * structures
 *******************************************/

/* TVOUT */
struct v4l2_vid_overlay_src {
    void            *base_y;
    void            *base_c;
    struct v4l2_pix_format  pix_fmt;
};

struct v4l2_window_s5p_tvout {
    __u32       capability;
    __u32       flags;
    __u32       priority;
    struct v4l2_window  win;
};

struct v4l2_pix_format_s5p_tvout {
    void *base_y;
    void *base_c;
    __u32 src_img_endian;
    struct v4l2_pix_format  pix_fmt;
};

struct vid_overlay_param {
    struct v4l2_vid_overlay_src     src;
    struct v4l2_rect                src_crop;
    struct v4l2_framebuffer         dst;
    struct v4l2_window              dst_win;
};

struct tvout_param {
    struct v4l2_pix_format_s5p_tvout    tvout_src;
    struct v4l2_window_s5p_tvout        tvout_rect;
    struct v4l2_rect                    tvout_dst;
};

struct overlay_param {
    struct v4l2_framebuffer         overlay_frame;
    struct v4l2_window_s5p_tvout    overlay_rect;
    struct v4l2_rect                overlay_dst;
};

/* FB */
struct s5ptvfb_user_window {
    int x;
    int y;
};

struct s5ptvfb_user_plane_alpha {
    int channel;
    unsigned char alpha;
};

struct s5ptvfb_user_chroma {
    int enabled;
    unsigned char red;
    unsigned char green;
    unsigned char blue;
};

enum s5ptvfb_ver_scaling_t {
    VERTICAL_X1,
    VERTICAL_X2,
};

enum s5ptvfb_hor_scaling_t {
    HORIZONTAL_X1,
    HORIZONTAL_X2,
};

struct s5ptvfb_user_scaling {
    enum s5ptvfb_ver_scaling_t ver;
    enum s5ptvfb_hor_scaling_t hor;
};

/*******************************************
 * custom ioctls
 *******************************************/

#define VIDIOC_S_BASEADDR               _IOR('V', 83, int)

#define VIDIOC_HDCP_ENABLE              _IOWR('V', 100, unsigned int)
#define VIDIOC_HDCP_STATUS              _IOR('V', 101, unsigned int)
#define VIDIOC_HDCP_PROT_STATUS         _IOR('V', 102, unsigned int)

#define VIDIOC_INIT_AUDIO               _IOR('V', 103, unsigned int)
#define VIDIOC_AV_MUTE                  _IOR('V', 104, unsigned int)
#define VIDIOC_G_AVMUTE                 _IOR('V', 105, unsigned int)
#define HPD_GET_STATE                   _IOR('H', 100, unsigned int)

#define S5PTVFB_WIN_POSITION            _IOW('F', 213, struct s5ptvfb_user_window)
#define S5PTVFB_WIN_SET_PLANE_ALPHA     _IOW('F', 214, struct s5ptvfb_user_plane_alpha)
#define S5PTVFB_WIN_SET_CHROMA          _IOW('F', 215, struct s5ptvfb_user_chroma)

#define S5PTVFB_SET_VSYNC_INT           _IOW('F', 216, unsigned int)
#define S5PTVFB_WAITFORVSYNC            _IO('F', 32)
#define S5PTVFB_WIN_SET_ADDR            _IOW('F', 219, unsigned int)
#define S5PTVFB_SET_WIN_ON              _IOW('F', 220, unsigned int)
#define S5PTVFB_SET_WIN_OFF             _IOW('F', 221, unsigned int)
#define S5PTVFB_SCALING                 _IOW('F', 222, struct s5ptvfb_user_scaling)

#ifdef __cplusplus
}
#endif

#endif /* __S5P_TVOUT_H__ */
+16 −2
Original line number Diff line number Diff line
@@ -26,6 +26,18 @@ struct secfb_user_window {
    int y;
};

struct s3cfb_next_info {
    unsigned int phy_start_addr;
    unsigned int xres;              /* visible resolution*/
    unsigned int yres;
    unsigned int xres_virtual;      /* virtual resolution*/
    unsigned int yres_virtual;
    unsigned int xoffset;           /* offset from virtual to visible */
    unsigned int yoffset;           /* resolution */
    unsigned int lcd_offset_x;
    unsigned int lcd_offset_y;
};

/*
 * C U S T O M  I O C T L S
 *
@@ -34,13 +46,15 @@ struct secfb_user_window {
#define FBIO_WAITFORVSYNC       _IO  ('F', 32)
#define SECFB_WIN_POSITION      _IOW ('F', 203, struct secfb_user_window)
#define S3CFB_SET_VSYNC_INT     _IOW ('F', 206, uint32_t)
#define S3CFB_GET_CURR_FB_INFO  _IOR ('F', 305, struct s3cfb_next_info)
#define S3CFB_WAIT_FOR_VSYNC    _IOR ('F', 311, uint64_t)

#define DEFAULT_LCD_WIDTH   (480)
#define DEFAULT_LCD_HEIGHT  (800)
#define DEFAULT_LCD_WIDTH   (600)
#define DEFAULT_LCD_HEIGHT  (1024)
#define DEFAULT_LCD_BPP     (32)

/***************** LCD frame buffer *****************/
#define S3CFB_SIZE  5
#define FB0_NAME    "/dev/fb0"
#define FB1_NAME    "/dev/fb1"
#define FB2_NAME    "/dev/fb2"
+2 −0
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@
//---------------------------------------------------------//

#include <hardware/hardware.h>
#include <utils/Log.h>

#include "sec_format.h"

#ifdef __cplusplus
+38 −0
Original line number Diff line number Diff line
# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_CFLAGS := -fno-short-enums
LOCAL_CFLAGS += -DLOG_TAG=\"hdmi.$(TARGET_BOARD_PLATFORM)\"

LOCAL_C_INCLUDES := \
    $(LOCAL_PATH)/../include

LOCAL_SRC_FILES := \
    fimc.c \
    fimd.c \
    SecHDMI.cpp \
    hal_module.cpp

LOCAL_MODULE := hdmi.$(TARGET_BOARD_PLATFORM)
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
LOCAL_MODULE_TAGS := optional

LOCAL_SHARED_LIBRARIES := liblog libutils
 
include $(BUILD_SHARED_LIBRARY)

include $(call all-makefiles-under,$(LOCAL_PATH))
Loading