Skip to content

Commit a38fd7d

Browse files
committed
Merge tag 'drm-fixes-2018-09-21' of git://anongit.freedesktop.org/drm/drm
David writes: "drm fixes for 4.19-rc5: - core: fix debugfs for atomic, fix the check for atomic for non-modesetting drivers - amdgpu: adds a new PCI id, some kfd fixes and a sdma fix - i915: a bunch of GVT fixes. - vc4: scaling fix - vmwgfx: modesetting fixes and a old buffer eviction fix - udl: framebuffer destruction fix - sun4i: disable on R40 fix until next kernel - pl111: NULL termination on table fix" * tag 'drm-fixes-2018-09-21' of git://anongit.freedesktop.org/drm/drm: (21 commits) drm/amdkfd: Fix ATS capablity was not reported correctly on some APUs drm/amdkfd: Change the control stack MTYPE from UC to NC on GFX9 drm/amdgpu: Fix SDMA HQD destroy error on gfx_v7 drm/vmwgfx: Fix buffer object eviction drm/vmwgfx: Don't impose STDU limits on framebuffer size drm/vmwgfx: limit mode size for all display unit to texture_max drm/vmwgfx: limit screen size to stdu_max during check_modeset drm/vmwgfx: don't check for old_crtc_state enable status drm/amdgpu: add new polaris pci id drm: sun4i: drop second PLL from A64 HDMI PHY drm: fix drm_drv_uses_atomic_modeset on non modesetting drivers. drm/i915/gvt: clear ggtt entries when destroy vgpu drm/i915/gvt: request srcu_read_lock before checking if one gfn is valid drm/i915/gvt: Add GEN9_CLKGATE_DIS_4 to default BXT mmio handler drm/i915/gvt: Init PHY related registers for BXT drm/atomic: Use drm_drv_uses_atomic_modeset() for debugfs creation drm/fb-helper: Remove set but not used variable 'connector_funcs' drm: udl: Destroy framebuffer only if it was initialized drm/sun4i: Remove R40 display pipeline compatibles drm/pl111: Make sure of_device_id tables are NULL terminated ...
2 parents 234b69e + 4fcb7f8 commit a38fd7d

30 files changed

+152
-117
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ void amdgpu_amdkfd_gpu_reset(struct kgd_dev *kgd)
272272

