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
bbc2cd07
Commit
bbc2cd07
authored
Jan 09, 2019
by
Rob Clark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/msm: honor GPU_READONLY flag
Signed-off-by:
Rob Clark
<
robdclark@gmail.com
>
parent
895ad6b0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
5 deletions
+11
-5
drivers/gpu/drm/msm/msm_drv.h
drivers/gpu/drm/msm/msm_drv.h
+2
-1
drivers/gpu/drm/msm/msm_gem.c
drivers/gpu/drm/msm/msm_gem.c
+6
-2
drivers/gpu/drm/msm/msm_gem_vma.c
drivers/gpu/drm/msm/msm_gem_vma.c
+3
-2
No files found.
drivers/gpu/drm/msm/msm_drv.h
View file @
bbc2cd07
...
@@ -250,7 +250,8 @@ void msm_gem_purge_vma(struct msm_gem_address_space *aspace,
...
@@ -250,7 +250,8 @@ void msm_gem_purge_vma(struct msm_gem_address_space *aspace,
void
msm_gem_unmap_vma
(
struct
msm_gem_address_space
*
aspace
,
void
msm_gem_unmap_vma
(
struct
msm_gem_address_space
*
aspace
,
struct
msm_gem_vma
*
vma
);
struct
msm_gem_vma
*
vma
);
int
msm_gem_map_vma
(
struct
msm_gem_address_space
*
aspace
,
int
msm_gem_map_vma
(
struct
msm_gem_address_space
*
aspace
,
struct
msm_gem_vma
*
vma
,
struct
sg_table
*
sgt
,
int
npages
);
struct
msm_gem_vma
*
vma
,
int
prot
,
struct
sg_table
*
sgt
,
int
npages
);
void
msm_gem_close_vma
(
struct
msm_gem_address_space
*
aspace
,
void
msm_gem_close_vma
(
struct
msm_gem_address_space
*
aspace
,
struct
msm_gem_vma
*
vma
);
struct
msm_gem_vma
*
vma
);
...
...
drivers/gpu/drm/msm/msm_gem.c
View file @
bbc2cd07
...
@@ -391,6 +391,10 @@ static int msm_gem_pin_iova(struct drm_gem_object *obj,
...
@@ -391,6 +391,10 @@ static int msm_gem_pin_iova(struct drm_gem_object *obj,
struct
msm_gem_object
*
msm_obj
=
to_msm_bo
(
obj
);
struct
msm_gem_object
*
msm_obj
=
to_msm_bo
(
obj
);
struct
msm_gem_vma
*
vma
;
struct
msm_gem_vma
*
vma
;
struct
page
**
pages
;
struct
page
**
pages
;
int
prot
=
IOMMU_READ
;
if
(
!
(
msm_obj
->
flags
&
MSM_BO_GPU_READONLY
))
prot
|=
IOMMU_WRITE
;
WARN_ON
(
!
mutex_is_locked
(
&
msm_obj
->
lock
));
WARN_ON
(
!
mutex_is_locked
(
&
msm_obj
->
lock
));
...
@@ -405,8 +409,8 @@ static int msm_gem_pin_iova(struct drm_gem_object *obj,
...
@@ -405,8 +409,8 @@ static int msm_gem_pin_iova(struct drm_gem_object *obj,
if
(
IS_ERR
(
pages
))
if
(
IS_ERR
(
pages
))
return
PTR_ERR
(
pages
);
return
PTR_ERR
(
pages
);
return
msm_gem_map_vma
(
aspace
,
vma
,
msm_obj
->
sg
t
,
return
msm_gem_map_vma
(
aspace
,
vma
,
pro
t
,
obj
->
size
>>
PAGE_SHIFT
);
msm_obj
->
sgt
,
obj
->
size
>>
PAGE_SHIFT
);
}
}
/* get iova and pin it. Should have a matching put */
/* get iova and pin it. Should have a matching put */
...
...
drivers/gpu/drm/msm/msm_gem_vma.c
View file @
bbc2cd07
...
@@ -68,7 +68,8 @@ void msm_gem_unmap_vma(struct msm_gem_address_space *aspace,
...
@@ -68,7 +68,8 @@ void msm_gem_unmap_vma(struct msm_gem_address_space *aspace,
int
int
msm_gem_map_vma
(
struct
msm_gem_address_space
*
aspace
,
msm_gem_map_vma
(
struct
msm_gem_address_space
*
aspace
,
struct
msm_gem_vma
*
vma
,
struct
sg_table
*
sgt
,
int
npages
)
struct
msm_gem_vma
*
vma
,
int
prot
,
struct
sg_table
*
sgt
,
int
npages
)
{
{
unsigned
size
=
npages
<<
PAGE_SHIFT
;
unsigned
size
=
npages
<<
PAGE_SHIFT
;
int
ret
=
0
;
int
ret
=
0
;
...
@@ -86,7 +87,7 @@ msm_gem_map_vma(struct msm_gem_address_space *aspace,
...
@@ -86,7 +87,7 @@ msm_gem_map_vma(struct msm_gem_address_space *aspace,
if
(
aspace
->
mmu
)
if
(
aspace
->
mmu
)
ret
=
aspace
->
mmu
->
funcs
->
map
(
aspace
->
mmu
,
vma
->
iova
,
sgt
,
ret
=
aspace
->
mmu
->
funcs
->
map
(
aspace
->
mmu
,
vma
->
iova
,
sgt
,
size
,
IOMMU_READ
|
IOMMU_WRITE
);
size
,
prot
);
if
(
ret
)
if
(
ret
)
vma
->
mapped
=
false
;
vma
->
mapped
=
false
;
...
...
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