Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
b12f0ae9
Commit
b12f0ae9
authored
Aug 10, 2014
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau: store vblank event handler data in nv_crtc
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
8a423647
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
29 deletions
+29
-29
drivers/gpu/drm/nouveau/nouveau_crtc.h
drivers/gpu/drm/nouveau/nouveau_crtc.h
+1
-0
drivers/gpu/drm/nouveau/nouveau_display.c
drivers/gpu/drm/nouveau/nouveau_display.c
+28
-27
drivers/gpu/drm/nouveau/nouveau_display.h
drivers/gpu/drm/nouveau/nouveau_display.h
+0
-2
No files found.
drivers/gpu/drm/nouveau/nouveau_crtc.h
View file @
b12f0ae9
...
...
@@ -31,6 +31,7 @@ struct nouveau_crtc {
struct
drm_crtc
base
;
int
index
;
struct
nouveau_eventh
*
vblank
;
uint32_t
dpms_saved_fp_control
;
uint32_t
fp_users
;
...
...
drivers/gpu/drm/nouveau/nouveau_display.c
View file @
b12f0ae9
...
...
@@ -44,28 +44,36 @@
static
int
nouveau_display_vblank_handler
(
void
*
data
,
u32
type
,
int
head
)
{
struct
nouveau_
drm
*
drm
=
data
;
drm_handle_vblank
(
drm
->
dev
,
head
);
struct
nouveau_
crtc
*
nv_crtc
=
data
;
drm_handle_vblank
(
nv_crtc
->
base
.
dev
,
nv_crtc
->
index
);
return
NVKM_EVENT_KEEP
;
}
int
nouveau_display_vblank_enable
(
struct
drm_device
*
dev
,
int
head
)
{
struct
nouveau_display
*
disp
=
nouveau_display
(
dev
);
if
(
disp
)
{
nouveau_event_get
(
disp
->
vblank
[
head
]);
struct
drm_crtc
*
crtc
;
list_for_each_entry
(
crtc
,
&
dev
->
mode_config
.
crtc_list
,
head
)
{
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
crtc
);
if
(
nv_crtc
->
index
==
head
)
{
nouveau_event_get
(
nv_crtc
->
vblank
);
return
0
;
}
return
-
EIO
;
}
return
-
EINVAL
;
}
void
nouveau_display_vblank_disable
(
struct
drm_device
*
dev
,
int
head
)
{
struct
nouveau_display
*
disp
=
nouveau_display
(
dev
);
if
(
disp
)
nouveau_event_put
(
disp
->
vblank
[
head
]);
struct
drm_crtc
*
crtc
;
list_for_each_entry
(
crtc
,
&
dev
->
mode_config
.
crtc_list
,
head
)
{
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
crtc
);
if
(
nv_crtc
->
index
==
head
)
{
nouveau_event_put
(
nv_crtc
->
vblank
);
return
;
}
}
}
static
inline
int
...
...
@@ -151,36 +159,29 @@ nouveau_display_vblstamp(struct drm_device *dev, int head, int *max_error,
static
void
nouveau_display_vblank_fini
(
struct
drm_device
*
dev
)
{
struct
nouveau_display
*
disp
=
nouveau_display
(
dev
);
int
i
;
struct
drm_crtc
*
crtc
;
drm_vblank_cleanup
(
dev
);
if
(
disp
->
vblank
)
{
for
(
i
=
0
;
i
<
dev
->
mode_config
.
num_crtc
;
i
++
)
nouveau_event_ref
(
NULL
,
&
disp
->
vblank
[
i
]);
kfree
(
disp
->
vblank
);
disp
->
vblank
=
NULL
;
list_for_each_entry
(
crtc
,
&
dev
->
mode_config
.
crtc_list
,
head
)
{
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
crtc
);
nouveau_event_ref
(
NULL
,
&
nv_crtc
->
vblank
);
}
}
static
int
nouveau_display_vblank_init
(
struct
drm_device
*
dev
)
{
struct
nouveau_display
*
disp
=
nouveau_display
(
dev
);
struct
nouveau_drm
*
drm
=
nouveau_drm
(
dev
);
struct
nouveau_disp
*
pdisp
=
nouveau_disp
(
drm
->
device
);
int
ret
,
i
;
disp
->
vblank
=
kzalloc
(
dev
->
mode_config
.
num_crtc
*
sizeof
(
*
disp
->
vblank
),
GFP_KERNEL
);
if
(
!
disp
->
vblank
)
return
-
ENOMEM
;
struct
drm_crtc
*
crtc
;
int
ret
;
for
(
i
=
0
;
i
<
dev
->
mode_config
.
num_crtc
;
i
++
)
{
ret
=
nouveau_event_new
(
pdisp
->
vblank
,
1
,
i
,
list_for_each_entry
(
crtc
,
&
dev
->
mode_config
.
crtc_list
,
head
)
{
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
crtc
);
ret
=
nouveau_event_new
(
pdisp
->
vblank
,
1
,
nv_crtc
->
index
,
nouveau_display_vblank_handler
,
drm
,
&
disp
->
vblank
[
i
]
);
nv_crtc
,
&
nv_crtc
->
vblank
);
if
(
ret
)
{
nouveau_display_vblank_fini
(
dev
);
return
ret
;
...
...
drivers/gpu/drm/nouveau/nouveau_display.h
View file @
b12f0ae9
...
...
@@ -40,8 +40,6 @@ struct nouveau_display {
void
(
*
fb_dtor
)(
struct
drm_framebuffer
*
);
struct
nouveau_object
*
core
;
struct
nouveau_eventh
**
vblank
;
struct
drm_property
*
dithering_mode
;
struct
drm_property
*
dithering_depth
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment