Commit dc83fb6e authored by Dave Airlie's avatar Dave Airlie

Merge tag 'drm-misc-next-fixes-2023-12-21' of...

Merge tag 'drm-misc-next-fixes-2023-12-21' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

More fixes for the new imagination drier, a DT node refcount fix for the
new aux bridge driver and a missing header fix for the LUT management
code.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

From: Maxime Ripard <mripard@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/42dw6ok2g5kz5xljrw7t6lzrgafhwslgw3j4rbaaivluv24vkj@k4smx5r3y2gh
parents ea97a66a 933a2a37
......@@ -6,6 +6,7 @@
*/
#include <linux/auxiliary_bus.h>
#include <linux/module.h>
#include <linux/of.h>
#include <drm/drm_bridge.h>
#include <drm/bridge/aux-bridge.h>
......@@ -57,7 +58,7 @@ int drm_aux_bridge_register(struct device *parent)
adev->id = ret;
adev->name = "aux_bridge";
adev->dev.parent = parent;
adev->dev.of_node = parent->of_node;
adev->dev.of_node = of_node_get(parent->of_node);
adev->dev.release = drm_aux_bridge_release;
ret = auxiliary_device_init(adev);
......
......@@ -68,9 +68,9 @@ struct device *drm_dp_hpd_bridge_register(struct device *parent,
adev->id = ret;
adev->name = "dp_hpd_bridge";
adev->dev.parent = parent;
adev->dev.of_node = parent->of_node;
adev->dev.of_node = of_node_get(parent->of_node);
adev->dev.release = drm_aux_hpd_bridge_release;
adev->dev.platform_data = np;
adev->dev.platform_data = of_node_get(np);
ret = auxiliary_device_init(adev);
if (ret) {
......
......@@ -458,7 +458,7 @@ pvr_hwrt_dataset_create(struct pvr_file *pvr_file,
struct drm_pvr_ioctl_create_hwrt_dataset_args *args)
{
struct pvr_hwrt_dataset *hwrt;
int err;
int err, i = 0;
/* Create and fill out the kernel structure */
hwrt = kzalloc(sizeof(*hwrt), GFP_KERNEL);
......@@ -466,35 +466,36 @@ pvr_hwrt_dataset_create(struct pvr_file *pvr_file,
if (!hwrt)
return ERR_PTR(-ENOMEM);
kref_init(&hwrt->ref_count);
err = hwrt_init_kernel_structure(pvr_file, args, hwrt);
if (err < 0)
goto err_free;
err = hwrt_init_common_fw_structure(pvr_file, args, hwrt);
if (err < 0)
goto err_free;
goto err_fini_kernel_structure;
for (int i = 0; i < ARRAY_SIZE(hwrt->data); i++) {
for (; i < ARRAY_SIZE(hwrt->data); i++) {
err = hwrt_data_init_fw_structure(pvr_file, hwrt, args,
&args->rt_data_args[i],
&hwrt->data[i]);
if (err < 0) {
i--;
/* Destroy already created structures. */
for (; i >= 0; i--)
hwrt_data_fini_fw_structure(hwrt, i);
goto err_free;
}
if (err < 0)
goto err_fini_data_structures;
hwrt->data[i].hwrt_dataset = hwrt;
}
kref_init(&hwrt->ref_count);
return hwrt;
err_fini_data_structures:
while (--i >= 0)
hwrt_data_fini_fw_structure(hwrt, i);
err_fini_kernel_structure:
hwrt_fini_kernel_structure(hwrt);
err_free:
pvr_hwrt_dataset_put(hwrt);
kfree(hwrt);
return ERR_PTR(err);
}
......
......@@ -556,23 +556,12 @@ pvr_vm_create_context(struct pvr_device *pvr_dev, bool is_userspace_context)
if (!vm_ctx)
return ERR_PTR(-ENOMEM);
drm_gem_private_object_init(&pvr_dev->base, &vm_ctx->dummy_gem, 0);
vm_ctx->pvr_dev = pvr_dev;
kref_init(&vm_ctx->ref_count);
mutex_init(&vm_ctx->lock);
drm_gpuvm_init(&vm_ctx->gpuvm_mgr,
is_userspace_context ? "PowerVR-user-VM" : "PowerVR-FW-VM",
0, &pvr_dev->base, &vm_ctx->dummy_gem,
0, 1ULL << device_addr_bits, 0, 0, &pvr_vm_gpuva_ops);
vm_ctx->mmu_ctx = pvr_mmu_context_create(pvr_dev);
err = PTR_ERR_OR_ZERO(&vm_ctx->mmu_ctx);
if (err) {
vm_ctx->mmu_ctx = NULL;
goto err_put_ctx;
}
err = PTR_ERR_OR_ZERO(vm_ctx->mmu_ctx);
if (err)
goto err_free;
if (is_userspace_context) {
err = pvr_fw_object_create(pvr_dev, sizeof(struct rogue_fwif_fwmemcontext),
......@@ -583,13 +572,22 @@ pvr_vm_create_context(struct pvr_device *pvr_dev, bool is_userspace_context)
goto err_page_table_destroy;
}
drm_gem_private_object_init(&pvr_dev->base, &vm_ctx->dummy_gem, 0);
drm_gpuvm_init(&vm_ctx->gpuvm_mgr,
is_userspace_context ? "PowerVR-user-VM" : "PowerVR-FW-VM",
0, &pvr_dev->base, &vm_ctx->dummy_gem,
0, 1ULL << device_addr_bits, 0, 0, &pvr_vm_gpuva_ops);
mutex_init(&vm_ctx->lock);
kref_init(&vm_ctx->ref_count);
return vm_ctx;
err_page_table_destroy:
pvr_mmu_context_destroy(vm_ctx->mmu_ctx);
err_put_ctx:
pvr_vm_context_put(vm_ctx);
err_free:
kfree(vm_ctx);
return ERR_PTR(err);
}
......
......@@ -152,8 +152,8 @@ pvr_vm_mips_map(struct pvr_device *pvr_dev, struct pvr_fw_object *fw_obj)
u64 end;
u32 cache_policy;
u32 pte_flags;
u32 start_pfn;
u32 end_pfn;
s32 start_pfn;
s32 end_pfn;
s32 pfn;
int err;
......@@ -201,7 +201,7 @@ pvr_vm_mips_map(struct pvr_device *pvr_dev, struct pvr_fw_object *fw_obj)
return 0;
err_unmap_pages:
for (; pfn >= start_pfn; pfn--)
while (--pfn >= start_pfn)
WRITE_ONCE(mips_data->pt[pfn], 0);
pvr_mmu_flush_request_all(pvr_dev);
......
......@@ -24,6 +24,7 @@
#define __DRM_COLOR_MGMT_H__
#include <linux/ctype.h>
#include <linux/math64.h>
#include <drm/drm_property.h>
struct drm_crtc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment