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
nexedi
linux
Commits
4feb7659
Commit
4feb7659
authored
Nov 24, 2014
by
Daniel Vetter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/i915: Remove user pinning code
Now unused. Signed-off-by:
Daniel Vetter
<
daniel.vetter@intel.com
>
parent
d65621c4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
123 deletions
+17
-123
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_debugfs.c
+1
-3
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_dma.c
+9
-2
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_drv.h
+0
-8
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_gem.c
+3
-103
drivers/gpu/drm/i915/i915_gem_gtt.h
drivers/gpu/drm/i915/i915_gem_gtt.h
+4
-5
drivers/gpu/drm/i915/i915_gpu_error.c
drivers/gpu/drm/i915/i915_gpu_error.c
+0
-2
No files found.
drivers/gpu/drm/i915/i915_debugfs.c
View file @
4feb7659
...
...
@@ -96,9 +96,7 @@ static int i915_capabilities(struct seq_file *m, void *data)
static
const
char
*
get_pin_flag
(
struct
drm_i915_gem_object
*
obj
)
{
if
(
obj
->
user_pin_count
>
0
)
return
"P"
;
else
if
(
i915_gem_obj_is_pinned
(
obj
))
if
(
i915_gem_obj_is_pinned
(
obj
))
return
"p"
;
else
return
" "
;
...
...
drivers/gpu/drm/i915/i915_dma.c
View file @
4feb7659
...
...
@@ -1004,6 +1004,13 @@ void i915_driver_postclose(struct drm_device *dev, struct drm_file *file)
kfree
(
file_priv
);
}
static
int
i915_gem_reject_pin_ioctl
(
struct
drm_device
*
dev
,
void
*
data
,
struct
drm_file
*
file
)
{
return
-
ENODEV
;
}
const
struct
drm_ioctl_desc
i915_ioctls
[]
=
{
DRM_IOCTL_DEF_DRV
(
I915_INIT
,
drm_noop
,
DRM_AUTH
|
DRM_MASTER
|
DRM_ROOT_ONLY
),
DRM_IOCTL_DEF_DRV
(
I915_FLUSH
,
drm_noop
,
DRM_AUTH
),
...
...
@@ -1025,8 +1032,8 @@ const struct drm_ioctl_desc i915_ioctls[] = {
DRM_IOCTL_DEF_DRV
(
I915_GEM_INIT
,
drm_noop
,
DRM_AUTH
|
DRM_MASTER
|
DRM_ROOT_ONLY
|
DRM_UNLOCKED
),
DRM_IOCTL_DEF_DRV
(
I915_GEM_EXECBUFFER
,
i915_gem_execbuffer
,
DRM_AUTH
|
DRM_UNLOCKED
),
DRM_IOCTL_DEF_DRV
(
I915_GEM_EXECBUFFER2
,
i915_gem_execbuffer2
,
DRM_AUTH
|
DRM_UNLOCKED
|
DRM_RENDER_ALLOW
),
DRM_IOCTL_DEF_DRV
(
I915_GEM_PIN
,
i915_gem_pin_ioctl
,
DRM_AUTH
|
DRM_ROOT_ONLY
|
DRM_UNLOCKED
),
DRM_IOCTL_DEF_DRV
(
I915_GEM_UNPIN
,
i915_gem_
un
pin_ioctl
,
DRM_AUTH
|
DRM_ROOT_ONLY
|
DRM_UNLOCKED
),
DRM_IOCTL_DEF_DRV
(
I915_GEM_PIN
,
i915_gem_
reject_
pin_ioctl
,
DRM_AUTH
|
DRM_ROOT_ONLY
|
DRM_UNLOCKED
),
DRM_IOCTL_DEF_DRV
(
I915_GEM_UNPIN
,
i915_gem_
reject_
pin_ioctl
,
DRM_AUTH
|
DRM_ROOT_ONLY
|
DRM_UNLOCKED
),
DRM_IOCTL_DEF_DRV
(
I915_GEM_BUSY
,
i915_gem_busy_ioctl
,
DRM_AUTH
|
DRM_UNLOCKED
|
DRM_RENDER_ALLOW
),
DRM_IOCTL_DEF_DRV
(
I915_GEM_SET_CACHING
,
i915_gem_set_caching_ioctl
,
DRM_UNLOCKED
|
DRM_RENDER_ALLOW
),
DRM_IOCTL_DEF_DRV
(
I915_GEM_GET_CACHING
,
i915_gem_get_caching_ioctl
,
DRM_UNLOCKED
|
DRM_RENDER_ALLOW
),
...
...
drivers/gpu/drm/i915/i915_drv.h
View file @
4feb7659
...
...
@@ -1958,10 +1958,6 @@ struct drm_i915_gem_object {
/** Record of address bit 17 of each page at last unbind. */
unsigned
long
*
bit_17
;
/** User space pin count and filp owning the pin */
unsigned
long
user_pin_count
;
struct
drm_file
*
pin_filp
;
union
{
/** for phy allocated objects */
struct
drm_dma_handle
*
phys_handle
;
...
...
@@ -2428,10 +2424,6 @@ int i915_gem_execbuffer(struct drm_device *dev, void *data,
struct
drm_file
*
file_priv
);
int
i915_gem_execbuffer2
(
struct
drm_device
*
dev
,
void
*
data
,
struct
drm_file
*
file_priv
);
int
i915_gem_pin_ioctl
(
struct
drm_device
*
dev
,
void
*
data
,
struct
drm_file
*
file_priv
);
int
i915_gem_unpin_ioctl
(
struct
drm_device
*
dev
,
void
*
data
,
struct
drm_file
*
file_priv
);
int
i915_gem_busy_ioctl
(
struct
drm_device
*
dev
,
void
*
data
,
struct
drm_file
*
file_priv
);
int
i915_gem_get_caching_ioctl
(
struct
drm_device
*
dev
,
void
*
data
,
...
...
drivers/gpu/drm/i915/i915_gem.c
View file @
4feb7659
...
...
@@ -3903,18 +3903,14 @@ static bool is_pin_display(struct drm_i915_gem_object *obj)
if
(
!
vma
)
return
false
;
/* There are
3
sources that pin objects:
/* There are
2
sources that pin objects:
* 1. The display engine (scanouts, sprites, cursors);
* 2. Reservations for execbuffer;
* 3. The user.
*
* We can ignore reservations as we hold the struct_mutex and
* are only called outside of the reservation path. The user
* can only increment pin_count once, and so if after
* subtracting the potential reference by the user, any pin_count
* remains, it must be due to another use by the display engine.
* are only called outside of the reservation path.
*/
return
vma
->
pin_count
-
!!
obj
->
user_pin_count
;
return
vma
->
pin_count
;
}
/*
...
...
@@ -4257,102 +4253,6 @@ i915_gem_object_unpin_fence(struct drm_i915_gem_object *obj)
}
}
int
i915_gem_pin_ioctl
(
struct
drm_device
*
dev
,
void
*
data
,
struct
drm_file
*
file
)
{
struct
drm_i915_gem_pin
*
args
=
data
;
struct
drm_i915_gem_object
*
obj
;
int
ret
;
if
(
drm_core_check_feature
(
dev
,
DRIVER_MODESET
))
return
-
ENODEV
;
ret
=
i915_mutex_lock_interruptible
(
dev
);
if
(
ret
)
return
ret
;
obj
=
to_intel_bo
(
drm_gem_object_lookup
(
dev
,
file
,
args
->
handle
));
if
(
&
obj
->
base
==
NULL
)
{
ret
=
-
ENOENT
;
goto
unlock
;
}
if
(
obj
->
madv
!=
I915_MADV_WILLNEED
)
{
DRM_DEBUG
(
"Attempting to pin a purgeable buffer
\n
"
);
ret
=
-
EFAULT
;
goto
out
;
}
if
(
obj
->
pin_filp
!=
NULL
&&
obj
->
pin_filp
!=
file
)
{
DRM_DEBUG
(
"Already pinned in i915_gem_pin_ioctl(): %d
\n
"
,
args
->
handle
);
ret
=
-
EINVAL
;
goto
out
;
}
if
(
obj
->
user_pin_count
==
ULONG_MAX
)
{
ret
=
-
EBUSY
;
goto
out
;
}
if
(
obj
->
user_pin_count
==
0
)
{
ret
=
i915_gem_obj_ggtt_pin
(
obj
,
args
->
alignment
,
PIN_MAPPABLE
);
if
(
ret
)
goto
out
;
}
obj
->
user_pin_count
++
;
obj
->
pin_filp
=
file
;
args
->
offset
=
i915_gem_obj_ggtt_offset
(
obj
);
out:
drm_gem_object_unreference
(
&
obj
->
base
);
unlock:
mutex_unlock
(
&
dev
->
struct_mutex
);
return
ret
;
}
int
i915_gem_unpin_ioctl
(
struct
drm_device
*
dev
,
void
*
data
,
struct
drm_file
*
file
)
{
struct
drm_i915_gem_pin
*
args
=
data
;
struct
drm_i915_gem_object
*
obj
;
int
ret
;
if
(
drm_core_check_feature
(
dev
,
DRIVER_MODESET
))
return
-
ENODEV
;
ret
=
i915_mutex_lock_interruptible
(
dev
);
if
(
ret
)
return
ret
;
obj
=
to_intel_bo
(
drm_gem_object_lookup
(
dev
,
file
,
args
->
handle
));
if
(
&
obj
->
base
==
NULL
)
{
ret
=
-
ENOENT
;
goto
unlock
;
}
if
(
obj
->
pin_filp
!=
file
)
{
DRM_DEBUG
(
"Not pinned by caller in i915_gem_pin_ioctl(): %d
\n
"
,
args
->
handle
);
ret
=
-
EINVAL
;
goto
out
;
}
obj
->
user_pin_count
--
;
if
(
obj
->
user_pin_count
==
0
)
{
obj
->
pin_filp
=
NULL
;
i915_gem_object_ggtt_unpin
(
obj
);
}
out:
drm_gem_object_unreference
(
&
obj
->
base
);
unlock:
mutex_unlock
(
&
dev
->
struct_mutex
);
return
ret
;
}
int
i915_gem_busy_ioctl
(
struct
drm_device
*
dev
,
void
*
data
,
struct
drm_file
*
file
)
...
...
drivers/gpu/drm/i915/i915_gem_gtt.h
View file @
4feb7659
...
...
@@ -146,11 +146,10 @@ struct i915_vma {
/**
* How many users have pinned this object in GTT space. The following
* users can each hold at most one reference: pwrite/pread, pin_ioctl
* (via user_pin_count), execbuffer (objects are not allowed multiple
* times for the same batchbuffer), and the framebuffer code. When
* switching/pageflipping, the framebuffer code has at most two buffers
* pinned per crtc.
* users can each hold at most one reference: pwrite/pread, execbuffer
* (objects are not allowed multiple times for the same batchbuffer),
* and the framebuffer code. When switching/pageflipping, the
* framebuffer code has at most two buffers pinned per crtc.
*
* In the worst case this is 1 + 1 + 1 + 2*2 = 7. That would fit into 3
* bits with absolutely no headroom. So use 4 bits. */
...
...
drivers/gpu/drm/i915/i915_gpu_error.c
View file @
4feb7659
...
...
@@ -679,8 +679,6 @@ static void capture_bo(struct drm_i915_error_buffer *err,
err
->
pinned
=
0
;
if
(
i915_gem_obj_is_pinned
(
obj
))
err
->
pinned
=
1
;
if
(
obj
->
user_pin_count
>
0
)
err
->
pinned
=
-
1
;
err
->
tiling
=
obj
->
tiling_mode
;
err
->
dirty
=
obj
->
dirty
;
err
->
purgeable
=
obj
->
madv
!=
I915_MADV_WILLNEED
;
...
...
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