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
307b9c02
Commit
307b9c02
authored
May 03, 2013
by
Dave Airlie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qxl: update to new idr interfaces.
Signed-off-by:
Dave Airlie
<
airlied@redhat.com
>
parent
d2dbaaf6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
24 deletions
+16
-24
drivers/gpu/drm/qxl/qxl_cmd.c
drivers/gpu/drm/qxl/qxl_cmd.c
+7
-12
drivers/gpu/drm/qxl/qxl_release.c
drivers/gpu/drm/qxl/qxl_release.c
+9
-12
No files found.
drivers/gpu/drm/qxl/qxl_cmd.c
View file @
307b9c02
...
...
@@ -435,22 +435,18 @@ void qxl_io_monitors_config(struct qxl_device *qdev)
int
qxl_surface_id_alloc
(
struct
qxl_device
*
qdev
,
struct
qxl_bo
*
surf
)
{
uint32_t
handle
=
-
ENOMEM
;
uint32_t
handle
;
int
idr_ret
;
int
count
=
0
;
again:
if
(
idr_pre_get
(
&
qdev
->
surf_id_idr
,
GFP_ATOMIC
)
==
0
)
{
DRM_ERROR
(
"Out of memory for surf idr
\n
"
);
kfree
(
surf
);
goto
alloc_fail
;
}
idr_preload
(
GFP_ATOMIC
);
spin_lock
(
&
qdev
->
surf_id_idr_lock
);
idr_ret
=
idr_
get_new_above
(
&
qdev
->
surf_id_idr
,
NULL
,
1
,
&
handle
);
idr_ret
=
idr_
alloc
(
&
qdev
->
surf_id_idr
,
NULL
,
1
,
0
,
GFP_NOWAIT
);
spin_unlock
(
&
qdev
->
surf_id_idr_lock
);
if
(
idr_ret
==
-
EAGAIN
)
goto
again
;
idr_preload_end
();
if
(
idr_ret
<
0
)
return
idr_ret
;
handle
=
idr_ret
;
if
(
handle
>=
qdev
->
rom
->
n_surfaces
)
{
count
++
;
...
...
@@ -465,7 +461,6 @@ int qxl_surface_id_alloc(struct qxl_device *qdev,
spin_lock
(
&
qdev
->
surf_id_idr_lock
);
qdev
->
last_alloced_surf_id
=
handle
;
spin_unlock
(
&
qdev
->
surf_id_idr_lock
);
alloc_fail:
return
0
;
}
...
...
drivers/gpu/drm/qxl/qxl_release.c
View file @
307b9c02
...
...
@@ -43,7 +43,7 @@ qxl_release_alloc(struct qxl_device *qdev, int type,
struct
qxl_release
**
ret
)
{
struct
qxl_release
*
release
;
int
handle
=
0
;
int
handle
;
size_t
size
=
sizeof
(
*
release
);
int
idr_ret
;
...
...
@@ -56,18 +56,15 @@ qxl_release_alloc(struct qxl_device *qdev, int type,
release
->
bo_count
=
0
;
release
->
release_offset
=
0
;
release
->
surface_release_id
=
0
;
again:
if
(
idr_pre_get
(
&
qdev
->
release_idr
,
GFP_KERNEL
)
==
0
)
{
DRM_ERROR
(
"Out of memory for release idr
\n
"
);
kfree
(
release
);
goto
release_fail
;
}
idr_preload
(
GFP_KERNEL
);
spin_lock
(
&
qdev
->
release_idr_lock
);
idr_ret
=
idr_
get_new_above
(
&
qdev
->
release_idr
,
release
,
1
,
&
handle
);
idr_ret
=
idr_
alloc
(
&
qdev
->
release_idr
,
release
,
1
,
0
,
GFP_NOWAIT
);
spin_unlock
(
&
qdev
->
release_idr_lock
);
if
(
idr_ret
==
-
EAGAIN
)
goto
again
;
if
(
ret
)
idr_preload_end
();
handle
=
idr_ret
;
if
(
idr_ret
<
0
)
goto
release_fail
;
*
ret
=
release
;
QXL_INFO
(
qdev
,
"allocated release %lld
\n
"
,
handle
);
release
->
id
=
handle
;
...
...
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