drm/i915: Use intel_fb_obj() everywhere
Subsystems (2)
PATCH v2 1/2 drm/i915: Use intel_fb_obj() everywhere
We already have a macro to pull the GEM object from a FB, so use it everywhere. We'll make use of this later to move the object storage.
--- drivers/gpu/drm/i915/i915_debugfs.c | 4 ++-- drivers/gpu/drm/i915/intel_display.c | 19 ++++++++++--------- drivers/gpu/drm/i915/intel_fbdev.c | 9 +++++---- 3 files changed, 17 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +2 -2
@@ -1908,7 +1908,7 @@ static int i915_gem_framebuffer_info(struct seq_file *m, void *data) fbdev_fb->base.format->cpp[0 ] *8 , fbdev_fb->base.modifier, drm_framebuffer_read_refcount(&fbdev_fb->base)); -describe_obj (m, fbdev_fb->obj); +describe_obj (m,intel_fb_obj (&fbdev_fb->base)); seq_putc(m, '\n'); }#endif
@@ -1926,7 +1926,7 @@ static int i915_gem_framebuffer_info(struct seq_file *m, void *data) fb->base.format->cpp[0 ] *8 , fb->base.modifier, drm_framebuffer_read_refcount(&fb->base)); -describe_obj (m, fb->obj); +describe_obj (m,intel_fb_obj (&fb->base));seq_putc (m,'\n' ); }mutex_unlock (&dev->mode_config.fb_lock);
drivers/gpu/drm/i915/intel_display.c +10 -9
@@ -2474,6 +2474,7 @@ intel_fill_fb_info(struct drm_i915_private *dev_priv, {struct intel_framebuffer *intel_fb =to_intel_framebuffer (fb);struct intel_rotation_info *rot_info = &intel_fb->rot_info; +struct drm_i915_gem_object *obj =intel_fb_obj (fb);u32 gtt_offset_rotated =0 ;unsigned int max_size =0 ;int i, num_planes = fb->format->num_planes;
@@ -2538,7 +2539,7 @@ intel_fill_fb_info(struct drm_i915_private *dev_priv,* fb layout agrees with the fence layout. We already check that the * fb stride matches the fence stride elsewhere. */ -if (i ==0 &&i915_gem_object_is_tiled (intel_fb->obj) && +if (i ==0 &&i915_gem_object_is_tiled (obj) && (x + width) * cpp > fb->pitches[i]) {DRM_DEBUG_KMS ("bad fb plane %d offset: 0x%x\n" , i, fb->offsets[i]);
@@ -2623,9 +2624,9 @@ intel_fill_fb_info(struct drm_i915_private *dev_priv, max_size =max (max_size, offset + size); } -if (max_size * tile_size > intel_fb->obj->base.size) { +if (max_size * tile_size > obj->base.size) {DRM_DEBUG_KMS ("fb too big for bo (need %u bytes, have %zu bytes)\n" , - max_size * tile_size, intel_fb->obj->base.size); + max_size * tile_size, obj->base.size);return -EINVAL ; }
@@ -14082,14 +14083,15 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)static void intel_user_framebuffer_destroy (struct drm_framebuffer *fb) {struct intel_framebuffer *intel_fb =to_intel_framebuffer (fb); +struct drm_i915_gem_object *obj =intel_fb_obj (fb);drm_framebuffer_cleanup (fb); -i915_gem_object_lock (intel_fb->obj); -WARN_ON (!intel_fb->obj->framebuffer_references--); -i915_gem_object_unlock (intel_fb->obj); +i915_gem_object_lock (obj); +WARN_ON (!obj->framebuffer_references--); +i915_gem_object_unlock (obj); -i915_gem_object_put (intel_fb->obj); +i915_gem_object_put (obj);kfree (intel_fb); }
@@ -14098,8 +14100,7 @@ static int intel_user_framebuffer_create_handle(struct drm_framebuffer *fb,struct drm_file *file, unsigned int *handle) { - struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb); -struct drm_i915_gem_object *obj = intel_fb->obj; + struct drm_i915_gem_object *obj = intel_fb_obj(fb);if (obj->userptr.mm) {DRM_DEBUG ("attempting to use a userptr for a framebuffer, denied\n" );
drivers/gpu/drm/i915/intel_fbdev.c +5 -4
@@ -47,7 +47,7 @@static void intel_fbdev_invalidate (struct intel_fbdev *ifbdev) { -struct drm_i915_gem_object *obj = ifbdev->fb->obj; +struct drm_i915_gem_object *obj =intel_fb_obj (&ifbdev->fb->base);unsigned int origin = ifbdev->vma_flags &PLANE_HAS_FENCE ?ORIGIN_GTT :ORIGIN_CPU ;
@@ -193,7 +193,7 @@ static int intelfb_create(struct drm_fb_helper *helper,drm_framebuffer_put (&intel_fb->base); intel_fb = ifbdev->fb =NULL ; } -if (!intel_fb ||WARN_ON (!intel_fb->obj)) { +if (!intel_fb ||WARN_ON (!intel_fb_obj (&intel_fb->base))) {DRM_DEBUG_KMS ("no BIOS fb, allocating a new one\n" ); ret =intelfb_alloc (helper, sizes);if (ret)
@@ -265,7 +265,7 @@ static int intelfb_create(struct drm_fb_helper *helper,* If the object is stolen however, it will be full of whatever * garbage was left in there. */ -if (intel_fb->obj->stolen && !prealloc) +if (intel_fb_obj (fb)->stolen && !prealloc)memset_io (info->screen_base,0 , info->screen_size);/* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */
@@ -792,7 +792,8 @@ void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous* been restored from swap. If the object is stolen however, it will be * full of whatever garbage was left in there. */ -if (state ==FBINFO_STATE_RUNNING && ifbdev->fb->obj->stolen) +if (state ==FBINFO_STATE_RUNNING && +intel_fb_obj (&ifbdev->fb->base)->stolen)memset_io (info->screen_base,0 , info->screen_size);drm_fb_helper_set_suspend (&ifbdev->helper, state);
Signature · 6 lines
2.17.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 2/2 drm/i915: Move GEM BO inside drm_framebuffer
Since drm_framebuffer can now store GEM objects directly, place them there rather than in our own subclass.
v2: Only hold a single reference per framebuffer, not per plane. (Ville)
--- drivers/gpu/drm/i915/intel_display.c | 4 ++-- drivers/gpu/drm/i915/intel_drv.h | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_display.c +2 -2
@@ -14370,9 +14370,9 @@ static int intel_framebuffer_init(struct intel_framebuffer *intel_fb, i, fb->pitches[i], stride_alignment); goto err; } - } - intel_fb->obj = obj; + fb->obj[i] = &obj->base; + } ret =intel_fill_fb_info (dev_priv, fb);if (ret)
drivers/gpu/drm/i915/intel_drv.h +1 -2
@@ -194,7 +194,6 @@ enum intel_output_type {struct intel_framebuffer {struct drm_framebuffer base; -struct drm_i915_gem_object *obj;struct intel_rotation_info rot_info;/* for each plane in the normal GTT view */
@@ -1005,7 +1004,7 @@ struct cxsr_latency {#define to_intel_framebuffer (x) container_of(x, struct intel_framebuffer, base)#define to_intel_plane (x) container_of(x, struct intel_plane, base)#define to_intel_plane_state (x) container_of(x, struct intel_plane_state, base) -#define intel_fb_obj (x) (x ? to_intel_framebuffer(x)->obj : NULL) +#define intel_fb_obj (x) (((x) && (x)->obj[0]) ? to_intel_bo((x)->obj[0]) : NULL)struct intel_hdmi {i915_reg_t hdmi_reg;
Signature · 6 lines
2.17.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 2/2] drm/i915: Move GEM BO inside drm_framebuffer
Quoted 45 lines · Daniel Stone
Since
drm_framebuffercan now store GEM objects directly, place them there rather than in our own subclass.v2: Only hold a single reference per framebuffer, not per plane. (Ville)
Signed-off-by Daniel Stone <[email protected]>Cc Ville Syrjälä <[email protected]>Cc Jani Nikula <[email protected]>Cc Joonas Lahtinen <[email protected]>Cc Rodrigo Vivi <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 4 ++-- drivers/gpu/drm/i915/intel_drv.h | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/intel_display.c +2
-2@@ -14370,9 +14370,9 @@ static int intel_framebuffer_init(struct intel_framebuffer *intel_fb, i, fb->pitches[i], stride_alignment); goto err; } - } - intel_fb->obj = obj; + fb->obj[i] = &obj->base; + } ret =intel_fill_fb_info (dev_priv, fb);if (ret)drivers/gpu/drm/i915/intel_drv.h +0
-1@@ -194,7 +194,6 @@ enum intel_output_type {struct intel_framebuffer {struct drm_framebuffer base; -struct drm_i915_gem_object *obj;struct intel_rotation_info rot_info;/* for each plane in the normal GTT view */
drivers/gpu/drm/i915/intel_drv.h struct cxsr_latency { · line 1007
Quoted 5 lines
drivers/gpu/drm/i915/intel_drv.h +1
-1@@ -1005,7 +1004,7 @@ struct cxsr_latency {#define to_intel_framebuffer (x) container_of(x, struct intel_framebuffer, base)#define to_intel_plane (x) container_of(x, struct intel_plane, base)#define to_intel_plane_state (x) container_of(x, struct intel_plane_state, base) -#define intel_fb_obj (x) (x ? to_intel_framebuffer(x)->obj : NULL) +#define intel_fb_obj (x) (((x) && (x)->obj[0]) ? to_intel_bo((x)->obj[0]) : NULL)
We don't need the obj[0] null check. For most things we just assume that the base object is at offset 0. And in case of drm_i915_gem_object it looks like we even have a BUILD_BUG_ON() to make sure. So you may want to drop that part.
Series is
Quoted 10 lines
drivers/gpu/drm/i915/intel_drv.h +0
-0struct intel_hdmi {i915_reg_t hdmi_reg;Signature · 6 lines
2.17.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.CHECKPATCH: warning for series starting with [v2,1/2] drm/i915: Use intel_fb_obj() everywhere
In reply to Daniel Stone== Series Details ==
== Series Details ==
Series: series starting with [v2,1/2] drm/i915: Use intel_fb_obj() everywhere
URL : https://patchwork.freedesktop.org/series/43418/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip a498ec6deeb8 drm/i915: Use intel_fb_obj() everywhere a7a2fce7f362 drm/i915: Move GEM BO inside drm_framebuffer -:54: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'x' - possible side-effects? #54: FILE: drivers/gpu/drm/i915/intel_drv.h:1007: +#define intel_fb_obj(x) (((x) && (x)->obj[0]) ? to_intel_bo((x)->obj[0]) : NULL)
total: 0 errors, 0 warnings, 1 checks, 26 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.SPARSE: warning for series starting with [v2,1/2] drm/i915: Use intel_fb_obj() everywhere
In reply to Daniel Stone== Series Details ==
== Series Details ==
Series: series starting with [v2,1/2] drm/i915: Use intel_fb_obj() everywhere
URL : https://patchwork.freedesktop.org/series/43418/
State : warning
== Summary ==
$ dim sparse origin/drm-tip Commit: drm/i915: Use intel_fb_obj() everywhere -O:drivers/gpu/drm/i915/intel_display.c:2623:28: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_display.c:2623:28: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_display.c:2624:28: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_display.c:2624:28: warning: expression using sizeof(void)
Commit: drm/i915: Move GEM BO inside drm_framebuffer Okay!
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for series starting with [v2,1/2] drm/i915: Use intel_fb_obj() everywhere
In reply to Daniel Stone== Series Details ==
== Series Details ==
Series: series starting with [v2,1/2] drm/i915: Use intel_fb_obj() everywhere
URL : https://patchwork.freedesktop.org/series/43418/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4206 -> Patchwork_9051 =
== Summary - SUCCESS ==
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/43418/revisions/1/mbox/
== Known issues ==
Here are the changes found in Patchwork_9051 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@gem_mmap_gtt@basic-small-bo-tiledx:
fi-gdg-551: PASS -> FAIL (fdo#102575)
igt@kms_frontbuffer_tracking@basic:
fi-hsw-4200u: PASS -> DMESG-FAIL (fdo#106103, fdo#102614)
==== Possible fixes ====
igt@kms_pipe_crc_basic@read-crc-pipe-b-frame-sequence:
fi-hsw-4770r: FAIL (fdo#103481) -> PASS fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#103481 https://bugs.freedesktop.org/show_bug.cgi?id=103481
fdo#106103 https://bugs.freedesktop.org/show_bug.cgi?id=106103
== Participating hosts (43 -> 39) ==
Missing (4): fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-skl-6700hq
== Build changes ==
* Linux: CI_DRM_4206 -> Patchwork_9051
CI_DRM_4206: e84f2b258f41e62419c58fcf0b85d917abbe849e @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4487: eccae1360d6d01e73c6af2bd97122cef708207ef @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9051: a7a2fce7f36208c9c41b9d68dd544cfcfa67c22d @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4487: 6ab75f7eb5e1dccbb773e1739beeb2d7cbd6ad0d @ git://anongit.freedesktop.org/piglit
== Linux commits ==
a7a2fce7f362 drm/i915: Move GEM BO inside drm_framebuffer a498ec6deeb8 drm/i915: Use intel_fb_obj() everywhere
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9051/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for series starting with [v2,1/2] drm/i915: Use intel_fb_obj() everywhere
In reply to Daniel Stone== Series Details ==
== Series Details ==
Series: series starting with [v2,1/2] drm/i915: Use intel_fb_obj() everywhere
URL : https://patchwork.freedesktop.org/series/43418/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4206_full -> Patchwork_9051_full =
== Summary - WARNING ==
Minor unknown changes coming with Patchwork_9051_full need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_9051_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://patchwork.freedesktop.org/api/1.0/series/43418/revisions/1/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_9051_full:
=== IGT changes ===
==== Warnings ====
igt@kms_cursor_legacy@cursora-vs-flipa-atomic:
shard-apl: SKIP -> PASS +28== Known issues ==
Here are the changes found in Patchwork_9051_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@kms_cursor_legacy@2x-nonblocking-modeset-vs-cursor-atomic:
shard-glk: PASS -> FAIL (fdo#106509, fdo#105454)
igt@kms_flip@2x-plain-flip-fb-recreate-interruptible:
shard-glk: PASS -> FAIL (fdo#100368)
igt@kms_frontbuffer_tracking@fbc-2p-primscrn-pri-shrfb-draw-mmap-wc:
shard-glk: PASS -> FAIL (fdo#103167, fdo#104724)
==== Possible fixes ====
igt@drv_selftest@live_hangcheck:
shard-apl: DMESG-FAIL (fdo#106560) -> PASS
igt@kms_cursor_legacy@2x-long-flip-vs-cursor-legacy:
shard-glk: FAIL (fdo#104873) -> PASS
igt@kms_flip@flip-vs-expired-vblank:
shard-hsw: FAIL (fdo#105707) -> PASS
shard-apl: FAIL (fdo#105363, fdo#102887) -> PASS
igt@kms_flip@flip-vs-expired-vblank-interruptible:
shard-glk: FAIL (fdo#105363, fdo#102887) -> PASS
igt@kms_flip_tiling@flip-x-tiled:
shard-glk: FAIL (fdo#104724) -> PASS
igt@kms_flip_tiling@flip-y-tiled:
shard-glk: FAIL (fdo#103822, fdo#104724) -> PASS
igt@kms_setmode@basic:
shard-apl: FAIL (fdo#99912) -> PASS
igt@perf_pmu@rc6-runtime-pm-long:
shard-apl: DMESG-WARN (fdo#103558, fdo#105602) -> PASS +34 fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
fdo#103822 https://bugs.freedesktop.org/show_bug.cgi?id=103822
fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
fdo#104873 https://bugs.freedesktop.org/show_bug.cgi?id=104873
fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
fdo#105454 https://bugs.freedesktop.org/show_bug.cgi?id=105454
fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
fdo#105707 https://bugs.freedesktop.org/show_bug.cgi?id=105707
fdo#106509 https://bugs.freedesktop.org/show_bug.cgi?id=106509
fdo#106560 https://bugs.freedesktop.org/show_bug.cgi?id=106560
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
== Participating hosts (9 -> 8) ==
Missing (1): shard-kbl
== Build changes ==
* Linux: CI_DRM_4206 -> Patchwork_9051
CI_DRM_4206: e84f2b258f41e62419c58fcf0b85d917abbe849e @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4487: eccae1360d6d01e73c6af2bd97122cef708207ef @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9051: a7a2fce7f36208c9c41b9d68dd544cfcfa67c22d @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4487: 6ab75f7eb5e1dccbb773e1739beeb2d7cbd6ad0d @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9051/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx