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
d24796a4
Commit
d24796a4
authored
Sep 23, 2015
by
Gerd Hoffmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
virtio-gpu: add page flip support
Signed-off-by:
Gerd Hoffmann
<
kraxel@redhat.com
>
parent
f3380a30
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
3 deletions
+46
-3
drivers/gpu/drm/virtio/virtgpu_display.c
drivers/gpu/drm/virtio/virtgpu_display.c
+46
-3
No files found.
drivers/gpu/drm/virtio/virtgpu_display.c
View file @
d24796a4
...
...
@@ -125,6 +125,51 @@ static int virtio_gpu_crtc_cursor_move(struct drm_crtc *crtc,
return
0
;
}
static
int
virtio_gpu_page_flip
(
struct
drm_crtc
*
crtc
,
struct
drm_framebuffer
*
fb
,
struct
drm_pending_vblank_event
*
event
,
uint32_t
flags
)
{
struct
virtio_gpu_device
*
vgdev
=
crtc
->
dev
->
dev_private
;
struct
virtio_gpu_output
*
output
=
container_of
(
crtc
,
struct
virtio_gpu_output
,
crtc
);
struct
drm_plane
*
plane
=
crtc
->
primary
;
struct
virtio_gpu_framebuffer
*
vgfb
;
struct
virtio_gpu_object
*
bo
;
unsigned
long
irqflags
;
uint32_t
handle
;
plane
->
fb
=
fb
;
vgfb
=
to_virtio_gpu_framebuffer
(
plane
->
fb
);
bo
=
gem_to_virtio_gpu_obj
(
vgfb
->
obj
);
handle
=
bo
->
hw_res_handle
;
DRM_DEBUG
(
"handle 0x%x%s, crtc %dx%d
\n
"
,
handle
,
bo
->
dumb
?
", dumb"
:
""
,
crtc
->
mode
.
hdisplay
,
crtc
->
mode
.
vdisplay
);
if
(
bo
->
dumb
)
{
virtio_gpu_cmd_transfer_to_host_2d
(
vgdev
,
handle
,
0
,
cpu_to_le32
(
crtc
->
mode
.
hdisplay
),
cpu_to_le32
(
crtc
->
mode
.
vdisplay
),
0
,
0
,
NULL
);
}
virtio_gpu_cmd_set_scanout
(
vgdev
,
output
->
index
,
handle
,
crtc
->
mode
.
hdisplay
,
crtc
->
mode
.
vdisplay
,
0
,
0
);
virtio_gpu_cmd_resource_flush
(
vgdev
,
handle
,
0
,
0
,
crtc
->
mode
.
hdisplay
,
crtc
->
mode
.
vdisplay
);
if
(
event
)
{
spin_lock_irqsave
(
&
crtc
->
dev
->
event_lock
,
irqflags
);
drm_send_vblank_event
(
crtc
->
dev
,
-
1
,
event
);
spin_unlock_irqrestore
(
&
crtc
->
dev
->
event_lock
,
irqflags
);
}
return
0
;
}
static
const
struct
drm_crtc_funcs
virtio_gpu_crtc_funcs
=
{
.
cursor_set2
=
virtio_gpu_crtc_cursor_set
,
.
cursor_move
=
virtio_gpu_crtc_cursor_move
,
...
...
@@ -132,9 +177,7 @@ static const struct drm_crtc_funcs virtio_gpu_crtc_funcs = {
.
set_config
=
drm_atomic_helper_set_config
,
.
destroy
=
drm_crtc_cleanup
,
#if 0 /* not (yet) working without vblank support according to docs */
.page_flip = drm_atomic_helper_page_flip,
#endif
.
page_flip
=
virtio_gpu_page_flip
,
.
reset
=
drm_atomic_helper_crtc_reset
,
.
atomic_duplicate_state
=
drm_atomic_helper_crtc_duplicate_state
,
.
atomic_destroy_state
=
drm_atomic_helper_crtc_destroy_state
,
...
...
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