Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
5cc7f9ab
Commit
5cc7f9ab
authored
Feb 10, 2007
by
Dave Airlie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm: move protection stuff into separate function
Signed-off-by:
Dave Airlie
<
airlied@linux.ie
>
parent
8311d570
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
18 deletions
+26
-18
drivers/char/drm/drm_vm.c
drivers/char/drm/drm_vm.c
+26
-18
No files found.
drivers/char/drm/drm_vm.c
View file @
5cc7f9ab
...
...
@@ -41,6 +41,30 @@
static
void
drm_vm_open
(
struct
vm_area_struct
*
vma
);
static
void
drm_vm_close
(
struct
vm_area_struct
*
vma
);
pgprot_t
drm_io_prot
(
uint32_t
map_type
,
struct
vm_area_struct
*
vma
)
{
pgprot_t
tmp
=
vm_get_page_prot
(
vma
->
vm_flags
);
#if defined(__i386__) || defined(__x86_64__)
if
(
boot_cpu_data
.
x86
>
3
&&
map_type
!=
_DRM_AGP
)
{
pgprot_val
(
tmp
)
|=
_PAGE_PCD
;
pgprot_val
(
tmp
)
&=
~
_PAGE_PWT
;
}
#elif defined(__powerpc__)
pgprot_val
(
tmp
)
|=
_PAGE_NO_CACHE
;
if
(
map_type
==
_DRM_REGISTERS
)
pgprot_val
(
tmp
)
|=
_PAGE_GUARDED
;
#endif
#if defined(__ia64__)
if
(
efi_range_is_wc
(
vma
->
vm_start
,
vma
->
vm_end
-
vma
->
vm_start
))
tmp
=
pgprot_writecombine
(
tmp
);
else
tmp
=
pgprot_noncached
(
tmp
);
#endif
return
tmp
;
}
/**
* \c nopage method for AGP virtual memory.
*
...
...
@@ -600,25 +624,9 @@ int drm_mmap(struct file *filp, struct vm_area_struct *vma)
/* fall through to _DRM_FRAME_BUFFER... */
case
_DRM_FRAME_BUFFER
:
case
_DRM_REGISTERS
:
#if defined(__i386__) || defined(__x86_64__)
if
(
boot_cpu_data
.
x86
>
3
&&
map
->
type
!=
_DRM_AGP
)
{
pgprot_val
(
vma
->
vm_page_prot
)
|=
_PAGE_PCD
;
pgprot_val
(
vma
->
vm_page_prot
)
&=
~
_PAGE_PWT
;
}
#elif defined(__powerpc__)
pgprot_val
(
vma
->
vm_page_prot
)
|=
_PAGE_NO_CACHE
;
if
(
map
->
type
==
_DRM_REGISTERS
)
pgprot_val
(
vma
->
vm_page_prot
)
|=
_PAGE_GUARDED
;
#endif
vma
->
vm_flags
|=
VM_IO
;
/* not in core dump */
#if defined(__ia64__)
if
(
efi_range_is_wc
(
vma
->
vm_start
,
vma
->
vm_end
-
vma
->
vm_start
))
vma
->
vm_page_prot
=
pgprot_writecombine
(
vma
->
vm_page_prot
);
else
vma
->
vm_page_prot
=
pgprot_noncached
(
vma
->
vm_page_prot
);
#endif
offset
=
dev
->
driver
->
get_reg_ofs
(
dev
);
vma
->
vm_flags
|=
VM_IO
;
/* not in core dump */
vma
->
vm_page_prot
=
drm_io_prot
(
map
->
type
,
vma
);
#ifdef __sparc__
vma
->
vm_page_prot
=
pgprot_noncached
(
vma
->
vm_page_prot
);
if
(
io_remap_pfn_range
(
vma
,
vma
->
vm_start
,
...
...
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