Skip to content

Commit dc83fb6

Browse files
committed
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: Dave Airlie <airlied@redhat.com> From: Maxime Ripard <mripard@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/42dw6ok2g5kz5xljrw7t6lzrgafhwslgw3j4rbaaivluv24vkj@k4smx5r3y2gh
2 parents ea97a66 + 933a2a3 commit dc83fb6

File tree

6 files changed

+36
-35
lines changed

6 files changed

+36
-35
lines changed

drivers/gpu/drm/bridge/aux-bridge.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77
#include <linux/auxiliary_bus.h>
88
#include <linux/module.h>
9+
#include <linux/of.h>
910

1011
#include <drm/drm_bridge.h>
1112
#include <drm/bridge/aux-bridge.h>
@@ -57,7 +58,7 @@ int drm_aux_bridge_register(struct device *parent)
5758
adev->id = ret;
5859
adev->name = "aux_bridge";
5960
adev->dev.parent = parent;
60-
adev->dev.of_node = parent->of_node;
61+
adev->dev.of_node = of_node_get(parent->of_node);
6162
adev->dev.release = drm_aux_bridge_release;
6263

6364
ret = auxiliary_device_init(adev);

drivers/gpu/drm/bridge/aux-hpd-bridge.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ struct device *drm_dp_hpd_bridge_register(struct device *parent,
6868
adev->id = ret;
6969
adev->name = "dp_hpd_bridge";
7070
adev->dev.parent = parent;
71-
adev->dev.of_node = parent->of_node;
71+
adev->dev.of_node = of_node_get(parent->of_node);
7272
adev->dev.release = drm_aux_hpd_bridge_release;
73-
adev->dev.platform_data = np;
73+
adev->dev.platform_data = of_node_get(np);
7474

7575
ret = auxiliary_device_init(adev);
7676
if (ret) {

drivers/gpu/drm/imagination/pvr_hwrt.c

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -458,43 +458,44 @@ pvr_hwrt_dataset_create(struct pvr_file *pvr_file,
458458
struct drm_pvr_ioctl_create_hwrt_dataset_args *args)
459459
{
460460
struct pvr_hwrt_dataset *hwrt;
461-
int err;
461+
int err, i = 0;
462462

463463
/* Create and fill out the kernel structure */
464464
hwrt = kzalloc(sizeof(*hwrt), GFP_KERNEL);
465465

466466
if (!hwrt)
467467
return ERR_PTR(-ENOMEM);
468468

469-
kref_init(&hwrt->ref_count);
470-
471469
err = hwrt_init_kernel_structure(pvr_file, args, hwrt);
472470
if (err < 0)
473471
goto err_free;
474472

475473
err = hwrt_init_common_fw_structure(pvr_file, args, hwrt);
476474
if (err < 0)
477-
goto err_free;
475+
goto err_fini_kernel_structure;
478476

479-
for (int i = 0; i < ARRAY_SIZE(hwrt->data); i++) {
477+
for (; i < ARRAY_SIZE(hwrt->data); i++) {
480478
err = hwrt_data_init_fw_structure(pvr_file, hwrt, args,
481479
&args->rt_data_args[i],
482480
&hwrt->data[i]);
483-
if (err < 0) {
484-
i--;
485-
/* Destroy already created structures. */
486-
for (; i >= 0; i--)
487-
hwrt_data_fini_fw_structure(hwrt, i);
488-
goto err_free;
489-
}
481+
if (err < 0)
482+
goto err_fini_data_structures;
490483

491484
hwrt->data[i].hwrt_dataset = hwrt;
492485
}
493486

487+
kref_init(&hwrt->ref_count);
494488
return hwrt;
495489

490+
err_fini_data_structures:
491+
while (--i >= 0)
492+
hwrt_data_fini_fw_structure(hwrt, i);
493+
494+
err_fini_kernel_structure:
495+
hwrt_fini_kernel_structure(hwrt);
496+
496497
err_free:
497-
pvr_hwrt_dataset_put(hwrt);
498+
kfree(hwrt);
498499

499500
return ERR_PTR(err);
500501
}

drivers/gpu/drm/imagination/pvr_vm.c

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -556,23 +556,12 @@ pvr_vm_create_context(struct pvr_device *pvr_dev, bool is_userspace_context)
556556
if (!vm_ctx)
557557
return ERR_PTR(-ENOMEM);
558558

559-
drm_gem_private_object_init(&pvr_dev->base, &vm_ctx->dummy_gem, 0);
560-
561559
vm_ctx->pvr_dev = pvr_dev;
562-
kref_init(&vm_ctx->ref_count);
563-
mutex_init(&vm_ctx->lock);
564-
565-
drm_gpuvm_init(&vm_ctx->gpuvm_mgr,
566-
is_userspace_context ? "PowerVR-user-VM" : "PowerVR-FW-VM",
567-
0, &pvr_dev->base, &vm_ctx->dummy_gem,
568-
0, 1ULL << device_addr_bits, 0, 0, &pvr_vm_gpuva_ops);
569560

570561
vm_ctx->mmu_ctx = pvr_mmu_context_create(pvr_dev);
571-
err = PTR_ERR_OR_ZERO(&vm_ctx->mmu_ctx);
572-
if (err) {
573-
vm_ctx->mmu_ctx = NULL;
574-
goto err_put_ctx;
575-
}
562+
err = PTR_ERR_OR_ZERO(vm_ctx->mmu_ctx);
563+
if (err)
564+
goto err_free;
576565

577566
if (is_userspace_context) {
578567
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)
583572
goto err_page_table_destroy;
584573
}
585574

575+
drm_gem_private_object_init(&pvr_dev->base, &vm_ctx->dummy_gem, 0);
576+
drm_gpuvm_init(&vm_ctx->gpuvm_mgr,
577+
is_userspace_context ? "PowerVR-user-VM" : "PowerVR-FW-VM",
578+
0, &pvr_dev->base, &vm_ctx->dummy_gem,
579+
0, 1ULL << device_addr_bits, 0, 0, &pvr_vm_gpuva_ops);
580+
581+
mutex_init(&vm_ctx->lock);
582+
kref_init(&vm_ctx->ref_count);
583+
586584
return vm_ctx;
587585

588586
err_page_table_destroy:
589587
pvr_mmu_context_destroy(vm_ctx->mmu_ctx);
590588

591-
err_put_ctx:
592-
pvr_vm_context_put(vm_ctx);
589+
err_free:
590+
kfree(vm_ctx);
593591

594592
return ERR_PTR(err);
595593
}

drivers/gpu/drm/imagination/pvr_vm_mips.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ pvr_vm_mips_map(struct pvr_device *pvr_dev, struct pvr_fw_object *fw_obj)
152152
u64 end;
153153
u32 cache_policy;
154154
u32 pte_flags;
155-
u32 start_pfn;
156-
u32 end_pfn;
155+
s32 start_pfn;
156+
s32 end_pfn;
157157
s32 pfn;
158158
int err;
159159

@@ -201,7 +201,7 @@ pvr_vm_mips_map(struct pvr_device *pvr_dev, struct pvr_fw_object *fw_obj)
201201
return 0;
202202

203203
err_unmap_pages:
204-
for (; pfn >= start_pfn; pfn--)
204+
while (--pfn >= start_pfn)
205205
WRITE_ONCE(mips_data->pt[pfn], 0);
206206

207207
pvr_mmu_flush_request_all(pvr_dev);

include/drm/drm_color_mgmt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#define __DRM_COLOR_MGMT_H__
2525

2626
#include <linux/ctype.h>
27+
#include <linux/math64.h>
2728
#include <drm/drm_property.h>
2829

2930
struct drm_crtc;

0 commit comments

Comments
 (0)