mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-03 17:51:57 +09:00
merge amlogic linux patches
Change-Id: I2242478cc6641cf96ca82e4d5e8ecd1fb957d78d
This commit is contained in:
committed by
Dongjin Kim
parent
c6dbb7febf
commit
5dee744324
1
Makefile
1
Makefile
@@ -380,7 +380,6 @@ KBUILD_CFLAGS += -Werror=enum-compare \
|
||||
-Werror=implicit-int \
|
||||
-Werror=missing-braces \
|
||||
-Werror=unused-value \
|
||||
-Werror=maybe-uninitialized \
|
||||
-Werror=unused-variable \
|
||||
-Werror=format \
|
||||
-Werror=unused-function \
|
||||
|
||||
@@ -207,7 +207,7 @@ typedef union phy_tune_data {
|
||||
#define USB_BC_MODE_CDP 3 /* PC + Charger */
|
||||
|
||||
#define USB_CORE_RESET_TIME 200
|
||||
#define USB_ID_CHANGE_TIME 100
|
||||
#define USB_ID_CHANGE_TIME 200
|
||||
|
||||
int clk_enable_usb(struct clk *clk);
|
||||
int clk_disable_usb(struct clk *clk);
|
||||
|
||||
11
arch/arm/mach-meson6/include/mach/usbclock.h.rej
Normal file
11
arch/arm/mach-meson6/include/mach/usbclock.h.rej
Normal file
@@ -0,0 +1,11 @@
|
||||
--- arch/arm/mach-meson6/include/mach/usbclock.h.orig 2014-07-18 11:36:55.687502450 +0800
|
||||
+++ arch/arm/mach-meson6/include/mach/usbclock.h 2014-07-18 11:37:02.943502586 +0800
|
||||
@@ -207,7 +207,7 @@
|
||||
#define USB_BC_MODE_CDP 3 /* PC + Charger */
|
||||
|
||||
#define USB_CORE_RESET_TIME 200
|
||||
-#define USB_ID_CHANGE_TIME 100
|
||||
+#define USB_ID_CHANGE_TIME 200
|
||||
|
||||
int clk_enable_usb(struct clk *clk);
|
||||
int clk_disable_usb(struct clk *clk);
|
||||
@@ -103,6 +103,11 @@ config FB_OSD1_DEFAULT_HEIGHT_VIRTUAL
|
||||
---help---
|
||||
The default osd1/fb0 virtual height. Does not affect ability to change height using fbset or FBIOPUT ioctl.
|
||||
|
||||
|
||||
config FB_AMLOGIC_UMP
|
||||
bool "amlogic ump"
|
||||
default y
|
||||
depends on FB_AM
|
||||
help
|
||||
enable osd ump when we use mali for x11
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -13,9 +13,12 @@ endif
|
||||
|
||||
obj-$(CONFIG_VSYNC_RDMA) += osd_rdma.o
|
||||
|
||||
EXTRA_CFLAGS += -Iinclude/linux/osd/
|
||||
|
||||
|
||||
|
||||
|
||||
EXTRA_CFLAGS += -Iinclude/linux/amlogic/osd/
|
||||
ifeq ($(CONFIG_FB_AMLOGIC_UMP),y)
|
||||
fb-objs += osd_ump.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_FB_AMLOGIC_UMP),y)
|
||||
EXTRA_CFLAGS += -I../hardware/arm/gpu/ump/include/
|
||||
endif
|
||||
|
||||
|
||||
@@ -343,6 +343,15 @@ void osddev_cursor(struct myfb_dev *fbdev, s16 x, s16 y, s16 xstart, s16 ystart,
|
||||
}
|
||||
#endif
|
||||
|
||||
int osddev_copy_data_tocursor(myfb_dev_t *g_fbi, aml_hwc_addr_t *cursor_mem)
|
||||
{
|
||||
if (cursor_mem == NULL){
|
||||
return 0;
|
||||
}
|
||||
osddev_copy_data_tocursor_hw((u32)g_fbi->fb_mem_vaddr, cursor_mem);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void osddev_set_colorkey(u32 index,u32 bpp,u32 colorkey )
|
||||
{
|
||||
osd_set_colorkey_hw( index, bpp, colorkey );
|
||||
|
||||
@@ -2641,7 +2641,6 @@ void osd_init_hw(u32 logo_loaded)
|
||||
osd_hw.color_info[OSD2]=NULL;
|
||||
vf.width =vf.height=0;
|
||||
osd_hw.color_key[OSD1]=osd_hw.color_key[OSD2]=0xffffffff;
|
||||
osd_hw.free_scale_enable[OSD1]=osd_hw.free_scale_enable[OSD2]=0;
|
||||
osd_hw.scale[OSD1].h_enable=osd_hw.scale[OSD1].v_enable=0;
|
||||
osd_hw.scale[OSD2].h_enable=osd_hw.scale[OSD2].v_enable=0;
|
||||
osd_hw.mode_3d[OSD2].enable=osd_hw.mode_3d[OSD1].enable=0;
|
||||
@@ -2660,6 +2659,12 @@ void osd_init_hw(u32 logo_loaded)
|
||||
osd_hw.free_scale_mode[OSD1] = osd_hw.free_scale_mode[OSD2] = 0;
|
||||
#endif
|
||||
|
||||
#if MESON_CPU_TYPE >= MESON_CPU_TYPE_MESON8
|
||||
osd_hw.free_scale_mode[OSD1] = osd_hw.free_scale_mode[OSD2] = 1;
|
||||
#else
|
||||
osd_hw.free_scale_mode[OSD1] = osd_hw.free_scale_mode[OSD2] = 0;
|
||||
#endif
|
||||
|
||||
memset(osd_hw.rotate,0,sizeof(osd_rotate_t));
|
||||
|
||||
#ifdef FIQ_VSYNC
|
||||
@@ -2779,6 +2784,33 @@ void osd_cursor_hw(s16 x, s16 y, s16 xstart, s16 ystart, u32 osd_w, u32 osd_h, i
|
||||
}
|
||||
#endif //CONFIG_FB_OSD2_CURSOR
|
||||
|
||||
void osddev_copy_data_tocursor_hw(u32 cursor_mem_vaddr, aml_hwc_addr_t *hwc_mem)
|
||||
{
|
||||
u32 tmp;
|
||||
u32 i;
|
||||
u32 value_pixel = 0;
|
||||
u32 size = 32*32*4;
|
||||
|
||||
if (hwc_mem->addr & 0x3) { /* Address not 32bit aligned */
|
||||
for (i = 0; i < size; i += 4) {
|
||||
tmp = readb(hwc_mem->addr + i);
|
||||
value_pixel = tmp;
|
||||
tmp = readb(hwc_mem->addr + i + 1);
|
||||
value_pixel |= (tmp << 8);
|
||||
tmp = readb(hwc_mem->addr + i + 2);
|
||||
value_pixel |= (tmp << 16);
|
||||
tmp = readb(hwc_mem->addr + i + 3);
|
||||
value_pixel |= (tmp << 24);
|
||||
writel(value_pixel, cursor_mem_vaddr+ i);
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < size; i += 4) {
|
||||
tmp = readl(hwc_mem->addr + i);
|
||||
writel(tmp, cursor_mem_vaddr+ i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void osd_suspend_hw(void)
|
||||
{
|
||||
osd_hw.reg_status_save = aml_read_reg32(P_VPP_MISC) & OSD_RELATIVE_BITS;
|
||||
|
||||
@@ -96,7 +96,11 @@ _find_color_format(struct fb_var_screeninfo * var)
|
||||
lower_margin=COLOR_INDEX_24_6666_A;
|
||||
break;
|
||||
case 3:
|
||||
#ifdef CONFIG_FB_AMLOGIC_UMP
|
||||
upper_margin=COLOR_INDEX_32_ARGB;
|
||||
#else
|
||||
upper_margin=COLOR_INDEX_32_ABGR;
|
||||
#endif
|
||||
lower_margin=COLOR_INDEX_32_BGRA;
|
||||
break;
|
||||
case 4:
|
||||
@@ -267,6 +271,12 @@ osd_setcmap(struct fb_cmap *cmap, struct fb_info *info)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_FB_AMLOGIC_UMP
|
||||
int (*disp_get_ump_secure_id) (struct fb_info *info, myfb_dev_t *g_fbi,
|
||||
unsigned long arg, int buf);
|
||||
EXPORT_SYMBOL(disp_get_ump_secure_id);
|
||||
#endif
|
||||
|
||||
static int
|
||||
osd_ioctl(struct fb_info *info, unsigned int cmd,
|
||||
unsigned long arg)
|
||||
@@ -284,6 +294,11 @@ osd_ioctl(struct fb_info *info, unsigned int cmd,
|
||||
unsigned long ret;
|
||||
u32 flush_rate;
|
||||
|
||||
unsigned int karg = 0;
|
||||
#ifdef CONFIG_FB_AMLOGIC_UMP
|
||||
int secure_id_buf_num = 0;
|
||||
#endif
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
case FBIOPUT_OSD_SRCKEY_ENABLE:
|
||||
@@ -328,6 +343,44 @@ osd_ioctl(struct fb_info *info, unsigned int cmd,
|
||||
case FBIOPUT_OSD_WINDOW_AXIS:
|
||||
ret=copy_from_user(&osd_dst_axis, argp, 4 * sizeof(s32));
|
||||
break;
|
||||
#ifdef CONFIG_FB_AMLOGIC_UMP
|
||||
case GET_UMP_SECURE_ID_BUF2: /* flow trough */
|
||||
{
|
||||
secure_id_buf_num = 1;
|
||||
if (!disp_get_ump_secure_id)
|
||||
request_module("osd_ump");
|
||||
if (disp_get_ump_secure_id)
|
||||
return disp_get_ump_secure_id(info, fbdev, arg,
|
||||
secure_id_buf_num);
|
||||
else
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
break;
|
||||
case GET_UMP_SECURE_ID_BUF1: /* flow trough */
|
||||
{
|
||||
secure_id_buf_num = 0;
|
||||
if (!disp_get_ump_secure_id)
|
||||
request_module("osd_ump");
|
||||
if (disp_get_ump_secure_id)
|
||||
return disp_get_ump_secure_id(info, fbdev, arg,
|
||||
secure_id_buf_num);
|
||||
else
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case FBIOPUT_OSD2_CURSOR_DATA:
|
||||
{
|
||||
if (copy_from_user(&karg, argp, sizeof(unsigned int))) {
|
||||
return -EFAULT;
|
||||
}
|
||||
aml_hwc_addr_t para;
|
||||
if (copy_from_user(¶, (void __user *)karg, sizeof(aml_hwc_addr_t))) {
|
||||
return -EFAULT;
|
||||
}
|
||||
ret = osddev_copy_data_tocursor(fbdev, ¶);
|
||||
}
|
||||
break;
|
||||
default :
|
||||
amlog_mask_level(LOG_MASK_IOCTL,LOG_LEVEL_HIGH,"command not supported\r\n ");
|
||||
return -1;
|
||||
|
||||
68
drivers/amlogic/display/osd/osd_ump.c
Normal file
68
drivers/amlogic/display/osd/osd_ump.c
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Amlogic
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <ump/ump_kernel_interface_ref_drv.h>
|
||||
#include <ump/ump_kernel_interface.h>
|
||||
#include <osd_dev.h>
|
||||
#include <osd.h>
|
||||
#include <osd_main.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
static int _disp_get_ump_secure_id(struct fb_info *info, myfb_dev_t *g_fbi,
|
||||
unsigned long arg, int buf)
|
||||
{
|
||||
u32 __user *psecureid = (u32 __user *) arg;
|
||||
ump_secure_id secure_id;
|
||||
|
||||
if (!g_fbi->ump_wrapped_buffer[info->node][buf]) {
|
||||
printk("create_disp_get_ump_secure_id******%d\n", buf);
|
||||
ump_dd_physical_block ump_memory_description;
|
||||
|
||||
ump_memory_description.addr = info->fix.smem_start;
|
||||
ump_memory_description.size = info->fix.smem_len;
|
||||
g_fbi->ump_wrapped_buffer[info->node][buf] =
|
||||
ump_dd_handle_create_from_phys_blocks(&ump_memory_description, 1);
|
||||
}
|
||||
secure_id = ump_dd_secure_id_get(g_fbi->ump_wrapped_buffer[info->node][buf]);
|
||||
return put_user((unsigned int)secure_id, psecureid);
|
||||
}
|
||||
|
||||
static int __init osd_ump_module_init(void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
disp_get_ump_secure_id = _disp_get_ump_secure_id;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void __exit osd_ump_module_exit(void)
|
||||
{
|
||||
disp_get_ump_secure_id = NULL;
|
||||
}
|
||||
|
||||
module_init(osd_ump_module_init);
|
||||
module_exit(osd_ump_module_exit);
|
||||
|
||||
MODULE_AUTHOR("Amlogic BJ Platform");
|
||||
MODULE_DESCRIPTION("amlogic display driver MALI UMP module");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
@@ -227,7 +227,7 @@ void Edid_CompareTimingDescriptors(HDMI_TX_INFO_t * info, unsigned char *Data)
|
||||
{
|
||||
for(index2=0;index2<12;index2++)
|
||||
{
|
||||
if(Data[index2]!=Edid_TimingDescriptors[index1*14+index2])
|
||||
if(Data[index2]!=Edid_TimingDescriptors[index1*12+index2])
|
||||
break;
|
||||
}
|
||||
if(index2==12)
|
||||
|
||||
@@ -199,6 +199,13 @@ config DRM_SAVAGE
|
||||
Choose this option if you have a Savage3D/4/SuperSavage/Pro/Twister
|
||||
chipset. If M is selected the module will be called savage.
|
||||
|
||||
config DRM_MALI
|
||||
tristate "arm mali cards"
|
||||
depends on DRM
|
||||
help
|
||||
Choose this option if you have a ARM GPU Mali.
|
||||
If M is selected the module will be called arm.
|
||||
|
||||
source "drivers/gpu/drm/exynos/Kconfig"
|
||||
|
||||
source "drivers/gpu/drm/vmwgfx/Kconfig"
|
||||
|
||||
@@ -41,6 +41,7 @@ obj-$(CONFIG_DRM_MGAG200) += mgag200/
|
||||
obj-$(CONFIG_DRM_CIRRUS_QEMU) += cirrus/
|
||||
obj-$(CONFIG_DRM_SIS) += sis/
|
||||
obj-$(CONFIG_DRM_SAVAGE)+= savage/
|
||||
obj-$(CONFIG_DRM_MALI) += mali_drm/
|
||||
obj-$(CONFIG_DRM_VMWGFX)+= vmwgfx/
|
||||
obj-$(CONFIG_DRM_VIA) +=via/
|
||||
obj-$(CONFIG_DRM_NOUVEAU) +=nouveau/
|
||||
|
||||
@@ -55,7 +55,10 @@ typedef enum {
|
||||
|
||||
}color_index_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
unsigned int addr;
|
||||
} aml_hwc_addr_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
color_index_t color_index;
|
||||
|
||||
@@ -28,13 +28,14 @@
|
||||
#include "osd.h"
|
||||
#include <linux/amlogic/vout/vinfo.h>
|
||||
#include <linux/amlogic/logo/logo.h>
|
||||
|
||||
#include "../../../../../hardware/arm/gpu/ump/include/ump/ump_kernel_interface.h"
|
||||
#define OSD_COUNT 2 /* we have two osd layer on hardware*/
|
||||
|
||||
#define KEYCOLOR_FLAG_TARGET 1
|
||||
#define KEYCOLOR_FLAG_ONHOLD 2
|
||||
#define KEYCOLOR_FLAG_CURRENT 4
|
||||
|
||||
#define OSD_MAX_FB 2
|
||||
typedef struct myfb_dev {
|
||||
struct mutex lock;
|
||||
|
||||
@@ -54,6 +55,9 @@ typedef struct myfb_dev {
|
||||
u32 preblend_enable;
|
||||
u32 enable_key_flag;
|
||||
u32 color_key;
|
||||
#ifdef CONFIG_FB_AMLOGIC_UMP
|
||||
ump_dd_handle ump_wrapped_buffer[OSD_MAX_FB][2];
|
||||
#endif
|
||||
} myfb_dev_t;
|
||||
typedef struct list_head list_head_t ;
|
||||
|
||||
@@ -125,7 +129,7 @@ extern void osddev_pan_display(struct fb_var_screeninfo *var,struct fb_info *fbi
|
||||
#if defined (CONFIG_FB_OSD2_CURSOR)
|
||||
extern void osddev_cursor(struct myfb_dev *fbdev, s16 x, s16 y, s16 xstart, s16 ystart, u32 osd_w, u32 osd_h);
|
||||
#endif
|
||||
|
||||
extern int osddev_copy_data_tocursor(myfb_dev_t *g_fbi, aml_hwc_addr_t *cursor_mem);
|
||||
extern void osddev_set_colorkey(u32 index,u32 bpp,u32 colorkey );
|
||||
extern void osddev_srckey_enable(u32 index,u8 enable);
|
||||
extern void osddev_set_gbl_alpha(u32 index,u32 gbl_alpha) ;
|
||||
|
||||
@@ -121,6 +121,7 @@ extern void osd_pan_display_hw(unsigned int xoffset, unsigned int yoffset,int in
|
||||
#if defined(CONFIG_FB_OSD2_CURSOR)
|
||||
extern void osd_cursor_hw(s16 x, s16 y, s16 xstart, s16 ystart, u32 osd_w, u32 osd_h, int index);
|
||||
#endif
|
||||
extern void osddev_copy_data_tocursor_hw(u32 cursor_mem_paddr, aml_hwc_addr_t *hwc_mem);
|
||||
extern void osd_suspend_hw(void);
|
||||
extern void osd_resume_hw(void);
|
||||
extern void osd_init_hw(u32 logo_loaded);
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#define OSD_MAIN_H
|
||||
#include <linux/list.h>
|
||||
#include <linux/amlogic/vout/vout_notify.h>
|
||||
#include <linux/amlogic/osd/osd_dev.h>
|
||||
#include <linux/fb.h>
|
||||
|
||||
static __u32 var_screeninfo[5];
|
||||
@@ -161,6 +162,10 @@ typedef struct {
|
||||
#define FBIOPUT_OSD_ROTATE_ON 0x4516
|
||||
#define FBIOPUT_OSD_ROTATE_ANGLE 0x4517
|
||||
|
||||
#define GET_UMP_SECURE_ID_BUF1 _IOWR('m', 311, unsigned int)
|
||||
#define GET_UMP_SECURE_ID_BUF2 _IOWR('m', 312, unsigned int)
|
||||
#define FBIOPUT_OSD2_CURSOR_DATA _IOWR('m', 313, unsigned int)
|
||||
|
||||
#define OSD_INVALID_INFO 0xffffffff
|
||||
|
||||
#define OSD_FIRST_GROUP_START 1
|
||||
@@ -194,4 +199,9 @@ typedef enum{
|
||||
REVERSE_MAX
|
||||
}reverse_info_t;
|
||||
|
||||
#ifdef CONFIG_FB_AMLOGIC_UMP
|
||||
extern int (*disp_get_ump_secure_id) (struct fb_info *info, myfb_dev_t *g_fbi,
|
||||
unsigned long arg, int buf);
|
||||
#endif
|
||||
|
||||
#endif /* OSD_MAIN_H */
|
||||
|
||||
Reference in New Issue
Block a user