drm: qxl: Drop duplicated device pointer attribute
qxl_device duplicates a pointer to struct device, which is not needed since we already have it in the drm_device structure. Clean it up. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk> Link: http://patchwork.freedesktop.org/patch/msgid/20170127010548.27970-2-krisman@collabora.co.uk Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Родитель
768851b92c
Коммит
5472bdee3f
|
@ -242,7 +242,6 @@ void qxl_debugfs_remove_files(struct qxl_device *qdev);
|
||||||
struct qxl_device;
|
struct qxl_device;
|
||||||
|
|
||||||
struct qxl_device {
|
struct qxl_device {
|
||||||
struct device *dev;
|
|
||||||
struct drm_device *ddev;
|
struct drm_device *ddev;
|
||||||
struct pci_dev *pdev;
|
struct pci_dev *pdev;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
|
@ -122,7 +122,6 @@ int qxl_device_init(struct qxl_device *qdev,
|
||||||
{
|
{
|
||||||
int r, sb;
|
int r, sb;
|
||||||
|
|
||||||
qdev->dev = &pdev->dev;
|
|
||||||
qdev->ddev = ddev;
|
qdev->ddev = ddev;
|
||||||
qdev->pdev = pdev;
|
qdev->pdev = pdev;
|
||||||
qdev->flags = flags;
|
qdev->flags = flags;
|
||||||
|
|
|
@ -113,7 +113,7 @@ int qxl_bo_create(struct qxl_device *qdev,
|
||||||
NULL, NULL, &qxl_ttm_bo_destroy);
|
NULL, NULL, &qxl_ttm_bo_destroy);
|
||||||
if (unlikely(r != 0)) {
|
if (unlikely(r != 0)) {
|
||||||
if (r != -ERESTARTSYS)
|
if (r != -ERESTARTSYS)
|
||||||
dev_err(qdev->dev,
|
dev_err(qdev->ddev->dev,
|
||||||
"object_init failed for (%lu, 0x%08X)\n",
|
"object_init failed for (%lu, 0x%08X)\n",
|
||||||
size, domain);
|
size, domain);
|
||||||
return r;
|
return r;
|
||||||
|
@ -223,7 +223,7 @@ struct qxl_bo *qxl_bo_ref(struct qxl_bo *bo)
|
||||||
|
|
||||||
int qxl_bo_pin(struct qxl_bo *bo, u32 domain, u64 *gpu_addr)
|
int qxl_bo_pin(struct qxl_bo *bo, u32 domain, u64 *gpu_addr)
|
||||||
{
|
{
|
||||||
struct qxl_device *qdev = (struct qxl_device *)bo->gem_base.dev->dev_private;
|
struct drm_device *ddev = bo->gem_base.dev;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (bo->pin_count) {
|
if (bo->pin_count) {
|
||||||
|
@ -240,17 +240,17 @@ int qxl_bo_pin(struct qxl_bo *bo, u32 domain, u64 *gpu_addr)
|
||||||
*gpu_addr = qxl_bo_gpu_offset(bo);
|
*gpu_addr = qxl_bo_gpu_offset(bo);
|
||||||
}
|
}
|
||||||
if (unlikely(r != 0))
|
if (unlikely(r != 0))
|
||||||
dev_err(qdev->dev, "%p pin failed\n", bo);
|
dev_err(ddev->dev, "%p pin failed\n", bo);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
int qxl_bo_unpin(struct qxl_bo *bo)
|
int qxl_bo_unpin(struct qxl_bo *bo)
|
||||||
{
|
{
|
||||||
struct qxl_device *qdev = (struct qxl_device *)bo->gem_base.dev->dev_private;
|
struct drm_device *ddev = bo->gem_base.dev;
|
||||||
int r, i;
|
int r, i;
|
||||||
|
|
||||||
if (!bo->pin_count) {
|
if (!bo->pin_count) {
|
||||||
dev_warn(qdev->dev, "%p unpin not necessary\n", bo);
|
dev_warn(ddev->dev, "%p unpin not necessary\n", bo);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
bo->pin_count--;
|
bo->pin_count--;
|
||||||
|
@ -260,7 +260,7 @@ int qxl_bo_unpin(struct qxl_bo *bo)
|
||||||
bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT;
|
bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT;
|
||||||
r = ttm_bo_validate(&bo->tbo, &bo->placement, false, false);
|
r = ttm_bo_validate(&bo->tbo, &bo->placement, false, false);
|
||||||
if (unlikely(r != 0))
|
if (unlikely(r != 0))
|
||||||
dev_err(qdev->dev, "%p validate failed for unpin\n", bo);
|
dev_err(ddev->dev, "%p validate failed for unpin\n", bo);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,9 +270,9 @@ void qxl_bo_force_delete(struct qxl_device *qdev)
|
||||||
|
|
||||||
if (list_empty(&qdev->gem.objects))
|
if (list_empty(&qdev->gem.objects))
|
||||||
return;
|
return;
|
||||||
dev_err(qdev->dev, "Userspace still has active objects !\n");
|
dev_err(qdev->ddev->dev, "Userspace still has active objects !\n");
|
||||||
list_for_each_entry_safe(bo, n, &qdev->gem.objects, list) {
|
list_for_each_entry_safe(bo, n, &qdev->gem.objects, list) {
|
||||||
dev_err(qdev->dev, "%p %p %lu %lu force free\n",
|
dev_err(qdev->ddev->dev, "%p %p %lu %lu force free\n",
|
||||||
&bo->gem_base, bo, (unsigned long)bo->gem_base.size,
|
&bo->gem_base, bo, (unsigned long)bo->gem_base.size,
|
||||||
*((unsigned long *)&bo->gem_base.refcount));
|
*((unsigned long *)&bo->gem_base.refcount));
|
||||||
mutex_lock(&qdev->gem.mutex);
|
mutex_lock(&qdev->gem.mutex);
|
||||||
|
|
|
@ -34,8 +34,8 @@ static inline int qxl_bo_reserve(struct qxl_bo *bo, bool no_wait)
|
||||||
r = ttm_bo_reserve(&bo->tbo, true, no_wait, NULL);
|
r = ttm_bo_reserve(&bo->tbo, true, no_wait, NULL);
|
||||||
if (unlikely(r != 0)) {
|
if (unlikely(r != 0)) {
|
||||||
if (r != -ERESTARTSYS) {
|
if (r != -ERESTARTSYS) {
|
||||||
struct qxl_device *qdev = (struct qxl_device *)bo->gem_base.dev->dev_private;
|
struct drm_device *ddev = bo->gem_base.dev;
|
||||||
dev_err(qdev->dev, "%p reserve failed\n", bo);
|
dev_err(ddev->dev, "%p reserve failed\n", bo);
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
@ -70,8 +70,8 @@ static inline int qxl_bo_wait(struct qxl_bo *bo, u32 *mem_type,
|
||||||
r = ttm_bo_reserve(&bo->tbo, true, no_wait, NULL);
|
r = ttm_bo_reserve(&bo->tbo, true, no_wait, NULL);
|
||||||
if (unlikely(r != 0)) {
|
if (unlikely(r != 0)) {
|
||||||
if (r != -ERESTARTSYS) {
|
if (r != -ERESTARTSYS) {
|
||||||
struct qxl_device *qdev = (struct qxl_device *)bo->gem_base.dev->dev_private;
|
struct drm_device *ddev = bo->gem_base.dev;
|
||||||
dev_err(qdev->dev, "%p reserve failed for wait\n",
|
dev_err(ddev->dev, "%p reserve failed for wait\n",
|
||||||
bo);
|
bo);
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче