Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
igt-gpu-tools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
55
Issues
55
List
Boards
Labels
Service Desk
Milestones
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
drm
igt-gpu-tools
Commits
865b7821
Commit
865b7821
authored
Aug 29, 2013
by
Chris Wilson
🤔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kms_flip: Hook up primary events for page-flips
Signed-off-by:
Chris Wilson
<
chris@chris-wilson.co.uk
>
parent
1f2b3e99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
19 deletions
+28
-19
tests/kms_flip.c
tests/kms_flip.c
+28
-19
No files found.
tests/kms_flip.c
View file @
865b7821
...
...
@@ -132,6 +132,7 @@ struct test_output {
struct
event_state
flip_state
;
struct
event_state
vblank_state
;
unsigned
int
pending_events
;
int
flip_count
;
};
...
...
@@ -301,12 +302,15 @@ static int do_page_flip(struct test_output *o, int fb_id, bool event)
{
int
n
,
ret
=
0
;
for
(
n
=
0
;
n
<
o
->
count
;
n
++
)
{
ret
=
drmModePageFlip
(
drm_fd
,
o
->
_crtc
[
n
],
fb_id
,
event
?
DRM_MODE_PAGE_FLIP_EVENT
:
0
,
event
?
o
:
NULL
);
if
(
ret
==
0
&&
event
)
set_flag
(
&
o
->
pending_events
,
EVENT_FLIP
);
}
o
->
flip_count
=
0
;
for
(
n
=
0
;
ret
==
0
&&
n
<
o
->
count
;
n
++
)
ret
=
drmModePageFlip
(
drm_fd
,
o
->
_crtc
[
n
],
fb_id
,
event
?
DRM_MODE_PAGE_FLIP_EVENT
:
0
,
event
?
(
void
*
)((
unsigned
long
)
o
|
(
n
==
0
))
:
NULL
);
if
(
ret
==
0
&&
event
)
set_flag
(
&
o
->
pending_events
,
EVENT_FLIP
);
return
ret
;
}
...
...
@@ -401,10 +405,13 @@ static void event_handler(struct event_state *es, unsigned int frame,
static
void
page_flip_handler
(
int
fd
,
unsigned
int
frame
,
unsigned
int
sec
,
unsigned
int
usec
,
void
*
data
)
{
struct
test_output
*
o
=
data
;
int
primary
=
(
unsigned
long
)
data
&
1
;
struct
test_output
*
o
=
(
void
*
)((
unsigned
long
)
data
&
~
1
);
clear_flag
(
&
o
->
pending_events
,
EVENT_FLIP
);
event_handler
(
&
o
->
flip_state
,
frame
,
sec
,
usec
);
if
(
++
o
->
flip_count
==
o
->
count
)
clear_flag
(
&
o
->
pending_events
,
EVENT_FLIP
);
if
(
primary
)
event_handler
(
&
o
->
flip_state
,
frame
,
sec
,
usec
);
}
static
double
frame_time
(
struct
test_output
*
o
)
...
...
@@ -1063,19 +1070,21 @@ static unsigned int wait_for_events(struct test_output *o)
FD_ZERO
(
&
fds
);
FD_SET
(
drm_fd
,
&
fds
);
do
{
ret
=
select
(
drm_fd
+
1
,
&
fds
,
NULL
,
NULL
,
&
timeout
);
}
while
(
ret
<
0
&&
errno
==
EINTR
);
do
{
ret
=
select
(
drm_fd
+
1
,
&
fds
,
NULL
,
NULL
,
&
timeout
);
}
while
(
ret
<
0
&&
errno
==
EINTR
);
if
(
ret
<=
0
)
{
fprintf
(
stderr
,
"select timed out or error (ret %d)
\n
"
,
if
(
ret
<=
0
)
{
fprintf
(
stderr
,
"select timed out or error (ret %d)
\n
"
,
ret
);
igt_fail
(
1
);
}
else
if
(
FD_ISSET
(
0
,
&
fds
))
{
fprintf
(
stderr
,
"no fds active, breaking
\n
"
);
igt_fail
(
2
);
}
igt_fail
(
1
);
}
else
if
(
FD_ISSET
(
0
,
&
fds
))
{
fprintf
(
stderr
,
"no fds active, breaking
\n
"
);
igt_fail
(
2
);
}
do_or_die
(
drmHandleEvent
(
drm_fd
,
&
evctx
));
do_or_die
(
drmHandleEvent
(
drm_fd
,
&
evctx
));
}
while
(
o
->
pending_events
);
event_mask
^=
o
->
pending_events
;
igt_assert
(
event_mask
);
...
...
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