Skip to content

Commit 5a9f299

Browse files
committed
drm/xe/display: use xe->display to decide whether to do anything
Since we only initialize xe->display when xe->info.probe_display, we can use !xe->display to bail out early. This seems cleaner and more accurate than relying on xe->info.probe_display, since xe->display may indeed be NULL. Reviewed-by: Matthew Auld <matthew.auld@intel.com> Link: https://lore.kernel.org/r/945d2a987214044a81f4816684972961b772b45a.1747397638.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
1 parent 7e49ab3 commit 5a9f299

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

drivers/gpu/drm/xe/display/xe_display.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static void xe_display_fini_early(void *arg)
9292
struct xe_device *xe = arg;
9393
struct intel_display *display = xe->display;
9494

95-
if (!xe->info.probe_display)
95+
if (!display)
9696
return;
9797

9898
intel_display_driver_remove_nogem(display);
@@ -106,7 +106,7 @@ int xe_display_init_early(struct xe_device *xe)
106106
struct intel_display *display = xe->display;
107107
int err;
108108

109-
if (!xe->info.probe_display)
109+
if (!display)
110110
return 0;
111111

112112
/* Fake uncore lock */
@@ -160,7 +160,7 @@ int xe_display_init(struct xe_device *xe)
160160
struct intel_display *display = xe->display;
161161
int err;
162162

163-
if (!xe->info.probe_display)
163+
if (!display)
164164
return 0;
165165

166166
err = intel_display_driver_probe(display);
@@ -174,7 +174,7 @@ void xe_display_register(struct xe_device *xe)
174174
{
175175
struct intel_display *display = xe->display;
176176

177-
if (!xe->info.probe_display)
177+
if (!display)
178178
return;
179179

180180
intel_display_driver_register(display);
@@ -185,7 +185,7 @@ void xe_display_unregister(struct xe_device *xe)
185185
{
186186
struct intel_display *display = xe->display;
187187

188-
if (!xe->info.probe_display)
188+
if (!display)
189189
return;
190190

191191
intel_power_domains_disable(display);
@@ -198,7 +198,7 @@ void xe_display_irq_handler(struct xe_device *xe, u32 master_ctl)
198198
{
199199
struct intel_display *display = xe->display;
200200

201-
if (!xe->info.probe_display)
201+
if (!display)
202202
return;
203203

204204
if (master_ctl & DISPLAY_IRQ)
@@ -209,7 +209,7 @@ void xe_display_irq_enable(struct xe_device *xe, u32 gu_misc_iir)
209209
{
210210
struct intel_display *display = xe->display;
211211

212-
if (!xe->info.probe_display)
212+
if (!display)
213213
return;
214214

215215
if (gu_misc_iir & GU_MISC_GSE)
@@ -220,7 +220,7 @@ void xe_display_irq_reset(struct xe_device *xe)
220220
{
221221
struct intel_display *display = xe->display;
222222

223-
if (!xe->info.probe_display)
223+
if (!display)
224224
return;
225225

226226
gen11_display_irq_reset(display);
@@ -230,7 +230,7 @@ void xe_display_irq_postinstall(struct xe_device *xe, struct xe_gt *gt)
230230
{
231231
struct intel_display *display = xe->display;
232232

233-
if (!xe->info.probe_display)
233+
if (!display)
234234
return;
235235

236236
if (gt->info.id == XE_GT0)
@@ -271,7 +271,7 @@ static void xe_display_enable_d3cold(struct xe_device *xe)
271271
{
272272
struct intel_display *display = xe->display;
273273

274-
if (!xe->info.probe_display)
274+
if (!display)
275275
return;
276276

277277
/*
@@ -294,7 +294,7 @@ static void xe_display_disable_d3cold(struct xe_device *xe)
294294
{
295295
struct intel_display *display = xe->display;
296296

297-
if (!xe->info.probe_display)
297+
if (!display)
298298
return;
299299

300300
intel_dmc_resume(display);
@@ -319,7 +319,7 @@ void xe_display_pm_suspend(struct xe_device *xe)
319319
struct intel_display *display = xe->display;
320320
bool s2idle = suspend_to_idle();
321321

322-
if (!xe->info.probe_display)
322+
if (!display)
323323
return;
324324

325325
/*
@@ -353,7 +353,7 @@ void xe_display_pm_shutdown(struct xe_device *xe)
353353
{
354354
struct intel_display *display = xe->display;
355355

356-
if (!xe->info.probe_display)
356+
if (!display)
357357
return;
358358

359359
intel_power_domains_disable(display);
@@ -384,7 +384,7 @@ void xe_display_pm_runtime_suspend(struct xe_device *xe)
384384
{
385385
struct intel_display *display = xe->display;
386386

387-
if (!xe->info.probe_display)
387+
if (!display)
388388
return;
389389

390390
if (xe->d3cold.allowed) {
@@ -400,7 +400,7 @@ void xe_display_pm_suspend_late(struct xe_device *xe)
400400
struct intel_display *display = xe->display;
401401
bool s2idle = suspend_to_idle();
402402

403-
if (!xe->info.probe_display)
403+
if (!display)
404404
return;
405405

406406
intel_display_power_suspend_late(display, s2idle);
@@ -410,7 +410,7 @@ void xe_display_pm_runtime_suspend_late(struct xe_device *xe)
410410
{
411411
struct intel_display *display = xe->display;
412412

413-
if (!xe->info.probe_display)
413+
if (!display)
414414
return;
415415

416416
if (xe->d3cold.allowed)
@@ -428,7 +428,7 @@ void xe_display_pm_shutdown_late(struct xe_device *xe)
428428
{
429429
struct intel_display *display = xe->display;
430430

431-
if (!xe->info.probe_display)
431+
if (!display)
432432
return;
433433

434434
/*
@@ -443,7 +443,7 @@ void xe_display_pm_resume_early(struct xe_device *xe)
443443
{
444444
struct intel_display *display = xe->display;
445445

446-
if (!xe->info.probe_display)
446+
if (!display)
447447
return;
448448

449449
intel_display_power_resume_early(display);
@@ -453,7 +453,7 @@ void xe_display_pm_resume(struct xe_device *xe)
453453
{
454454
struct intel_display *display = xe->display;
455455

456-
if (!xe->info.probe_display)
456+
if (!display)
457457
return;
458458

459459
intel_dmc_resume(display);
@@ -488,7 +488,7 @@ void xe_display_pm_runtime_resume(struct xe_device *xe)
488488
{
489489
struct intel_display *display = xe->display;
490490

491-
if (!xe->info.probe_display)
491+
if (!display)
492492
return;
493493

494494
if (xe->d3cold.allowed) {

0 commit comments

Comments
 (0)