Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
ed76a870
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
ed76a870
编写于
6月 13, 2014
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau/device: register for acpi events
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
7d155dac
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
94 addition
and
2 deletion
+94
-2
drivers/gpu/drm/nouveau/Makefile
drivers/gpu/drm/nouveau/Makefile
+1
-0
drivers/gpu/drm/nouveau/core/engine/device/acpi.c
drivers/gpu/drm/nouveau/core/engine/device/acpi.c
+59
-0
drivers/gpu/drm/nouveau/core/engine/device/acpi.h
drivers/gpu/drm/nouveau/core/engine/device/acpi.h
+9
-0
drivers/gpu/drm/nouveau/core/engine/device/base.c
drivers/gpu/drm/nouveau/core/engine/device/base.c
+13
-2
drivers/gpu/drm/nouveau/core/include/core/device.h
drivers/gpu/drm/nouveau/core/include/core/device.h
+12
-0
未找到文件。
drivers/gpu/drm/nouveau/Makefile
浏览文件 @
ed76a870
...
...
@@ -213,6 +213,7 @@ nouveau-y += core/engine/copy/nvc0.o
nouveau-y
+=
core/engine/copy/nve0.o
nouveau-y
+=
core/engine/crypt/nv84.o
nouveau-y
+=
core/engine/crypt/nv98.o
nouveau-y
+=
core/engine/device/acpi.o
nouveau-y
+=
core/engine/device/base.o
nouveau-y
+=
core/engine/device/ctrl.o
nouveau-y
+=
core/engine/device/nv04.o
...
...
drivers/gpu/drm/nouveau/core/engine/device/acpi.c
0 → 100644
浏览文件 @
ed76a870
/*
* Copyright 2014 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: Ben Skeggs
*/
#include "acpi.h"
#ifdef CONFIG_ACPI
static
int
nvkm_acpi_ntfy
(
struct
notifier_block
*
nb
,
unsigned
long
val
,
void
*
data
)
{
struct
nouveau_device
*
device
=
container_of
(
nb
,
typeof
(
*
device
),
acpi
.
nb
);
struct
acpi_bus_event
*
info
=
data
;
if
(
!
strcmp
(
info
->
device_class
,
"ac_adapter"
))
nouveau_event_trigger
(
device
->
ntfy
,
1
,
NVKM_DEVICE_NTFY_POWER
);
return
NOTIFY_DONE
;
}
#endif
int
nvkm_acpi_fini
(
struct
nouveau_device
*
device
,
bool
suspend
)
{
#ifdef CONFIG_ACPI
unregister_acpi_notifier
(
&
device
->
acpi
.
nb
);
#endif
return
0
;
}
int
nvkm_acpi_init
(
struct
nouveau_device
*
device
)
{
#ifdef CONFIG_ACPI
device
->
acpi
.
nb
.
notifier_call
=
nvkm_acpi_ntfy
;
register_acpi_notifier
(
&
device
->
acpi
.
nb
);
#endif
return
0
;
}
drivers/gpu/drm/nouveau/core/engine/device/acpi.h
0 → 100644
浏览文件 @
ed76a870
#ifndef __NVKM_DEVICE_ACPI_H__
#define __NVKM_DEVICE_ACPI_H__
#include <engine/device.h>
int
nvkm_acpi_init
(
struct
nouveau_device
*
);
int
nvkm_acpi_fini
(
struct
nouveau_device
*
,
bool
);
#endif
drivers/gpu/drm/nouveau/core/engine/device/base.c
浏览文件 @
ed76a870
...
...
@@ -30,6 +30,7 @@
#include <core/class.h>
#include "priv.h"
#include "acpi.h"
static
DEFINE_MUTEX
(
nv_devices_mutex
);
static
LIST_HEAD
(
nv_devices
);
...
...
@@ -386,7 +387,7 @@ nouveau_device_fini(struct nouveau_object *object, bool suspend)
}
}
ret
=
0
;
ret
=
nvkm_acpi_fini
(
device
,
suspend
)
;
fail:
for
(;
ret
&&
i
<
NVDEV_SUBDEV_NR
;
i
++
)
{
if
((
subdev
=
device
->
subdev
[
i
]))
{
...
...
@@ -407,7 +408,11 @@ nouveau_device_init(struct nouveau_object *object)
{
struct
nouveau_device
*
device
=
(
void
*
)
object
;
struct
nouveau_object
*
subdev
;
int
ret
,
i
;
int
ret
,
i
=
0
;
ret
=
nvkm_acpi_init
(
device
);
if
(
ret
)
goto
fail
;
for
(
i
=
0
;
i
<
NVDEV_SUBDEV_NR
;
i
++
)
{
if
((
subdev
=
device
->
subdev
[
i
]))
{
...
...
@@ -430,6 +435,8 @@ nouveau_device_init(struct nouveau_object *object)
}
}
if
(
ret
)
nvkm_acpi_fini
(
device
,
false
);
return
ret
;
}
...
...
@@ -438,6 +445,8 @@ nouveau_device_dtor(struct nouveau_object *object)
{
struct
nouveau_device
*
device
=
(
void
*
)
object
;
nouveau_event_destroy
(
&
device
->
ntfy
);
mutex_lock
(
&
nv_devices_mutex
);
list_del
(
&
device
->
head
);
mutex_unlock
(
&
nv_devices_mutex
);
...
...
@@ -560,6 +569,8 @@ nouveau_device_create_(void *dev, enum nv_bus_type type, u64 name,
nv_subdev
(
device
)
->
debug
=
nouveau_dbgopt
(
device
->
dbgopt
,
"DEVICE"
);
nv_engine
(
device
)
->
sclass
=
nouveau_device_sclass
;
list_add
(
&
device
->
head
,
&
nv_devices
);
ret
=
nouveau_event_create
(
1
,
NVKM_DEVICE_NTFY
,
&
device
->
ntfy
);
done:
mutex_unlock
(
&
nv_devices_mutex
);
return
ret
;
...
...
drivers/gpu/drm/nouveau/core/include/core/device.h
浏览文件 @
ed76a870
...
...
@@ -4,6 +4,7 @@
#include <core/object.h>
#include <core/subdev.h>
#include <core/engine.h>
#include <core/event.h>
enum
nv_subdev_type
{
NVDEV_ENGINE_DEVICE
,
...
...
@@ -61,6 +62,11 @@ enum nv_subdev_type {
NVDEV_SUBDEV_NR
,
};
enum
nvkm_device_ntfy
{
NVKM_DEVICE_NTFY_POWER
=
0
,
NVKM_DEVICE_NTFY
};
struct
nouveau_device
{
struct
nouveau_engine
base
;
struct
list_head
head
;
...
...
@@ -69,6 +75,8 @@ struct nouveau_device {
struct
platform_device
*
platformdev
;
u64
handle
;
struct
nouveau_event
*
ntfy
;
const
char
*
cfgopt
;
const
char
*
dbgopt
;
const
char
*
name
;
...
...
@@ -93,6 +101,10 @@ struct nouveau_device {
struct
nouveau_oclass
*
oclass
[
NVDEV_SUBDEV_NR
];
struct
nouveau_object
*
subdev
[
NVDEV_SUBDEV_NR
];
struct
{
struct
notifier_block
nb
;
}
acpi
;
};
static
inline
struct
nouveau_device
*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录