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
4d8b3d34
Commit
4d8b3d34
authored
May 23, 2016
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau: size is u64 everywhere
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
605f9ccd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
19 deletions
+21
-19
drivers/gpu/drm/nouveau/nouveau_bo.c
drivers/gpu/drm/nouveau/nouveau_bo.c
+18
-16
drivers/gpu/drm/nouveau/nouveau_bo.h
drivers/gpu/drm/nouveau/nouveau_bo.h
+1
-1
drivers/gpu/drm/nouveau/nouveau_gem.c
drivers/gpu/drm/nouveau/nouveau_gem.c
+1
-1
drivers/gpu/drm/nouveau/nouveau_gem.h
drivers/gpu/drm/nouveau/nouveau_gem.h
+1
-1
No files found.
drivers/gpu/drm/nouveau/nouveau_bo.c
View file @
4d8b3d34
...
@@ -139,9 +139,17 @@ nouveau_bo_del_ttm(struct ttm_buffer_object *bo)
...
@@ -139,9 +139,17 @@ nouveau_bo_del_ttm(struct ttm_buffer_object *bo)
kfree
(
nvbo
);
kfree
(
nvbo
);
}
}
static
inline
u64
roundup_64
(
u64
x
,
u32
y
)
{
x
+=
y
-
1
;
do_div
(
x
,
y
);
return
x
*
y
;
}
static
void
static
void
nouveau_bo_fixup_align
(
struct
nouveau_bo
*
nvbo
,
u32
flags
,
nouveau_bo_fixup_align
(
struct
nouveau_bo
*
nvbo
,
u32
flags
,
int
*
align
,
int
*
size
)
int
*
align
,
u64
*
size
)
{
{
struct
nouveau_drm
*
drm
=
nouveau_bdev
(
nvbo
->
bo
.
bdev
);
struct
nouveau_drm
*
drm
=
nouveau_bdev
(
nvbo
->
bo
.
bdev
);
struct
nvif_device
*
device
=
&
drm
->
client
.
device
;
struct
nvif_device
*
device
=
&
drm
->
client
.
device
;
...
@@ -150,31 +158,31 @@ nouveau_bo_fixup_align(struct nouveau_bo *nvbo, u32 flags,
...
@@ -150,31 +158,31 @@ nouveau_bo_fixup_align(struct nouveau_bo *nvbo, u32 flags,
if
(
nvbo
->
tile_mode
)
{
if
(
nvbo
->
tile_mode
)
{
if
(
device
->
info
.
chipset
>=
0x40
)
{
if
(
device
->
info
.
chipset
>=
0x40
)
{
*
align
=
65536
;
*
align
=
65536
;
*
size
=
roundup
(
*
size
,
64
*
nvbo
->
tile_mode
);
*
size
=
roundup
_64
(
*
size
,
64
*
nvbo
->
tile_mode
);
}
else
if
(
device
->
info
.
chipset
>=
0x30
)
{
}
else
if
(
device
->
info
.
chipset
>=
0x30
)
{
*
align
=
32768
;
*
align
=
32768
;
*
size
=
roundup
(
*
size
,
64
*
nvbo
->
tile_mode
);
*
size
=
roundup
_64
(
*
size
,
64
*
nvbo
->
tile_mode
);
}
else
if
(
device
->
info
.
chipset
>=
0x20
)
{
}
else
if
(
device
->
info
.
chipset
>=
0x20
)
{
*
align
=
16384
;
*
align
=
16384
;
*
size
=
roundup
(
*
size
,
64
*
nvbo
->
tile_mode
);
*
size
=
roundup
_64
(
*
size
,
64
*
nvbo
->
tile_mode
);
}
else
if
(
device
->
info
.
chipset
>=
0x10
)
{
}
else
if
(
device
->
info
.
chipset
>=
0x10
)
{
*
align
=
16384
;
*
align
=
16384
;
*
size
=
roundup
(
*
size
,
32
*
nvbo
->
tile_mode
);
*
size
=
roundup
_64
(
*
size
,
32
*
nvbo
->
tile_mode
);
}
}
}
}
}
else
{
}
else
{
*
size
=
roundup
(
*
size
,
(
1
<<
nvbo
->
page_shift
));
*
size
=
roundup
_64
(
*
size
,
(
1
<<
nvbo
->
page_shift
));
*
align
=
max
((
1
<<
nvbo
->
page_shift
),
*
align
);
*
align
=
max
((
1
<<
nvbo
->
page_shift
),
*
align
);
}
}
*
size
=
roundup
(
*
size
,
PAGE_SIZE
);
*
size
=
roundup
_64
(
*
size
,
PAGE_SIZE
);
}
}
int
int
nouveau_bo_new
(
struct
nouveau_cli
*
cli
,
int
size
,
int
align
,
nouveau_bo_new
(
struct
nouveau_cli
*
cli
,
u64
size
,
int
align
,
uint32_t
flags
,
uint32_t
tile_mode
,
uint32_t
tile_flags
,
uint32_t
flags
,
uint32_t
tile_mode
,
uint32_t
tile_flags
,
struct
sg_table
*
sg
,
struct
reservation_object
*
robj
,
struct
sg_table
*
sg
,
struct
reservation_object
*
robj
,
struct
nouveau_bo
**
pnvbo
)
struct
nouveau_bo
**
pnvbo
)
...
@@ -184,15 +192,9 @@ nouveau_bo_new(struct nouveau_cli *cli, int size, int align,
...
@@ -184,15 +192,9 @@ nouveau_bo_new(struct nouveau_cli *cli, int size, int align,
size_t
acc_size
;
size_t
acc_size
;
int
ret
;
int
ret
;
int
type
=
ttm_bo_type_device
;
int
type
=
ttm_bo_type_device
;
int
lpg_shift
=
12
;
int
max_size
;
if
(
drm
->
client
.
vm
)
lpg_shift
=
drm
->
client
.
vm
->
mmu
->
lpg_shift
;
max_size
=
INT_MAX
&
~
((
1
<<
lpg_shift
)
-
1
);
if
(
size
<=
0
||
size
>
max_
size
)
{
if
(
!
size
)
{
NV_WARN
(
drm
,
"skipped size %
x
\n
"
,
(
u32
)
size
);
NV_WARN
(
drm
,
"skipped size %
016llx
\n
"
,
size
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
...
...
drivers/gpu/drm/nouveau/nouveau_bo.h
View file @
4d8b3d34
...
@@ -71,7 +71,7 @@ nouveau_bo_ref(struct nouveau_bo *ref, struct nouveau_bo **pnvbo)
...
@@ -71,7 +71,7 @@ nouveau_bo_ref(struct nouveau_bo *ref, struct nouveau_bo **pnvbo)
extern
struct
ttm_bo_driver
nouveau_bo_driver
;
extern
struct
ttm_bo_driver
nouveau_bo_driver
;
void
nouveau_bo_move_init
(
struct
nouveau_drm
*
);
void
nouveau_bo_move_init
(
struct
nouveau_drm
*
);
int
nouveau_bo_new
(
struct
nouveau_cli
*
,
int
size
,
int
align
,
u32
flags
,
int
nouveau_bo_new
(
struct
nouveau_cli
*
,
u64
size
,
int
align
,
u32
flags
,
u32
tile_mode
,
u32
tile_flags
,
struct
sg_table
*
sg
,
u32
tile_mode
,
u32
tile_flags
,
struct
sg_table
*
sg
,
struct
reservation_object
*
robj
,
struct
reservation_object
*
robj
,
struct
nouveau_bo
**
);
struct
nouveau_bo
**
);
...
...
drivers/gpu/drm/nouveau/nouveau_gem.c
View file @
4d8b3d34
...
@@ -175,7 +175,7 @@ nouveau_gem_object_close(struct drm_gem_object *gem, struct drm_file *file_priv)
...
@@ -175,7 +175,7 @@ nouveau_gem_object_close(struct drm_gem_object *gem, struct drm_file *file_priv)
}
}
int
int
nouveau_gem_new
(
struct
nouveau_cli
*
cli
,
int
size
,
int
align
,
uint32_t
domain
,
nouveau_gem_new
(
struct
nouveau_cli
*
cli
,
u64
size
,
int
align
,
uint32_t
domain
,
uint32_t
tile_mode
,
uint32_t
tile_flags
,
uint32_t
tile_mode
,
uint32_t
tile_flags
,
struct
nouveau_bo
**
pnvbo
)
struct
nouveau_bo
**
pnvbo
)
{
{
...
...
drivers/gpu/drm/nouveau/nouveau_gem.h
View file @
4d8b3d34
...
@@ -16,7 +16,7 @@ nouveau_gem_object(struct drm_gem_object *gem)
...
@@ -16,7 +16,7 @@ nouveau_gem_object(struct drm_gem_object *gem)
}
}
/* nouveau_gem.c */
/* nouveau_gem.c */
extern
int
nouveau_gem_new
(
struct
nouveau_cli
*
,
int
size
,
int
align
,
extern
int
nouveau_gem_new
(
struct
nouveau_cli
*
,
u64
size
,
int
align
,
uint32_t
domain
,
uint32_t
tile_mode
,
uint32_t
domain
,
uint32_t
tile_mode
,
uint32_t
tile_flags
,
struct
nouveau_bo
**
);
uint32_t
tile_flags
,
struct
nouveau_bo
**
);
extern
void
nouveau_gem_object_del
(
struct
drm_gem_object
*
);
extern
void
nouveau_gem_object_del
(
struct
drm_gem_object
*
);
...
...
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