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
33dbc27f
Commit
33dbc27f
authored
Sep 30, 2011
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau: add dumb ioctl support
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
caca6a03
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
0 deletions
+55
-0
drivers/gpu/drm/nouveau/nouveau_display.c
drivers/gpu/drm/nouveau/nouveau_display.c
+45
-0
drivers/gpu/drm/nouveau/nouveau_drv.c
drivers/gpu/drm/nouveau/nouveau_drv.c
+4
-0
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_drv.h
+6
-0
No files found.
drivers/gpu/drm/nouveau/nouveau_display.c
View file @
33dbc27f
...
...
@@ -369,3 +369,48 @@ nouveau_finish_page_flip(struct nouveau_channel *chan,
spin_unlock_irqrestore
(
&
dev
->
event_lock
,
flags
);
return
0
;
}
int
nouveau_display_dumb_create
(
struct
drm_file
*
file_priv
,
struct
drm_device
*
dev
,
struct
drm_mode_create_dumb
*
args
)
{
struct
nouveau_bo
*
bo
;
int
ret
;
args
->
pitch
=
roundup
(
args
->
width
*
(
args
->
bpp
/
8
),
256
);
args
->
size
=
args
->
pitch
*
args
->
height
;
args
->
size
=
roundup
(
args
->
size
,
PAGE_SIZE
);
ret
=
nouveau_gem_new
(
dev
,
args
->
size
,
0
,
TTM_PL_FLAG_VRAM
,
0
,
0
,
&
bo
);
if
(
ret
)
return
ret
;
ret
=
drm_gem_handle_create
(
file_priv
,
bo
->
gem
,
&
args
->
handle
);
drm_gem_object_unreference_unlocked
(
bo
->
gem
);
return
ret
;
}
int
nouveau_display_dumb_destroy
(
struct
drm_file
*
file_priv
,
struct
drm_device
*
dev
,
uint32_t
handle
)
{
return
drm_gem_handle_delete
(
file_priv
,
handle
);
}
int
nouveau_display_dumb_map_offset
(
struct
drm_file
*
file_priv
,
struct
drm_device
*
dev
,
uint32_t
handle
,
uint64_t
*
poffset
)
{
struct
drm_gem_object
*
gem
;
gem
=
drm_gem_object_lookup
(
dev
,
file_priv
,
handle
);
if
(
gem
)
{
struct
nouveau_bo
*
bo
=
gem
->
driver_private
;
*
poffset
=
bo
->
bo
.
addr_space_offset
;
drm_gem_object_unreference_unlocked
(
gem
);
return
0
;
}
return
-
ENOENT
;
}
drivers/gpu/drm/nouveau/nouveau_drv.c
View file @
33dbc27f
...
...
@@ -433,6 +433,10 @@ static struct drm_driver driver = {
.
gem_open_object
=
nouveau_gem_object_open
,
.
gem_close_object
=
nouveau_gem_object_close
,
.
dumb_create
=
nouveau_display_dumb_create
,
.
dumb_map_offset
=
nouveau_display_dumb_map_offset
,
.
dumb_destroy
=
nouveau_display_dumb_destroy
,
.
name
=
DRIVER_NAME
,
.
desc
=
DRIVER_DESC
,
#ifdef GIT_REVISION
...
...
drivers/gpu/drm/nouveau/nouveau_drv.h
View file @
33dbc27f
...
...
@@ -1418,6 +1418,12 @@ int nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
struct
drm_pending_vblank_event
*
event
);
int
nouveau_finish_page_flip
(
struct
nouveau_channel
*
,
struct
nouveau_page_flip_state
*
);
int
nouveau_display_dumb_create
(
struct
drm_file
*
,
struct
drm_device
*
,
struct
drm_mode_create_dumb
*
args
);
int
nouveau_display_dumb_map_offset
(
struct
drm_file
*
,
struct
drm_device
*
,
uint32_t
handle
,
uint64_t
*
offset
);
int
nouveau_display_dumb_destroy
(
struct
drm_file
*
,
struct
drm_device
*
,
uint32_t
handle
);
/* nv10_gpio.c */
int
nv10_gpio_get
(
struct
drm_device
*
dev
,
enum
dcb_gpio_tag
tag
);
...
...
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