Skip to content

Commit 5ff2977

Browse files
committed
Merge tag 'drm-intel-next-fixes-2023-06-21' of git://anongit.freedesktop.org/drm/drm-intel into drm-next
One fix for incorrect error handling in the frame buffer mmap callback, HuC init error handling fix, missing wakeref during GSC init and a build fix when !CONFIG_PROC_FS. Signed-off-by: Dave Airlie <[email protected]> From: Tvrtko Ursulin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/ZJLI8ON96ApPTl8H@tursulin-desk
2 parents 2222dcb + 274d4b9 commit 5ff2977

File tree

5 files changed

+18
-13
lines changed

5 files changed

+18
-13
lines changed

drivers/gpu/drm/i915/gem/i915_gem_mman.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,8 +1085,8 @@ int i915_gem_fb_mmap(struct drm_i915_gem_object *obj, struct vm_area_struct *vma
10851085
/* handle stolen and smem objects */
10861086
mmap_type = i915_ggtt_has_aperture(ggtt) ? I915_MMAP_TYPE_GTT : I915_MMAP_TYPE_WC;
10871087
mmo = mmap_offset_attach(obj, mmap_type, NULL);
1088-
if (!mmo)
1089-
return -ENODEV;
1088+
if (IS_ERR(mmo))
1089+
return PTR_ERR(mmo);
10901090
}
10911091

10921092
/*

drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,27 @@ static bool gsc_is_in_reset(struct intel_uncore *uncore)
2424
GSC_FW_CURRENT_STATE_RESET;
2525
}
2626

27-
bool intel_gsc_uc_fw_proxy_init_done(struct intel_gsc_uc *gsc)
27+
static u32 gsc_uc_get_fw_status(struct intel_uncore *uncore)
2828
{
29-
struct intel_uncore *uncore = gsc_uc_to_gt(gsc)->uncore;
30-
u32 fw_status = intel_uncore_read(uncore, GSC_FW_STATUS_REG);
29+
intel_wakeref_t wakeref;
30+
u32 fw_status = 0;
3131

32-
return REG_FIELD_GET(GSC_FW_CURRENT_STATE, fw_status) ==
32+
with_intel_runtime_pm(uncore->rpm, wakeref)
33+
fw_status = intel_uncore_read(uncore, GSC_FW_STATUS_REG);
34+
35+
return fw_status;
36+
}
37+
38+
bool intel_gsc_uc_fw_proxy_init_done(struct intel_gsc_uc *gsc)
39+
{
40+
return REG_FIELD_GET(GSC_FW_CURRENT_STATE,
41+
gsc_uc_get_fw_status(gsc_uc_to_gt(gsc)->uncore)) ==
3342
GSC_FW_PROXY_STATE_NORMAL;
3443
}
3544

3645
bool intel_gsc_uc_fw_init_done(struct intel_gsc_uc *gsc)
3746
{
38-
struct intel_uncore *uncore = gsc_uc_to_gt(gsc)->uncore;
39-
u32 fw_status = intel_uncore_read(uncore, GSC_FW_STATUS_REG);
40-
41-
return fw_status & GSC_FW_INIT_COMPLETE_BIT;
47+
return gsc_uc_get_fw_status(gsc_uc_to_gt(gsc)->uncore) & GSC_FW_INIT_COMPLETE_BIT;
4248
}
4349

4450
static int emit_gsc_fw_load(struct i915_request *rq, struct intel_gsc_uc *gsc)

drivers/gpu/drm/i915/gt/uc/intel_huc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ int intel_huc_init(struct intel_huc *huc)
384384

385385
vma = intel_guc_allocate_vma(&gt->uc.guc, PXP43_HUC_AUTH_INOUT_SIZE * 2);
386386
if (IS_ERR(vma)) {
387+
err = PTR_ERR(vma);
387388
huc_info(huc, "Failed to allocate heci pkt\n");
388389
goto out;
389390
}

drivers/gpu/drm/i915/i915_driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1816,7 +1816,7 @@ static const struct drm_driver i915_drm_driver = {
18161816
.open = i915_driver_open,
18171817
.lastclose = i915_driver_lastclose,
18181818
.postclose = i915_driver_postclose,
1819-
.show_fdinfo = i915_drm_client_fdinfo,
1819+
.show_fdinfo = PTR_IF(IS_ENABLED(CONFIG_PROC_FS), i915_drm_client_fdinfo),
18201820

18211821
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
18221822
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,

drivers/gpu/drm/i915/i915_drm_client.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ static inline void i915_drm_client_put(struct i915_drm_client *client)
4747

4848
struct i915_drm_client *i915_drm_client_alloc(void);
4949

50-
#ifdef CONFIG_PROC_FS
5150
void i915_drm_client_fdinfo(struct drm_printer *p, struct drm_file *file);
52-
#endif
5351

5452
#endif /* !__I915_DRM_CLIENT_H__ */

0 commit comments

Comments
 (0)