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
nexedi
linux
Commits
50cb941a
Commit
50cb941a
authored
Mar 26, 2015
by
Gerd Hoffmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add virtio-vga bits.
parent
284b2884
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
20 deletions
+24
-20
drivers/gpu/drm/virtio/virtgpu_drm_bus.c
drivers/gpu/drm/virtio/virtgpu_drm_bus.c
+24
-20
No files found.
drivers/gpu/drm/virtio/virtgpu_drm_bus.c
View file @
50cb941a
...
@@ -37,6 +37,26 @@ int drm_virtio_set_busid(struct drm_device *dev, struct drm_master *master)
...
@@ -37,6 +37,26 @@ int drm_virtio_set_busid(struct drm_device *dev, struct drm_master *master)
return
0
;
return
0
;
}
}
static
void
virtio_pci_kick_out_firmware_fb
(
struct
pci_dev
*
pci_dev
)
{
struct
apertures_struct
*
ap
;
bool
primary
;
ap
=
alloc_apertures
(
1
);
if
(
!
ap
)
return
;
ap
->
ranges
[
0
].
base
=
pci_resource_start
(
pci_dev
,
0
);
ap
->
ranges
[
0
].
size
=
pci_resource_len
(
pci_dev
,
0
);
primary
=
pci_dev
->
resource
[
PCI_ROM_RESOURCE
].
flags
&
IORESOURCE_ROM_SHADOW
;
remove_conflicting_framebuffers
(
ap
,
"virtiodrmfb"
,
primary
);
kfree
(
ap
);
}
int
drm_virtio_init
(
struct
drm_driver
*
driver
,
struct
virtio_device
*
vdev
)
int
drm_virtio_init
(
struct
drm_driver
*
driver
,
struct
virtio_device
*
vdev
)
{
{
struct
drm_device
*
dev
;
struct
drm_device
*
dev
;
...
@@ -52,27 +72,11 @@ int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev)
...
@@ -52,27 +72,11 @@ int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev)
struct
pci_dev
*
pdev
=
to_pci_dev
(
vdev
->
dev
.
parent
);
struct
pci_dev
*
pdev
=
to_pci_dev
(
vdev
->
dev
.
parent
);
bool
vga
=
(
pdev
->
class
>>
8
)
==
PCI_CLASS_DISPLAY_VGA
;
bool
vga
=
(
pdev
->
class
>>
8
)
==
PCI_CLASS_DISPLAY_VGA
;
if
(
vga
)
{
DRM_INFO
(
"pci: %s detected
\n
"
,
/*
vga
?
"virtio-vga"
:
"virtio-gpu-pci"
);
* Need to make sure we don't have two drivers
* for the same hardware here. Some day we
* will simply kick out the firmware
* (vesa/efi) framebuffer.
*
* Virtual hardware specs for virtio-vga are
* not finalized yet, therefore we can't add
* code for that yet.
*
* So ignore the device for the time being,
* and suggest to the user use the device
* variant without vga compatibility mode.
*/
DRM_ERROR
(
"virtio-vga not (yet) supported
\n
"
);
DRM_ERROR
(
"please use virtio-gpu-pci instead
\n
"
);
ret
=
-
ENODEV
;
goto
err_free
;
}
dev
->
pdev
=
pdev
;
dev
->
pdev
=
pdev
;
if
(
vga
)
virtio_pci_kick_out_firmware_fb
(
pdev
);
}
}
ret
=
drm_dev_register
(
dev
,
0
);
ret
=
drm_dev_register
(
dev
,
0
);
...
...
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