Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
51a3d342
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看板
提交
51a3d342
编写于
7月 26, 2012
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau/backlight: remove dependence on nouveau_drv.h
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
84058eb8
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
60 addition
and
59 deletion
+60
-59
drivers/gpu/drm/nouveau/Makefile
drivers/gpu/drm/nouveau/Makefile
+1
-4
drivers/gpu/drm/nouveau/nouveau_backlight.c
drivers/gpu/drm/nouveau/nouveau_backlight.c
+46
-44
drivers/gpu/drm/nouveau/nouveau_drm.h
drivers/gpu/drm/nouveau/nouveau_drm.h
+2
-0
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_drv.h
+7
-3
drivers/gpu/drm/nouveau/nouveau_encoder.h
drivers/gpu/drm/nouveau/nouveau_encoder.h
+2
-1
drivers/gpu/drm/nouveau/nv04_display.h
drivers/gpu/drm/nouveau/nv04_display.h
+2
-7
未找到文件。
drivers/gpu/drm/nouveau/Makefile
浏览文件 @
51a3d342
...
...
@@ -170,6 +170,7 @@ nouveau-y += nv50_fbcon.o nvc0_fbcon.o
# other random bits
nouveau-$(CONFIG_COMPAT)
+=
nouveau_ioc32.o
nouveau-$(CONFIG_ACPI)
+=
nouveau_acpi.o
nouveau-$(CONFIG_DRM_NOUVEAU_BACKLIGHT)
+=
nouveau_backlight.o
##
## unported bits below
...
...
@@ -201,8 +202,4 @@ nouveau-y += nouveau_pm.o nouveau_volt.o nouveau_perf.o nouveau_temp.o
nouveau-y
+=
nv04_pm.o nv40_pm.o nv50_pm.o nva3_pm.o nvc0_pm.o
nouveau-y
+=
nouveau_mem.o
# optional stuff
nouveau-$(CONFIG_DRM_NOUVEAU_BACKLIGHT)
+=
nouveau_backlight.o
obj-$(CONFIG_DRM_NOUVEAU)
+=
nouveau.o
drivers/gpu/drm/nouveau/nouveau_backlight.c
浏览文件 @
51a3d342
...
...
@@ -33,18 +33,17 @@
#include <linux/backlight.h>
#include <linux/acpi.h>
#include "drmP.h"
#include "nouveau_drv.h"
#include <nouveau_drm.h>
#include "nouveau_drm.h"
#include "nouveau_reg.h"
#include "nouveau_encoder.h"
static
int
nv40_get_intensity
(
struct
backlight_device
*
bd
)
{
struct
drm_device
*
dev
=
bl_get_data
(
bd
);
int
val
=
(
nv_rd32
(
dev
,
NV40_PMC_BACKLIGHT
)
&
NV40_PMC_BACKLIGHT_MASK
)
>>
16
;
struct
nouveau_drm
*
drm
=
bl_get_data
(
bd
);
struct
nouveau_device
*
device
=
nv_device
(
drm
->
device
);
int
val
=
(
nv_rd32
(
device
,
NV40_PMC_BACKLIGHT
)
&
NV40_PMC_BACKLIGHT_MASK
)
>>
16
;
return
val
;
}
...
...
@@ -52,11 +51,12 @@ nv40_get_intensity(struct backlight_device *bd)
static
int
nv40_set_intensity
(
struct
backlight_device
*
bd
)
{
struct
drm_device
*
dev
=
bl_get_data
(
bd
);
struct
nouveau_drm
*
drm
=
bl_get_data
(
bd
);
struct
nouveau_device
*
device
=
nv_device
(
drm
->
device
);
int
val
=
bd
->
props
.
brightness
;
int
reg
=
nv_rd32
(
dev
,
NV40_PMC_BACKLIGHT
);
int
reg
=
nv_rd32
(
dev
ice
,
NV40_PMC_BACKLIGHT
);
nv_wr32
(
dev
,
NV40_PMC_BACKLIGHT
,
nv_wr32
(
dev
ice
,
NV40_PMC_BACKLIGHT
,
(
val
<<
16
)
|
(
reg
&
~
NV40_PMC_BACKLIGHT_MASK
));
return
0
;
...
...
@@ -71,23 +71,20 @@ static const struct backlight_ops nv40_bl_ops = {
static
int
nv40_backlight_init
(
struct
drm_connector
*
connector
)
{
struct
drm_device
*
dev
=
connector
->
dev
;
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_drm
*
drm
=
nouveau_newpriv
(
connector
->
dev
)
;
struct
nouveau_device
*
device
=
nv_device
(
drm
->
device
)
;
struct
backlight_properties
props
;
struct
backlight_device
*
bd
;
if
(
!
(
nv_rd32
(
dev
,
NV40_PMC_BACKLIGHT
)
&
NV40_PMC_BACKLIGHT_MASK
))
if
(
!
(
nv_rd32
(
dev
ice
,
NV40_PMC_BACKLIGHT
)
&
NV40_PMC_BACKLIGHT_MASK
))
return
0
;
memset
(
&
props
,
0
,
sizeof
(
struct
backlight_properties
));
props
.
type
=
BACKLIGHT_RAW
;
props
.
max_brightness
=
31
;
bd
=
backlight_device_register
(
"nv_backlight"
,
&
connector
->
kdev
,
d
ev
,
bd
=
backlight_device_register
(
"nv_backlight"
,
&
connector
->
kdev
,
d
rm
,
&
nv40_bl_ops
,
&
props
);
if
(
IS_ERR
(
bd
))
return
PTR_ERR
(
bd
);
dev_priv
->
backlight
=
bd
;
drm
->
backlight
=
bd
;
bd
->
props
.
brightness
=
nv40_get_intensity
(
bd
);
backlight_update_status
(
bd
);
...
...
@@ -98,12 +95,13 @@ static int
nv50_get_intensity
(
struct
backlight_device
*
bd
)
{
struct
nouveau_encoder
*
nv_encoder
=
bl_get_data
(
bd
);
struct
drm_device
*
dev
=
nv_encoder
->
base
.
base
.
dev
;
struct
nouveau_drm
*
drm
=
nouveau_newpriv
(
nv_encoder
->
base
.
base
.
dev
);
struct
nouveau_device
*
device
=
nv_device
(
drm
->
device
);
int
or
=
nv_encoder
->
or
;
u32
div
=
1025
;
u32
val
;
val
=
nv_rd32
(
dev
,
NV50_PDISP_SOR_PWM_CTL
(
or
));
val
=
nv_rd32
(
dev
ice
,
NV50_PDISP_SOR_PWM_CTL
(
or
));
val
&=
NV50_PDISP_SOR_PWM_CTL_VAL
;
return
((
val
*
100
)
+
(
div
/
2
))
/
div
;
}
...
...
@@ -112,13 +110,14 @@ static int
nv50_set_intensity
(
struct
backlight_device
*
bd
)
{
struct
nouveau_encoder
*
nv_encoder
=
bl_get_data
(
bd
);
struct
drm_device
*
dev
=
nv_encoder
->
base
.
base
.
dev
;
struct
nouveau_drm
*
drm
=
nouveau_newpriv
(
nv_encoder
->
base
.
base
.
dev
);
struct
nouveau_device
*
device
=
nv_device
(
drm
->
device
);
int
or
=
nv_encoder
->
or
;
u32
div
=
1025
;
u32
val
=
(
bd
->
props
.
brightness
*
div
)
/
100
;
nv_wr32
(
dev
,
NV50_PDISP_SOR_PWM_CTL
(
or
),
NV50_PDISP_SOR_PWM_CTL_NEW
|
val
);
nv_wr32
(
dev
ice
,
NV50_PDISP_SOR_PWM_CTL
(
or
),
NV50_PDISP_SOR_PWM_CTL_NEW
|
val
);
return
0
;
}
...
...
@@ -132,12 +131,13 @@ static int
nva3_get_intensity
(
struct
backlight_device
*
bd
)
{
struct
nouveau_encoder
*
nv_encoder
=
bl_get_data
(
bd
);
struct
drm_device
*
dev
=
nv_encoder
->
base
.
base
.
dev
;
struct
nouveau_drm
*
drm
=
nouveau_newpriv
(
nv_encoder
->
base
.
base
.
dev
);
struct
nouveau_device
*
device
=
nv_device
(
drm
->
device
);
int
or
=
nv_encoder
->
or
;
u32
div
,
val
;
div
=
nv_rd32
(
dev
,
NV50_PDISP_SOR_PWM_DIV
(
or
));
val
=
nv_rd32
(
dev
,
NV50_PDISP_SOR_PWM_CTL
(
or
));
div
=
nv_rd32
(
dev
ice
,
NV50_PDISP_SOR_PWM_DIV
(
or
));
val
=
nv_rd32
(
dev
ice
,
NV50_PDISP_SOR_PWM_CTL
(
or
));
val
&=
NVA3_PDISP_SOR_PWM_CTL_VAL
;
if
(
div
&&
div
>=
val
)
return
((
val
*
100
)
+
(
div
/
2
))
/
div
;
...
...
@@ -149,16 +149,17 @@ static int
nva3_set_intensity
(
struct
backlight_device
*
bd
)
{
struct
nouveau_encoder
*
nv_encoder
=
bl_get_data
(
bd
);
struct
drm_device
*
dev
=
nv_encoder
->
base
.
base
.
dev
;
struct
nouveau_drm
*
drm
=
nouveau_newpriv
(
nv_encoder
->
base
.
base
.
dev
);
struct
nouveau_device
*
device
=
nv_device
(
drm
->
device
);
int
or
=
nv_encoder
->
or
;
u32
div
,
val
;
div
=
nv_rd32
(
dev
,
NV50_PDISP_SOR_PWM_DIV
(
or
));
div
=
nv_rd32
(
dev
ice
,
NV50_PDISP_SOR_PWM_DIV
(
or
));
val
=
(
bd
->
props
.
brightness
*
div
)
/
100
;
if
(
div
)
{
nv_wr32
(
dev
,
NV50_PDISP_SOR_PWM_CTL
(
or
),
val
|
NV50_PDISP_SOR_PWM_CTL_NEW
|
NVA3_PDISP_SOR_PWM_CTL_UNK
);
nv_wr32
(
dev
ice
,
NV50_PDISP_SOR_PWM_CTL
(
or
),
val
|
NV50_PDISP_SOR_PWM_CTL_NEW
|
NVA3_PDISP_SOR_PWM_CTL_UNK
);
return
0
;
}
...
...
@@ -174,8 +175,8 @@ static const struct backlight_ops nva3_bl_ops = {
static
int
nv50_backlight_init
(
struct
drm_connector
*
connector
)
{
struct
drm_device
*
dev
=
connector
->
dev
;
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_drm
*
drm
=
nouveau_newpriv
(
connector
->
dev
)
;
struct
nouveau_device
*
device
=
nv_device
(
drm
->
device
)
;
struct
nouveau_encoder
*
nv_encoder
;
struct
backlight_properties
props
;
struct
backlight_device
*
bd
;
...
...
@@ -188,12 +189,12 @@ nv50_backlight_init(struct drm_connector *connector)
return
-
ENODEV
;
}
if
(
!
nv_rd32
(
dev
,
NV50_PDISP_SOR_PWM_CTL
(
nv_encoder
->
or
)))
if
(
!
nv_rd32
(
dev
ice
,
NV50_PDISP_SOR_PWM_CTL
(
nv_encoder
->
or
)))
return
0
;
if
(
dev
_priv
->
chipset
<=
0xa0
||
dev
_priv
->
chipset
==
0xaa
||
dev
_priv
->
chipset
==
0xac
)
if
(
dev
ice
->
chipset
<=
0xa0
||
dev
ice
->
chipset
==
0xaa
||
dev
ice
->
chipset
==
0xac
)
ops
=
&
nv50_bl_ops
;
else
ops
=
&
nva3_bl_ops
;
...
...
@@ -206,7 +207,7 @@ nv50_backlight_init(struct drm_connector *connector)
if
(
IS_ERR
(
bd
))
return
PTR_ERR
(
bd
);
d
ev_priv
->
backlight
=
bd
;
d
rm
->
backlight
=
bd
;
bd
->
props
.
brightness
=
bd
->
ops
->
get_brightness
(
bd
);
backlight_update_status
(
bd
);
return
0
;
...
...
@@ -215,12 +216,13 @@ nv50_backlight_init(struct drm_connector *connector)
int
nouveau_backlight_init
(
struct
drm_device
*
dev
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_drm
*
drm
=
nouveau_newpriv
(
dev
);
struct
nouveau_device
*
device
=
nv_device
(
drm
->
device
);
struct
drm_connector
*
connector
;
#ifdef CONFIG_ACPI
if
(
acpi_video_backlight_support
())
{
NV_INFO
(
d
ev
,
"ACPI backlight interface available, "
NV_INFO
(
d
rm
,
"ACPI backlight interface available, "
"not registering our own
\n
"
);
return
0
;
}
...
...
@@ -231,7 +233,7 @@ nouveau_backlight_init(struct drm_device *dev)
connector
->
connector_type
!=
DRM_MODE_CONNECTOR_eDP
)
continue
;
switch
(
dev
_priv
->
card_type
)
{
switch
(
dev
ice
->
card_type
)
{
case
NV_40
:
return
nv40_backlight_init
(
connector
);
case
NV_50
:
...
...
@@ -248,10 +250,10 @@ nouveau_backlight_init(struct drm_device *dev)
void
nouveau_backlight_exit
(
struct
drm_device
*
dev
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_drm
*
drm
=
nouveau_newpriv
(
dev
)
;
if
(
d
ev_priv
->
backlight
)
{
backlight_device_unregister
(
d
ev_priv
->
backlight
);
d
ev_priv
->
backlight
=
NULL
;
if
(
d
rm
->
backlight
)
{
backlight_device_unregister
(
d
rm
->
backlight
);
d
rm
->
backlight
=
NULL
;
}
}
drivers/gpu/drm/nouveau/nouveau_drm.h
浏览文件 @
51a3d342
...
...
@@ -95,6 +95,8 @@ struct nouveau_drm {
struct
nouveau_drm_tile
reg
[
15
];
spinlock_t
lock
;
}
tile
;
struct
backlight_device
*
backlight
;
};
static
inline
struct
nouveau_drm
*
...
...
drivers/gpu/drm/nouveau/nouveau_drv.h
浏览文件 @
51a3d342
...
...
@@ -308,9 +308,6 @@ struct drm_nouveau_private {
spinlock_t
context_switch_lock
;
struct
nvbios
vbios
;
u8
*
mxms
;
struct
backlight_device
*
backlight
;
};
static
inline
struct
drm_nouveau_private
*
...
...
@@ -544,4 +541,11 @@ nv_match_device(struct drm_device *dev, unsigned device,
dev
->
pdev
->
subsystem_device
==
sub_device
;
}
static
inline
struct
nv04_display
*
nv04_display
(
struct
drm_device
*
dev
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
return
dev_priv
->
engine
.
display
.
priv
;
}
#endif
/* __NOUVEAU_DRV_H__ */
drivers/gpu/drm/nouveau/nouveau_encoder.h
浏览文件 @
51a3d342
...
...
@@ -27,8 +27,9 @@
#ifndef __NOUVEAU_ENCODER_H__
#define __NOUVEAU_ENCODER_H__
#include <subdev/bios/dcb.h>
#include "drm_encoder_slave.h"
#include "nouveau_drv.h"
#include "nv04_display.h"
#define NV_DPMS_CLEARED 0x80
...
...
drivers/gpu/drm/nouveau/nv04_display.h
浏览文件 @
51a3d342
#ifndef __NV04_DISPLAY_H__
#define __NV04_DISPLAY_H__
#include <subdev/bios/pll.h>
enum
nv04_fp_display_regs
{
FP_DISPLAY_END
,
FP_TOTAL
,
...
...
@@ -78,13 +80,6 @@ struct nv04_display {
uint32_t
dac_users
[
4
];
};
static
inline
struct
nv04_display
*
nv04_display
(
struct
drm_device
*
dev
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
return
dev_priv
->
engine
.
display
.
priv
;
}
/* nv04_display.c */
int
nv04_display_early_init
(
struct
drm_device
*
);
void
nv04_display_late_takedown
(
struct
drm_device
*
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录