273273
int alloc_gtt_mem(struct kgd_dev *kgd, size_t size,
274274
void **mem_obj, uint64_t *gpu_addr,
275-
void **cpu_ptr)
275+
void **cpu_ptr, bool mqd_gfx9)
276276
{
277277
struct amdgpu_device *adev = (struct amdgpu_device *)kgd;
278278
struct amdgpu_bo *bo = NULL;
@@ -287,6 +287,10 @@ int alloc_gtt_mem(struct kgd_dev *kgd, size_t size,
287287
bp.flags = AMDGPU_GEM_CREATE_CPU_GTT_USWC;
288288
bp.type = ttm_bo_type_kernel;
289289
bp.resv = NULL;
290+
291+
if (mqd_gfx9)
292+
bp.flags |= AMDGPU_GEM_CREATE_MQD_GFX9;
293+
290294
r = amdgpu_bo_create(adev, &bp, &bo);
291295
if (r) {
292296
dev_err(adev->dev,

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ void amdgpu_amdkfd_gpu_reset(struct kgd_dev *kgd);
136136
/* Shared API */
137137
int alloc_gtt_mem(struct kgd_dev *kgd, size_t size,
138138
void **mem_obj, uint64_t *gpu_addr,
139-
void **cpu_ptr);
139+
void **cpu_ptr, bool mqd_gfx9);
140140
void free_gtt_mem(struct kgd_dev *kgd, void *mem_obj);
141141
void get_local_mem_info(struct kgd_dev *kgd,
142142
struct kfd_local_mem_info *mem_info);

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ static int kgd_hqd_sdma_destroy(struct kgd_dev *kgd, void *mqd,
685685

686686
while (true) {
687687
temp = RREG32(sdma_base_addr + mmSDMA0_RLC0_CONTEXT_STATUS);
688-
if (temp & SDMA0_STATUS_REG__RB_CMD_IDLE__SHIFT)
688+
if (temp & SDMA0_RLC0_CONTEXT_STATUS__IDLE_MASK)
689689
break;
690690
if (time_after(jiffies, end_jiffies))
691691
return -ETIME;

drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -367,12 +367,14 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device,
367367
break;
368368
case CHIP_POLARIS10:
369369
if (type == CGS_UCODE_ID_SMU) {
370-
if ((adev->pdev->device == 0x67df) &&
371-
((adev->pdev->revision == 0xe0) ||
372-
(adev->pdev->revision == 0xe3) ||
373-
(adev->pdev->revision == 0xe4) ||
374-
(adev->pdev->revision == 0xe5) ||
375-
(adev->pdev->revision == 0xe7) ||
370+
if (((adev->pdev->device == 0x67df) &&
371+
((adev->pdev->revision == 0xe0) ||
372+
(adev->pdev->revision == 0xe3) ||
373+
(adev->pdev->revision == 0xe4) ||
374+
(adev->pdev->revision == 0xe5) ||
375+
(adev->pdev->revision == 0xe7) ||
376+
(adev->pdev->revision == 0xef))) ||
377+
((adev->pdev->device == 0x6fdf) &&
376378
(adev->pdev->revision == 0xef))) {
377379
info->is_kicker = true;
378380
strcpy(fw_name, "amdgpu/polaris10_k_smc.bin");

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,7 @@ static const struct pci_device_id pciidlist[] = {
740740
{0x1002, 0x67CA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10},
741741
{0x1002, 0x67CC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10},
742742
{0x1002, 0x67CF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10},
743+
{0x1002, 0x6FDF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10},
743744
/* Polaris12 */
744745
{0x1002, 0x6980, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
745746
{0x1002, 0x6981, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},

drivers/gpu/drm/amd/amdkfd/kfd_device.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,8 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
457457

458458
if (kfd->kfd2kgd->init_gtt_mem_allocation(
459459
kfd->kgd, size, &kfd->gtt_mem,
460-
&kfd->gtt_start_gpu_addr, &kfd->gtt_start_cpu_ptr)){
460+
&kfd->gtt_start_gpu_addr, &kfd->gtt_start_cpu_ptr,
461+
false)) {
461462
dev_err(kfd_device, "Could not allocate %d bytes\n", size);
462463
goto out;
463464
}

drivers/gpu/drm/amd/amdkfd/kfd_iommu.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,20 @@ int kfd_iommu_device_init(struct kfd_dev *kfd)
6262
struct amd_iommu_device_info iommu_info;
6363
unsigned int pasid_limit;
6464
int err;
65+
struct kfd_topology_device *top_dev;
6566

66-
if (!kfd->device_info->needs_iommu_device)
67+
top_dev = kfd_topology_device_by_id(kfd->id);
68+
69+
/*
70+
* Overwrite ATS capability according to needs_iommu_device to fix
71+
* potential missing corresponding bit in CRAT of BIOS.
72+
*/
73+
if (!kfd->device_info->needs_iommu_device) {
74+
top_dev->node_props.capability &= ~HSA_CAP_ATS_PRESENT;
6775
return 0;
76+
}
77+
78+
top_dev->node_props.capability |= HSA_CAP_ATS_PRESENT;
6879

6980
iommu_info.flags = 0;
7081
err = amd_iommu_device_info(kfd->pdev, &iommu_info);

drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ static int init_mqd(struct mqd_manager *mm, void **mqd,
8888
ALIGN(sizeof(struct v9_mqd), PAGE_SIZE),
8989
&((*mqd_mem_obj)->gtt_mem),
9090
&((*mqd_mem_obj)->gpu_addr),
91-
(void *)&((*mqd_mem_obj)->cpu_ptr));
91+
(void *)&((*mqd_mem_obj)->cpu_ptr), true);
9292
} else
9393
retval = kfd_gtt_sa_allocate(mm->dev, sizeof(struct v9_mqd),
9494
mqd_mem_obj);

drivers/gpu/drm/amd/amdkfd/kfd_priv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,7 @@ int kfd_topology_add_device(struct kfd_dev *gpu);
806806
int kfd_topology_remove_device(struct kfd_dev *gpu);
807807
struct kfd_topology_device *kfd_topology_device_by_proximity_domain(
808808
uint32_t proximity_domain);
809+
struct kfd_topology_device *kfd_topology_device_by_id(uint32_t gpu_id);
809810
struct kfd_dev *kfd_device_by_id(uint32_t gpu_id);
810811
struct kfd_dev *kfd_device_by_pci_dev(const struct pci_dev *pdev);
811812
int kfd_topology_enum_kfd_devices(uint8_t idx, struct kfd_dev **kdev);

drivers/gpu/drm/amd/amdkfd/kfd_topology.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,33 @@ struct kfd_topology_device *kfd_topology_device_by_proximity_domain(
6363
return device;
6464
}
6565

66-
struct kfd_dev *kfd_device_by_id(uint32_t gpu_id)
66+
struct kfd_topology_device *kfd_topology_device_by_id(uint32_t gpu_id)
6767
{
68-
struct kfd_topology_device *top_dev;
69-
struct kfd_dev *device = NULL;
68+
struct kfd_topology_device *top_dev = NULL;
69+
struct kfd_topology_device *ret = NULL;
7070

7171
down_read(&topology_lock);
7272

7373
list_for_each_entry(top_dev, &topology_device_list, list)
7474
if (top_dev->gpu_id == gpu_id) {
75-
device = top_dev->gpu;
75+
ret = top_dev;
7676
break;
7777
}
7878

7979
up_read(&topology_lock);
8080

81-
return device;
81+
return ret;
82+
}
83+
84+
struct kfd_dev *kfd_device_by_id(uint32_t gpu_id)
85+
{
86+
struct kfd_topology_device *top_dev;
87+
88+
top_dev = kfd_topology_device_by_id(gpu_id);
89+
if (!top_dev)
90+
return NULL;
91+
92+
return top_dev->gpu;
8293
}
8394

8495
struct kfd_dev *kfd_device_by_pci_dev(const struct pci_dev *pdev)

drivers/gpu/drm/amd/include/kgd_kfd_interface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ struct tile_config {
292292
struct kfd2kgd_calls {
293293
int (*init_gtt_mem_allocation)(struct kgd_dev *kgd, size_t size,
294294
void **mem_obj, uint64_t *gpu_addr,
295-
void **cpu_ptr);
295+
void **cpu_ptr, bool mqd_gfx9);
296296

297297
void (*free_gtt_mem)(struct kgd_dev *kgd, void *mem_obj);
298298

drivers/gpu/drm/drm_atomic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2067,7 +2067,7 @@ static void __drm_state_dump(struct drm_device *dev, struct drm_printer *p,
20672067
struct drm_connector *connector;
20682068
struct drm_connector_list_iter conn_iter;
20692069

2070-
if (!drm_core_check_feature(dev, DRIVER_ATOMIC))
2070+
if (!drm_drv_uses_atomic_modeset(dev))
20712071
return;
20722072

20732073
list_for_each_entry(plane, &config->plane_list, head) {

drivers/gpu/drm/drm_debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id,
151151
return ret;
152152
}
153153

154-
if (drm_core_check_feature(dev, DRIVER_ATOMIC)) {
154+
if (drm_drv_uses_atomic_modeset(dev)) {
155155
ret = drm_atomic_debugfs_init(minor);
156156
if (ret) {
157157
DRM_ERROR("Failed to create atomic debugfs files\n");

drivers/gpu/drm/drm_fb_helper.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2370,7 +2370,6 @@ static int drm_pick_crtcs(struct drm_fb_helper *fb_helper,
23702370
{
23712371
int c, o;
23722372
struct drm_connector *connector;
2373-
const struct drm_connector_helper_funcs *connector_funcs;
23742373
int my_score, best_score, score;
23752374
struct drm_fb_helper_crtc **crtcs, *crtc;
23762375
struct drm_fb_helper_connector *fb_helper_conn;
@@ -2399,8 +2398,6 @@ static int drm_pick_crtcs(struct drm_fb_helper *fb_helper,
23992398
if (drm_has_preferred_mode(fb_helper_conn, width, height))
24002399
my_score++;
24012400

2402-
connector_funcs = connector->helper_private;
2403-
24042401
/*
24052402
* select a crtc for this connector and then attempt to configure
24062403
* remaining connectors

drivers/gpu/drm/i915/gvt/handlers.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3210,6 +3210,7 @@ static int init_bxt_mmio_info(struct intel_gvt *gvt)
32103210
MMIO_D(BXT_DSI_PLL_ENABLE, D_BXT);
32113211

32123212
MMIO_D(GEN9_CLKGATE_DIS_0, D_BXT);
3213+
MMIO_D(GEN9_CLKGATE_DIS_4, D_BXT);
32133214

32143215
MMIO_D(HSW_TVIDEO_DIP_GCP(TRANSCODER_A), D_BXT);
32153216
MMIO_D(HSW_TVIDEO_DIP_GCP(TRANSCODER_B), D_BXT);

drivers/gpu/drm/i915/gvt/kvmgt.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1833,15 +1833,20 @@ static bool kvmgt_is_valid_gfn(unsigned long handle, unsigned long gfn)
18331833
{
18341834
struct kvmgt_guest_info *info;
18351835
struct kvm *kvm;
1836+
int idx;
1837+
bool ret;
18361838

18371839
if (!handle_valid(handle))
18381840
return false;
18391841

18401842
info = (struct kvmgt_guest_info *)handle;
18411843
kvm = info->kvm;
18421844

1843-
return kvm_is_visible_gfn(kvm, gfn);
1845+
idx = srcu_read_lock(&kvm->srcu);
1846+
ret = kvm_is_visible_gfn(kvm, gfn);
1847+
srcu_read_unlock(&kvm->srcu, idx);
18441848

1849+
return ret;
18451850
}
18461851

18471852
struct intel_gvt_mpt kvmgt_mpt = {

drivers/gpu/drm/i915/gvt/mmio.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,34 @@ void intel_vgpu_reset_mmio(struct intel_vgpu *vgpu, bool dmlr)
244244

245245
/* set the bit 0:2(Core C-State ) to C0 */
246246
vgpu_vreg_t(vgpu, GEN6_GT_CORE_STATUS) = 0;
247+
248+
if (IS_BROXTON(vgpu->gvt->dev_priv)) {
249+
vgpu_vreg_t(vgpu, BXT_P_CR_GT_DISP_PWRON) &=
250+
~(BIT(0) | BIT(1));
251+
vgpu_vreg_t(vgpu, BXT_PORT_CL1CM_DW0(DPIO_PHY0)) &=
252+
~PHY_POWER_GOOD;
253+
vgpu_vreg_t(vgpu, BXT_PORT_CL1CM_DW0(DPIO_PHY1)) &=
254+
~PHY_POWER_GOOD;
255+
vgpu_vreg_t(vgpu, BXT_PHY_CTL_FAMILY(DPIO_PHY0)) &=
256+
~BIT(30);
257+
vgpu_vreg_t(vgpu, BXT_PHY_CTL_FAMILY(DPIO_PHY1)) &=
258+
~BIT(30);
259+
vgpu_vreg_t(vgpu, BXT_PHY_CTL(PORT_A)) &=
260+
~BXT_PHY_LANE_ENABLED;
261+
vgpu_vreg_t(vgpu, BXT_PHY_CTL(PORT_A)) |=
262+
BXT_PHY_CMNLANE_POWERDOWN_ACK |
263+
BXT_PHY_LANE_POWERDOWN_ACK;
264+
vgpu_vreg_t(vgpu, BXT_PHY_CTL(PORT_B)) &=
265+
~BXT_PHY_LANE_ENABLED;
266+
vgpu_vreg_t(vgpu, BXT_PHY_CTL(PORT_B)) |=
267+
BXT_PHY_CMNLANE_POWERDOWN_ACK |
268+
BXT_PHY_LANE_POWERDOWN_ACK;
269+
vgpu_vreg_t(vgpu, BXT_PHY_CTL(PORT_C)) &=
270+
~BXT_PHY_LANE_ENABLED;
271+
vgpu_vreg_t(vgpu, BXT_PHY_CTL(PORT_C)) |=
272+
BXT_PHY_CMNLANE_POWERDOWN_ACK |
273+
BXT_PHY_LANE_POWERDOWN_ACK;
274+
}
247275
} else {
248276
#define GVT_GEN8_MMIO_RESET_OFFSET (0x44200)
249277
/* only reset the engine related, so starting with 0x44200

drivers/gpu/drm/i915/gvt/vgpu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ void intel_gvt_destroy_vgpu(struct intel_vgpu *vgpu)
281281
intel_vgpu_clean_submission(vgpu);
282282
intel_vgpu_clean_display(vgpu);
283283
intel_vgpu_clean_opregion(vgpu);
284+
intel_vgpu_reset_ggtt(vgpu, true);
284285
intel_vgpu_clean_gtt(vgpu);
285286
intel_gvt_hypervisor_detach_vgpu(vgpu);
286287
intel_vgpu_free_resource(vgpu);

drivers/gpu/drm/pl111/pl111_vexpress.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ static int vexpress_muxfpga_probe(struct platform_device *pdev)
111111
}
112112

113113
static const struct of_device_id vexpress_muxfpga_match[] = {
114-
{ .compatible = "arm,vexpress-muxfpga", }
114+
{ .compatible = "arm,vexpress-muxfpga", },
115+
{}
115116
};
116117

117118
static struct platform_driver vexpress_muxfpga_driver = {

drivers/gpu/drm/sun4i/sun4i_drv.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,6 @@ static const struct of_device_id sun4i_drv_of_table[] = {
418418
{ .compatible = "allwinner,sun8i-a33-display-engine" },
419419
{ .compatible = "allwinner,sun8i-a83t-display-engine" },
420420
{ .compatible = "allwinner,sun8i-h3-display-engine" },
421-
{ .compatible = "allwinner,sun8i-r40-display-engine" },
422421
{ .compatible = "allwinner,sun8i-v3s-display-engine" },
423422
{ .compatible = "allwinner,sun9i-a80-display-engine" },
424423
{ }

drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,6 @@ static struct regmap_config sun8i_hdmi_phy_regmap_config = {
398398

399399
static const struct sun8i_hdmi_phy_variant sun50i_a64_hdmi_phy = {
400400
.has_phy_clk = true,
401-
.has_second_pll = true,
402401
.phy_init = &sun8i_hdmi_phy_init_h3,
403402
.phy_disable = &sun8i_hdmi_phy_disable_h3,
404403
.phy_config = &sun8i_hdmi_phy_config_h3,

drivers/gpu/drm/sun4i/sun8i_mixer.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -545,22 +545,6 @@ static const struct sun8i_mixer_cfg sun8i_h3_mixer0_cfg = {
545545
.vi_num = 1,
546546
};
547547

548-
static const struct sun8i_mixer_cfg sun8i_r40_mixer0_cfg = {
549-
.ccsc = 0,
550-
.mod_rate = 297000000,
551-
.scaler_mask = 0xf,
552-
.ui_num = 3,
553-
.vi_num = 1,
554-
};
555-
556-
static const struct sun8i_mixer_cfg sun8i_r40_mixer1_cfg = {
557-
.ccsc = 1,
558-
.mod_rate = 297000000,
559-
.scaler_mask = 0x3,
560-
.ui_num = 1,
561-
.vi_num = 1,
562-
};
563-
564548
static const struct sun8i_mixer_cfg sun8i_v3s_mixer_cfg = {
565549
.vi_num = 2,
566550
.ui_num = 1,
@@ -582,14 +566,6 @@ static const struct of_device_id sun8i_mixer_of_table[] = {
582566
.compatible = "allwinner,sun8i-h3-de2-mixer-0",
583567
.data = &sun8i_h3_mixer0_cfg,
584568
},
585-
{
586-
.compatible = "allwinner,sun8i-r40-de2-mixer-0",
587-
.data = &sun8i_r40_mixer0_cfg,
588-
},
589-
{
590-
.compatible = "allwinner,sun8i-r40-de2-mixer-1",
591-
.data = &sun8i_r40_mixer1_cfg,
592-
},
593569
{
594570
.compatible = "allwinner,sun8i-v3s-de2-mixer",
595571
.data = &sun8i_v3s_mixer_cfg,

drivers/gpu/drm/sun4i/sun8i_tcon_top.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ static int sun8i_tcon_top_remove(struct platform_device *pdev)
253253

254254
/* sun4i_drv uses this list to check if a device node is a TCON TOP */
255255
const struct of_device_id sun8i_tcon_top_of_table[] = {
256-
{ .compatible = "allwinner,sun8i-r40-tcon-top" },
257256
{ /* sentinel */ }
258257
};
259258
MODULE_DEVICE_TABLE(of, sun8i_tcon_top_of_table);

drivers/gpu/drm/udl/udl_fb.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,11 @@ static void udl_fbdev_destroy(struct drm_device *dev,
432432
{
433433
drm_fb_helper_unregister_fbi(&ufbdev->helper);
434434
drm_fb_helper_fini(&ufbdev->helper);
435-
drm_framebuffer_unregister_private(&ufbdev->ufb.base);
436-
drm_framebuffer_cleanup(&ufbdev->ufb.base);
437-
drm_gem_object_put_unlocked(&ufbdev->ufb.obj->base);
435+
if (ufbdev->ufb.obj) {
436+
drm_framebuffer_unregister_private(&ufbdev->ufb.base);
437+
drm_framebuffer_cleanup(&ufbdev->ufb.base);
438+
drm_gem_object_put_unlocked(&ufbdev->ufb.obj->base);
439+
}
438440
}
439441

440442
int udl_fbdev_init(struct drm_device *dev)

0 commit comments

Comments
 (0)