Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
4feb7659
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
4feb7659
编写于
11月 24, 2014
作者:
D
Daniel Vetter
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/i915: Remove user pinning code
Now unused. Signed-off-by:
N
Daniel Vetter
<
daniel.vetter@intel.com
>
上级
d65621c4
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
17 addition
and
123 deletion
+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
未找到文件。
drivers/gpu/drm/i915/i915_debugfs.c
浏览文件 @
4feb7659
...
@@ -96,9 +96,7 @@ static int i915_capabilities(struct seq_file *m, void *data)
...
@@ -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
)
static
const
char
*
get_pin_flag
(
struct
drm_i915_gem_object
*
obj
)
{
{
if
(
obj
->
user_pin_count
>
0
)
if
(
i915_gem_obj_is_pinned
(
obj
))
return
"P"
;
else
if
(
i915_gem_obj_is_pinned
(
obj
))
return
"p"
;
return
"p"
;
else
else
return
" "
;
return
" "
;
...
...
drivers/gpu/drm/i915/i915_dma.c
浏览文件 @
4feb7659
...
@@ -1004,6 +1004,13 @@ void i915_driver_postclose(struct drm_device *dev, struct drm_file *file)
...
@@ -1004,6 +1004,13 @@ void i915_driver_postclose(struct drm_device *dev, struct drm_file *file)
kfree
(
file_priv
);
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
[]
=
{
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_INIT
,
drm_noop
,
DRM_AUTH
|
DRM_MASTER
|
DRM_ROOT_ONLY
),
DRM_IOCTL_DEF_DRV
(
I915_FLUSH
,
drm_noop
,
DRM_AUTH
),
DRM_IOCTL_DEF_DRV
(
I915_FLUSH
,
drm_noop
,
DRM_AUTH
),
...
@@ -1025,8 +1032,8 @@ const struct drm_ioctl_desc i915_ioctls[] = {
...
@@ -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_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_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_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_PIN
,
i915_gem_
reject_
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_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_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_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
),
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
浏览文件 @
4feb7659
...
@@ -1958,10 +1958,6 @@ struct drm_i915_gem_object {
...
@@ -1958,10 +1958,6 @@ struct drm_i915_gem_object {
/** Record of address bit 17 of each page at last unbind. */
/** Record of address bit 17 of each page at last unbind. */
unsigned
long
*
bit_17
;
unsigned
long
*
bit_17
;
/** User space pin count and filp owning the pin */
unsigned
long
user_pin_count
;
struct
drm_file
*
pin_filp
;
union
{
union
{
/** for phy allocated objects */
/** for phy allocated objects */
struct
drm_dma_handle
*
phys_handle
;
struct
drm_dma_handle
*
phys_handle
;
...
@@ -2428,10 +2424,6 @@ int i915_gem_execbuffer(struct drm_device *dev, void *data,
...
@@ -2428,10 +2424,6 @@ int i915_gem_execbuffer(struct drm_device *dev, void *data,
struct
drm_file
*
file_priv
);
struct
drm_file
*
file_priv
);
int
i915_gem_execbuffer2
(
struct
drm_device
*
dev
,
void
*
data
,
int
i915_gem_execbuffer2
(
struct
drm_device
*
dev
,
void
*
data
,
struct
drm_file
*
file_priv
);
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
,
int
i915_gem_busy_ioctl
(
struct
drm_device
*
dev
,
void
*
data
,
struct
drm_file
*
file_priv
);
struct
drm_file
*
file_priv
);
int
i915_gem_get_caching_ioctl
(
struct
drm_device
*
dev
,
void
*
data
,
int
i915_gem_get_caching_ioctl
(
struct
drm_device
*
dev
,
void
*
data
,
...
...
drivers/gpu/drm/i915/i915_gem.c
浏览文件 @
4feb7659
...
@@ -3903,18 +3903,14 @@ static bool is_pin_display(struct drm_i915_gem_object *obj)
...
@@ -3903,18 +3903,14 @@ static bool is_pin_display(struct drm_i915_gem_object *obj)
if
(
!
vma
)
if
(
!
vma
)
return
false
;
return
false
;
/* There are
3
sources that pin objects:
/* There are
2
sources that pin objects:
* 1. The display engine (scanouts, sprites, cursors);
* 1. The display engine (scanouts, sprites, cursors);
* 2. Reservations for execbuffer;
* 2. Reservations for execbuffer;
* 3. The user.
*
*
* We can ignore reservations as we hold the struct_mutex and
* We can ignore reservations as we hold the struct_mutex and
* are only called outside of the reservation path. The user
* are only called outside of the reservation path.
* 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.
*/
*/
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)
...
@@ -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
int
i915_gem_busy_ioctl
(
struct
drm_device
*
dev
,
void
*
data
,
i915_gem_busy_ioctl
(
struct
drm_device
*
dev
,
void
*
data
,
struct
drm_file
*
file
)
struct
drm_file
*
file
)
...
...
drivers/gpu/drm/i915/i915_gem_gtt.h
浏览文件 @
4feb7659
...
@@ -146,11 +146,10 @@ struct i915_vma {
...
@@ -146,11 +146,10 @@ struct i915_vma {
/**
/**
* How many users have pinned this object in GTT space. The following
* How many users have pinned this object in GTT space. The following
* users can each hold at most one reference: pwrite/pread, pin_ioctl
* users can each hold at most one reference: pwrite/pread, execbuffer
* (via user_pin_count), execbuffer (objects are not allowed multiple
* (objects are not allowed multiple times for the same batchbuffer),
* times for the same batchbuffer), and the framebuffer code. When
* and the framebuffer code. When switching/pageflipping, the
* switching/pageflipping, the framebuffer code has at most two buffers
* framebuffer code has at most two buffers pinned per crtc.
* pinned per crtc.
*
*
* In the worst case this is 1 + 1 + 1 + 2*2 = 7. That would fit into 3
* 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. */
* bits with absolutely no headroom. So use 4 bits. */
...
...
drivers/gpu/drm/i915/i915_gpu_error.c
浏览文件 @
4feb7659
...
@@ -679,8 +679,6 @@ static void capture_bo(struct drm_i915_error_buffer *err,
...
@@ -679,8 +679,6 @@ static void capture_bo(struct drm_i915_error_buffer *err,
err
->
pinned
=
0
;
err
->
pinned
=
0
;
if
(
i915_gem_obj_is_pinned
(
obj
))
if
(
i915_gem_obj_is_pinned
(
obj
))
err
->
pinned
=
1
;
err
->
pinned
=
1
;
if
(
obj
->
user_pin_count
>
0
)
err
->
pinned
=
-
1
;
err
->
tiling
=
obj
->
tiling_mode
;
err
->
tiling
=
obj
->
tiling_mode
;
err
->
dirty
=
obj
->
dirty
;
err
->
dirty
=
obj
->
dirty
;
err
->
purgeable
=
obj
->
madv
!=
I915_MADV_WILLNEED
;
err
->
purgeable
=
obj
->
madv
!=
I915_MADV_WILLNEED
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录