Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
7a992d3e
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7a992d3e
编写于
10月 18, 2012
作者:
T
Tomi Valkeinen
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.8/vrfb-conversion'
Merge omap vrfb code to remove direct omap platform dependencies from the driver.
上级
9253d2d8
a89d1a87
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
191 addition
and
55 deletion
+191
-55
arch/arm/mach-omap2/sdrc.c
arch/arm/mach-omap2/sdrc.c
+0
-16
arch/arm/plat-omap/fb.c
arch/arm/plat-omap/fb.c
+61
-0
arch/arm/plat-omap/include/plat/sdrc.h
arch/arm/plat-omap/include/plat/sdrc.h
+0
-7
drivers/media/platform/omap/omap_vout.c
drivers/media/platform/omap/omap_vout.c
+1
-1
drivers/media/platform/omap/omap_vout_vrfb.c
drivers/media/platform/omap/omap_vout_vrfb.c
+1
-1
drivers/media/platform/omap/omap_voutdef.h
drivers/media/platform/omap/omap_voutdef.h
+1
-1
drivers/video/omap2/omapfb/omapfb-ioctl.c
drivers/video/omap2/omapfb/omapfb-ioctl.c
+1
-1
drivers/video/omap2/omapfb/omapfb-main.c
drivers/video/omap2/omapfb/omapfb-main.c
+2
-6
drivers/video/omap2/omapfb/omapfb-sysfs.c
drivers/video/omap2/omapfb/omapfb-sysfs.c
+1
-1
drivers/video/omap2/vrfb.c
drivers/video/omap2/vrfb.c
+121
-21
include/video/omapvrfb.h
include/video/omapvrfb.h
+2
-0
未找到文件。
arch/arm/mach-omap2/sdrc.c
浏览文件 @
7a992d3e
...
...
@@ -160,19 +160,3 @@ void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
sdrc_write_reg
(
l
,
SDRC_POWER
);
omap2_sms_save_context
();
}
void
omap2_sms_write_rot_control
(
u32
val
,
unsigned
ctx
)
{
sms_write_reg
(
val
,
SMS_ROT_CONTROL
(
ctx
));
}
void
omap2_sms_write_rot_size
(
u32
val
,
unsigned
ctx
)
{
sms_write_reg
(
val
,
SMS_ROT_SIZE
(
ctx
));
}
void
omap2_sms_write_rot_physical_ba
(
u32
val
,
unsigned
ctx
)
{
sms_write_reg
(
val
,
SMS_ROT_PHYSICAL_BA
(
ctx
));
}
arch/arm/plat-omap/fb.c
浏览文件 @
7a992d3e
...
...
@@ -33,6 +33,67 @@
#include <mach/hardware.h>
#include <asm/mach/map.h>
#include <plat/cpu.h>
#ifdef CONFIG_OMAP2_VRFB
/*
* The first memory resource is the register region for VRFB,
* the rest are VRFB virtual memory areas for each VRFB context.
*/
static
const
struct
resource
omap2_vrfb_resources
[]
=
{
DEFINE_RES_MEM_NAMED
(
0x68008000u
,
0x40
,
"vrfb-regs"
),
DEFINE_RES_MEM_NAMED
(
0x70000000u
,
0x4000000
,
"vrfb-area-0"
),
DEFINE_RES_MEM_NAMED
(
0x74000000u
,
0x4000000
,
"vrfb-area-1"
),
DEFINE_RES_MEM_NAMED
(
0x78000000u
,
0x4000000
,
"vrfb-area-2"
),
DEFINE_RES_MEM_NAMED
(
0x7c000000u
,
0x4000000
,
"vrfb-area-3"
),
};
static
const
struct
resource
omap3_vrfb_resources
[]
=
{
DEFINE_RES_MEM_NAMED
(
0x6C000180u
,
0xc0
,
"vrfb-regs"
),
DEFINE_RES_MEM_NAMED
(
0x70000000u
,
0x4000000
,
"vrfb-area-0"
),
DEFINE_RES_MEM_NAMED
(
0x74000000u
,
0x4000000
,
"vrfb-area-1"
),
DEFINE_RES_MEM_NAMED
(
0x78000000u
,
0x4000000
,
"vrfb-area-2"
),
DEFINE_RES_MEM_NAMED
(
0x7c000000u
,
0x4000000
,
"vrfb-area-3"
),
DEFINE_RES_MEM_NAMED
(
0xe0000000u
,
0x4000000
,
"vrfb-area-4"
),
DEFINE_RES_MEM_NAMED
(
0xe4000000u
,
0x4000000
,
"vrfb-area-5"
),
DEFINE_RES_MEM_NAMED
(
0xe8000000u
,
0x4000000
,
"vrfb-area-6"
),
DEFINE_RES_MEM_NAMED
(
0xec000000u
,
0x4000000
,
"vrfb-area-7"
),
DEFINE_RES_MEM_NAMED
(
0xf0000000u
,
0x4000000
,
"vrfb-area-8"
),
DEFINE_RES_MEM_NAMED
(
0xf4000000u
,
0x4000000
,
"vrfb-area-9"
),
DEFINE_RES_MEM_NAMED
(
0xf8000000u
,
0x4000000
,
"vrfb-area-10"
),
DEFINE_RES_MEM_NAMED
(
0xfc000000u
,
0x4000000
,
"vrfb-area-11"
),
};
static
int
__init
omap_init_vrfb
(
void
)
{
struct
platform_device
*
pdev
;
const
struct
resource
*
res
;
unsigned
int
num_res
;
if
(
cpu_is_omap24xx
())
{
res
=
omap2_vrfb_resources
;
num_res
=
ARRAY_SIZE
(
omap2_vrfb_resources
);
}
else
if
(
cpu_is_omap34xx
())
{
res
=
omap3_vrfb_resources
;
num_res
=
ARRAY_SIZE
(
omap3_vrfb_resources
);
}
else
{
return
0
;
}
pdev
=
platform_device_register_resndata
(
NULL
,
"omapvrfb"
,
-
1
,
res
,
num_res
,
NULL
,
0
);
if
(
IS_ERR
(
pdev
))
return
PTR_ERR
(
pdev
);
else
return
0
;
}
arch_initcall
(
omap_init_vrfb
);
#endif
#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
static
bool
omapfb_lcd_configured
;
...
...
arch/arm/plat-omap/include/plat/sdrc.h
浏览文件 @
7a992d3e
...
...
@@ -94,9 +94,6 @@
/* SMS register offsets - read/write with sms_{read,write}_reg() */
#define SMS_SYSCONFIG 0x010
#define SMS_ROT_CONTROL(context) (0x180 + 0x10 * context)
#define SMS_ROT_SIZE(context) (0x184 + 0x10 * context)
#define SMS_ROT_PHYSICAL_BA(context) (0x188 + 0x10 * context)
/* REVISIT: fill in other SMS registers here */
...
...
@@ -137,10 +134,6 @@ int omap2_sdrc_get_params(unsigned long r,
void
omap2_sms_save_context
(
void
);
void
omap2_sms_restore_context
(
void
);
void
omap2_sms_write_rot_control
(
u32
val
,
unsigned
ctx
);
void
omap2_sms_write_rot_size
(
u32
val
,
unsigned
ctx
);
void
omap2_sms_write_rot_physical_ba
(
u32
val
,
unsigned
ctx
);
#ifdef CONFIG_ARCH_OMAP2
struct
memory_timings
{
...
...
drivers/media/platform/omap/omap_vout.c
浏览文件 @
7a992d3e
...
...
@@ -46,7 +46,7 @@
#include <plat/cpu.h>
#include <plat/dma.h>
#include <
plat/
vrfb.h>
#include <
video/omap
vrfb.h>
#include <video/omapdss.h>
#include "omap_voutlib.h"
...
...
drivers/media/platform/omap/omap_vout_vrfb.c
浏览文件 @
7a992d3e
...
...
@@ -17,7 +17,7 @@
#include <media/v4l2-device.h>
#include <plat/dma.h>
#include <
plat/
vrfb.h>
#include <
video/omap
vrfb.h>
#include "omap_voutdef.h"
#include "omap_voutlib.h"
...
...
drivers/media/platform/omap/omap_voutdef.h
浏览文件 @
7a992d3e
...
...
@@ -12,7 +12,7 @@
#define OMAP_VOUTDEF_H
#include <video/omapdss.h>
#include <
plat/
vrfb.h>
#include <
video/omap
vrfb.h>
#define YUYV_BPP 2
#define RGB565_BPP 2
...
...
drivers/video/omap2/omapfb/omapfb-ioctl.c
浏览文件 @
7a992d3e
...
...
@@ -30,7 +30,7 @@
#include <linux/export.h>
#include <video/omapdss.h>
#include <
plat/
vrfb.h>
#include <
video/omap
vrfb.h>
#include <plat/vram.h>
#include "omapfb.h"
...
...
drivers/video/omap2/omapfb/omapfb-main.c
浏览文件 @
7a992d3e
...
...
@@ -31,9 +31,8 @@
#include <linux/omapfb.h>
#include <video/omapdss.h>
#include <plat/cpu.h>
#include <plat/vram.h>
#include <
plat/
vrfb.h>
#include <
video/omap
vrfb.h>
#include "omapfb.h"
...
...
@@ -2396,10 +2395,7 @@ static int __init omapfb_probe(struct platform_device *pdev)
goto
err0
;
}
/* TODO : Replace cpu check with omap_has_vrfb once HAS_FEATURE
* available for OMAP2 and OMAP3
*/
if
(
def_vrfb
&&
!
cpu_is_omap24xx
()
&&
!
cpu_is_omap34xx
())
{
if
(
def_vrfb
&&
!
omap_vrfb_supported
())
{
def_vrfb
=
0
;
dev_warn
(
&
pdev
->
dev
,
"VRFB is not supported on this hardware, "
"ignoring the module parameter vrfb=y
\n
"
);
...
...
drivers/video/omap2/omapfb/omapfb-sysfs.c
浏览文件 @
7a992d3e
...
...
@@ -30,7 +30,7 @@
#include <linux/omapfb.h>
#include <video/omapdss.h>
#include <
plat/
vrfb.h>
#include <
video/omap
vrfb.h>
#include "omapfb.h"
...
...
drivers/video/omap2/vrfb.c
浏览文件 @
7a992d3e
...
...
@@ -26,9 +26,9 @@
#include <linux/io.h>
#include <linux/bitops.h>
#include <linux/mutex.h>
#include <linux/platform_device.h>
#include <plat/vrfb.h>
#include <plat/sdrc.h>
#include <video/omapvrfb.h>
#ifdef DEBUG
#define DBG(format, ...) pr_debug("VRFB: " format, ## __VA_ARGS__)
...
...
@@ -36,10 +36,10 @@
#define DBG(format, ...)
#endif
#define SMS_ROT_
VIRT_BASE(context, rot) \
(((context >= 4) ? 0xD0000000 : 0x70000000) \
+ (0x4000000 * (context)) \
+ (0x1000000 * (rot)
))
#define SMS_ROT_
CONTROL(context) (0x0 + 0x10 * context)
#define SMS_ROT_SIZE(context) (0x4 + 0x10 * context)
#define SMS_ROT_PHYSICAL_BA(context) (0x8 + 0x10 * context)
#define SMS_ROT_VIRT_BASE(rot) (0x1000000 * (rot
))
#define OMAP_VRFB_SIZE (2048 * 2048 * 4)
...
...
@@ -53,10 +53,16 @@
#define SMS_PW_OFFSET 4
#define SMS_PS_OFFSET 0
#define VRFB_NUM_CTXS 12
/* bitmap of reserved contexts */
static
unsigned
long
ctx_map
;
struct
vrfb_ctx
{
u32
base
;
u32
physical_ba
;
u32
control
;
u32
size
;
};
static
DEFINE_MUTEX
(
ctx_lock
);
/*
...
...
@@ -65,17 +71,34 @@ static DEFINE_MUTEX(ctx_lock);
* we don't need locking, since no drivers will run until after the wake-up
* has finished.
*/
static
struct
{
u32
physical_ba
;
u32
control
;
u32
size
;
}
vrfb_hw_context
[
VRFB_NUM_CTXS
];
static
void
__iomem
*
vrfb_base
;
static
int
num_ctxs
;
static
struct
vrfb_ctx
*
ctxs
;
static
bool
vrfb_loaded
;
static
void
omap2_sms_write_rot_control
(
u32
val
,
unsigned
ctx
)
{
__raw_writel
(
val
,
vrfb_base
+
SMS_ROT_CONTROL
(
ctx
));
}
static
void
omap2_sms_write_rot_size
(
u32
val
,
unsigned
ctx
)
{
__raw_writel
(
val
,
vrfb_base
+
SMS_ROT_SIZE
(
ctx
));
}
static
void
omap2_sms_write_rot_physical_ba
(
u32
val
,
unsigned
ctx
)
{
__raw_writel
(
val
,
vrfb_base
+
SMS_ROT_PHYSICAL_BA
(
ctx
));
}
static
inline
void
restore_hw_context
(
int
ctx
)
{
omap2_sms_write_rot_control
(
vrfb_hw_context
[
ctx
].
control
,
ctx
);
omap2_sms_write_rot_size
(
vrfb_hw_context
[
ctx
].
size
,
ctx
);
omap2_sms_write_rot_physical_ba
(
vrfb_hw_context
[
ctx
].
physical_ba
,
ctx
);
omap2_sms_write_rot_control
(
ctxs
[
ctx
].
control
,
ctx
);
omap2_sms_write_rot_size
(
ctxs
[
ctx
].
size
,
ctx
);
omap2_sms_write_rot_physical_ba
(
ctxs
[
ctx
].
physical_ba
,
ctx
);
}
static
u32
get_image_width_roundup
(
u16
width
,
u8
bytespp
)
...
...
@@ -196,9 +219,9 @@ void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
control
|=
VRFB_PAGE_WIDTH_EXP
<<
SMS_PW_OFFSET
;
control
|=
VRFB_PAGE_HEIGHT_EXP
<<
SMS_PH_OFFSET
;
vrfb_hw_context
[
ctx
].
physical_ba
=
paddr
;
vrfb_hw_context
[
ctx
].
size
=
size
;
vrfb_hw_context
[
ctx
].
control
=
control
;
ctxs
[
ctx
].
physical_ba
=
paddr
;
ctxs
[
ctx
].
size
=
size
;
ctxs
[
ctx
].
control
=
control
;
omap2_sms_write_rot_physical_ba
(
paddr
,
ctx
);
omap2_sms_write_rot_size
(
size
,
ctx
);
...
...
@@ -274,11 +297,11 @@ int omap_vrfb_request_ctx(struct vrfb *vrfb)
mutex_lock
(
&
ctx_lock
);
for
(
ctx
=
0
;
ctx
<
VRFB_NUM_CTXS
;
++
ctx
)
for
(
ctx
=
0
;
ctx
<
num_ctxs
;
++
ctx
)
if
((
ctx_map
&
(
1
<<
ctx
))
==
0
)
break
;
if
(
ctx
==
VRFB_NUM_CTXS
)
{
if
(
ctx
==
num_ctxs
)
{
pr_err
(
"vrfb: no free contexts
\n
"
);
r
=
-
EBUSY
;
goto
out
;
...
...
@@ -293,7 +316,7 @@ int omap_vrfb_request_ctx(struct vrfb *vrfb)
vrfb
->
context
=
ctx
;
for
(
rot
=
0
;
rot
<
4
;
++
rot
)
{
paddr
=
SMS_ROT_VIRT_BASE
(
ctx
,
rot
);
paddr
=
ctxs
[
ctx
].
base
+
SMS_ROT_VIRT_BASE
(
rot
);
if
(
!
request_mem_region
(
paddr
,
OMAP_VRFB_SIZE
,
"vrfb"
))
{
pr_err
(
"vrfb: failed to reserve VRFB "
"area for ctx %d, rotation %d
\n
"
,
...
...
@@ -314,3 +337,80 @@ int omap_vrfb_request_ctx(struct vrfb *vrfb)
return
r
;
}
EXPORT_SYMBOL
(
omap_vrfb_request_ctx
);
bool
omap_vrfb_supported
(
void
)
{
return
vrfb_loaded
;
}
EXPORT_SYMBOL
(
omap_vrfb_supported
);
static
int
__init
vrfb_probe
(
struct
platform_device
*
pdev
)
{
struct
resource
*
mem
;
int
i
;
/* first resource is the register res, the rest are vrfb contexts */
mem
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
if
(
!
mem
)
{
dev_err
(
&
pdev
->
dev
,
"can't get vrfb base address
\n
"
);
return
-
EINVAL
;
}
vrfb_base
=
devm_request_and_ioremap
(
&
pdev
->
dev
,
mem
);
if
(
!
vrfb_base
)
{
dev_err
(
&
pdev
->
dev
,
"can't ioremap vrfb memory
\n
"
);
return
-
ENOMEM
;
}
num_ctxs
=
pdev
->
num_resources
-
1
;
ctxs
=
devm_kzalloc
(
&
pdev
->
dev
,
sizeof
(
struct
vrfb_ctx
)
*
num_ctxs
,
GFP_KERNEL
);
if
(
!
ctxs
)
return
-
ENOMEM
;
for
(
i
=
0
;
i
<
num_ctxs
;
++
i
)
{
mem
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
1
+
i
);
if
(
!
mem
)
{
dev_err
(
&
pdev
->
dev
,
"can't get vrfb ctx %d address
\n
"
,
i
);
return
-
EINVAL
;
}
ctxs
[
i
].
base
=
mem
->
start
;
}
vrfb_loaded
=
true
;
return
0
;
}
static
void
__exit
vrfb_remove
(
struct
platform_device
*
pdev
)
{
vrfb_loaded
=
false
;
}
static
struct
platform_driver
vrfb_driver
=
{
.
driver
.
name
=
"omapvrfb"
,
.
remove
=
__exit_p
(
vrfb_remove
),
};
static
int
__init
vrfb_init
(
void
)
{
return
platform_driver_probe
(
&
vrfb_driver
,
&
vrfb_probe
);
}
static
void
__exit
vrfb_exit
(
void
)
{
platform_driver_unregister
(
&
vrfb_driver
);
}
module_init
(
vrfb_init
);
module_exit
(
vrfb_exit
);
MODULE_AUTHOR
(
"Tomi Valkeinen <tomi.valkeinen@ti.com>"
);
MODULE_DESCRIPTION
(
"OMAP VRFB"
);
MODULE_LICENSE
(
"GPL v2"
);
arch/arm/plat-omap/include/plat/
vrfb.h
→
include/video/omap
vrfb.h
浏览文件 @
7a992d3e
...
...
@@ -36,6 +36,7 @@ struct vrfb {
};
#ifdef CONFIG_OMAP2_VRFB
extern
bool
omap_vrfb_supported
(
void
);
extern
int
omap_vrfb_request_ctx
(
struct
vrfb
*
vrfb
);
extern
void
omap_vrfb_release_ctx
(
struct
vrfb
*
vrfb
);
extern
void
omap_vrfb_adjust_size
(
u16
*
width
,
u16
*
height
,
...
...
@@ -49,6 +50,7 @@ extern int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot);
extern
void
omap_vrfb_restore_context
(
void
);
#else
static
inline
bool
omap_vrfb_supported
(
void
)
{
return
false
;
}
static
inline
int
omap_vrfb_request_ctx
(
struct
vrfb
*
vrfb
)
{
return
0
;
}
static
inline
void
omap_vrfb_release_ctx
(
struct
vrfb
*
vrfb
)
{}
static
inline
void
omap_vrfb_adjust_size
(
u16
*
width
,
u16
*
height
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录