All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/kms_ccs: Use igt_plane_has_format_mod()
@ 2019-03-22 19:11 Ville Syrjala
  2019-03-22 19:43 ` Dhinakaran Pandiyan
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ville Syrjala @ 2019-03-22 19:11 UTC (permalink / raw)
  To: igt-dev; +Cc: Dhinakaran Pandiyan

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Replace the open coded IN_FORMATS parsing with
igt_plane_has_format_mod() now that we have such a thing.

v2: Remove all the extra cruft too
    Deal with data->ccs_modifier

Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_ccs.c | 122 ++----------------------------------------------
 1 file changed, 4 insertions(+), 118 deletions(-)

diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
index 084f78f7eb74..2f08a83790aa 100644
--- a/tests/kms_ccs.c
+++ b/tests/kms_ccs.c
@@ -84,122 +84,6 @@ static const uint64_t ccs_modifiers[] = {
  */
 #define MAX_SPRITE_PLANE_WIDTH 2000
 
-struct local_drm_format_modifier {
-       /* Bitmask of formats in get_plane format list this info applies to. The
-	* offset allows a sliding window of which 64 formats (bits).
-	*
-	* Some examples:
-	* In today's world with < 65 formats, and formats 0, and 2 are
-	* supported
-	* 0x0000000000000005
-	*		  ^-offset = 0, formats = 5
-	*
-	* If the number formats grew to 128, and formats 98-102 are
-	* supported with the modifier:
-	*
-	* 0x0000003c00000000 0000000000000000
-	*		  ^
-	*		  |__offset = 64, formats = 0x3c00000000
-	*
-	*/
-       uint64_t formats;
-       uint32_t offset;
-       uint32_t pad;
-
-       /* This modifier can be used with the format for this plane. */
-       uint64_t modifier;
-};
-
-struct local_drm_format_modifier_blob {
-#define LOCAL_FORMAT_BLOB_CURRENT 1
-	/* Version of this blob format */
-	uint32_t version;
-
-	/* Flags */
-	uint32_t flags;
-
-	/* Number of fourcc formats supported */
-	uint32_t count_formats;
-
-	/* Where in this blob the formats exist (in bytes) */
-	uint32_t formats_offset;
-
-	/* Number of drm_format_modifiers */
-	uint32_t count_modifiers;
-
-	/* Where in this blob the modifiers exist (in bytes) */
-	uint32_t modifiers_offset;
-
-	/* u32 formats[] */
-	/* struct drm_format_modifier modifiers[] */
-};
-
-static inline uint32_t *
-formats_ptr(struct local_drm_format_modifier_blob *blob)
-{
-	return (uint32_t *)(((char *)blob) + blob->formats_offset);
-}
-
-static inline struct local_drm_format_modifier *
-modifiers_ptr(struct local_drm_format_modifier_blob *blob)
-{
-	return (struct local_drm_format_modifier *)(((char *)blob) + blob->modifiers_offset);
-}
-
-static bool plane_has_format_with_ccs(data_t *data, igt_plane_t *plane,
-				      uint32_t format)
-{
-	drmModePropertyBlobPtr blob;
-	struct local_drm_format_modifier_blob *blob_data;
-	struct local_drm_format_modifier *modifiers, *last_mod;
-	uint32_t *formats, *last_fmt;
-	uint64_t blob_id;
-	bool ret;
-	int fmt_idx = -1;
-
-	ret = kmstest_get_property(data->drm_fd, plane->drm_plane->plane_id,
-				   DRM_MODE_OBJECT_PLANE, "IN_FORMATS",
-				   NULL, &blob_id, NULL);
-	igt_skip_on_f(ret == false, "IN_FORMATS not supported by kernel\n");
-	igt_skip_on_f(blob_id == 0, "IN_FORMATS not supported by plane\n");
-	blob = drmModeGetPropertyBlob(data->drm_fd, blob_id);
-	igt_assert(blob);
-	igt_assert_lte(sizeof(struct local_drm_format_modifier_blob),
-		       blob->length);
-
-	blob_data = (struct local_drm_format_modifier_blob *) blob->data;
-	formats = formats_ptr(blob_data);
-	last_fmt = &formats[blob_data->count_formats];
-	igt_assert_lte(((char *) last_fmt - (char *) blob_data), blob->length);
-	for (int i = 0; i < blob_data->count_formats; i++) {
-		if (formats[i] == format) {
-			fmt_idx = i;
-			break;
-		}
-	}
-
-	if (fmt_idx == -1)
-		return false;
-
-	modifiers = modifiers_ptr(blob_data);
-	last_mod = &modifiers[blob_data->count_modifiers];
-	igt_assert_lte(((char *) last_mod - (char *) blob_data), blob->length);
-	for (int i = 0; i < blob_data->count_modifiers; i++) {
-		if (modifiers[i].modifier != data->ccs_modifier)
-			continue;
-
-		if (modifiers[i].offset > fmt_idx ||
-		    fmt_idx > modifiers[i].offset + 63)
-			continue;
-
-		if (modifiers[i].formats &
-		    (1UL << (fmt_idx - modifiers[i].offset)))
-			return true;
-	}
-
-	return false;
-}
-
 static void addfb_init(struct igt_fb *fb, struct drm_mode_fb_cmd2 *f)
 {
 	int i;
@@ -314,11 +198,13 @@ static bool try_config(data_t *data, enum test_fb_flags fb_flags,
 
 	primary = igt_output_get_plane_type(data->output,
 					    DRM_PLANE_TYPE_PRIMARY);
-	if (!plane_has_format_with_ccs(data, primary, DRM_FORMAT_XRGB8888))
+	if (!igt_plane_has_format_mod(primary, DRM_FORMAT_XRGB8888,
+				      data->ccs_modifier))
 		return false;
 
 	if (data->plane && fb_flags & FB_COMPRESSED) {
-		if (!plane_has_format_with_ccs(data, data->plane, DRM_FORMAT_XRGB8888))
+		if (!igt_plane_has_format_mod(data->plane, DRM_FORMAT_XRGB8888,
+					      data->ccs_modifier))
 			return false;
 
 		generate_fb(data, &fb, min(MAX_SPRITE_PLANE_WIDTH, drm_mode->hdisplay),
-- 
2.19.2

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [igt-dev] [PATCH i-g-t] tests/kms_ccs: Use igt_plane_has_format_mod()
  2019-03-22 19:11 [igt-dev] [PATCH i-g-t] tests/kms_ccs: Use igt_plane_has_format_mod() Ville Syrjala
@ 2019-03-22 19:43 ` Dhinakaran Pandiyan
  2019-03-25  7:27   ` Ville Syrjälä
  2019-03-22 19:48 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
  2019-03-23 21:19 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  2 siblings, 1 reply; 5+ messages in thread
From: Dhinakaran Pandiyan @ 2019-03-22 19:43 UTC (permalink / raw)
  To: Ville Syrjala, igt-dev

On Fri, 2019-03-22 at 21:11 +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Replace the open coded IN_FORMATS parsing with
> igt_plane_has_format_mod() now that we have such a thing.
> 
> v2: Remove all the extra cruft too
>     Deal with data->ccs_modifier
> 
> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>



_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_ccs: Use igt_plane_has_format_mod()
  2019-03-22 19:11 [igt-dev] [PATCH i-g-t] tests/kms_ccs: Use igt_plane_has_format_mod() Ville Syrjala
  2019-03-22 19:43 ` Dhinakaran Pandiyan
@ 2019-03-22 19:48 ` Patchwork
  2019-03-23 21:19 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2019-03-22 19:48 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: igt-dev

== Series Details ==

Series: tests/kms_ccs: Use igt_plane_has_format_mod()
URL   : https://patchwork.freedesktop.org/series/58429/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5796 -> IGTPW_2693
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/58429/revisions/1/mbox/

Known issues
------------

  Here are the changes found in IGTPW_2693 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_basic@gtt-bsd:
    - fi-bwr-2160:        NOTRUN -> SKIP [fdo#109271] +103

  * igt@gem_exec_basic@readonly-bsd1:
    - fi-snb-2520m:       NOTRUN -> SKIP [fdo#109271] +57

  * igt@i915_selftest@live_hangcheck:
    - fi-skl-iommu:       PASS -> INCOMPLETE [fdo#108602] / [fdo#108744]

  * igt@kms_busy@basic-flip-c:
    - fi-bwr-2160:        NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
    - fi-snb-2520m:       NOTRUN -> SKIP [fdo#109271] / [fdo#109278]

  * igt@kms_frontbuffer_tracking@basic:
    - fi-icl-u3:          PASS -> FAIL [fdo#103167]

  * igt@runner@aborted:
    - fi-skl-iommu:       NOTRUN -> FAIL [fdo#104108] / [fdo#108602]

  
#### Possible fixes ####

  * igt@i915_selftest@live_evict:
    - fi-bsw-kefka:       DMESG-WARN [fdo#107709] -> PASS

  
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
  [fdo#107709]: https://bugs.freedesktop.org/show_bug.cgi?id=107709
  [fdo#108602]: https://bugs.freedesktop.org/show_bug.cgi?id=108602
  [fdo#108744]: https://bugs.freedesktop.org/show_bug.cgi?id=108744
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278


Participating hosts (40 -> 34)
------------------------------

  Additional (2): fi-bwr-2160 fi-snb-2520m 
  Missing    (8): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-icl-u2 fi-bsw-cyan fi-ctg-p8600 fi-pnv-d510 fi-bdw-samus 


Build changes
-------------

    * IGT: IGT_4899 -> IGTPW_2693

  CI_DRM_5796: 2165d3631bdb91a7b80110b1f76633a19666d0f6 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2693: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2693/
  IGT_4899: ba96339c238180b38d05d7fa2dca772d49eee332 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2693/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [igt-dev] ✓ Fi.CI.IGT: success for tests/kms_ccs: Use igt_plane_has_format_mod()
  2019-03-22 19:11 [igt-dev] [PATCH i-g-t] tests/kms_ccs: Use igt_plane_has_format_mod() Ville Syrjala
  2019-03-22 19:43 ` Dhinakaran Pandiyan
  2019-03-22 19:48 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
@ 2019-03-23 21:19 ` Patchwork
  2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2019-03-23 21:19 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: igt-dev

== Series Details ==

Series: tests/kms_ccs: Use igt_plane_has_format_mod()
URL   : https://patchwork.freedesktop.org/series/58429/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5796_full -> IGTPW_2693_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/58429/revisions/1/mbox/

Known issues
------------

  Here are the changes found in IGTPW_2693_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_store@pages-bsd1:
    - shard-apl:          NOTRUN -> SKIP [fdo#109271] +12

  * igt@kms_busy@extended-modeset-hang-newfb-render-b:
    - shard-hsw:          PASS -> DMESG-WARN [fdo#110222] +1
    - shard-kbl:          PASS -> DMESG-WARN [fdo#110222] +1
    - shard-snb:          PASS -> DMESG-WARN [fdo#110222] +1

  * igt@kms_draw_crc@draw-method-xrgb8888-render-ytiled:
    - shard-snb:          NOTRUN -> SKIP [fdo#109271] +79

  * igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
    - shard-glk:          PASS -> FAIL [fdo#105363]

  * igt@kms_frontbuffer_tracking@psr-2p-primscrn-spr-indfb-draw-blt:
    - shard-kbl:          NOTRUN -> SKIP [fdo#109271] +9

  * igt@kms_pipe_crc_basic@hang-read-crc-pipe-d:
    - shard-kbl:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278]

  * igt@kms_plane_scaling@pipe-a-scaler-with-rotation:
    - shard-glk:          PASS -> SKIP [fdo#109271] / [fdo#109278]

  * igt@kms_setmode@basic:
    - shard-apl:          PASS -> FAIL [fdo#99912]

  * igt@kms_universal_plane@universal-plane-gen9-features-pipe-d:
    - shard-apl:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +2

  * igt@kms_vblank@pipe-c-ts-continuation-idle:
    - shard-snb:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +6

  * igt@perf_pmu@rc6:
    - shard-kbl:          PASS -> SKIP [fdo#109271]

  * igt@prime_nv_test@nv_write_i915_cpu_mmap_read:
    - shard-hsw:          NOTRUN -> SKIP [fdo#109271] +1

  
#### Possible fixes ####

  * igt@kms_atomic_transition@1x-modeset-transitions-nonblocking:
    - shard-apl:          FAIL [fdo#109660] -> PASS
    - shard-kbl:          FAIL [fdo#109660] -> PASS

  * igt@kms_busy@extended-modeset-hang-newfb-render-a:
    - shard-kbl:          DMESG-WARN [fdo#110222] -> PASS

  * igt@kms_cursor_crc@cursor-256x256-random:
    - shard-hsw:          INCOMPLETE [fdo#103540] -> PASS

  * igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy:
    - shard-hsw:          FAIL [fdo#105767] -> PASS

  * {igt@kms_plane@pixel-format-pipe-a-planes-source-clamping}:
    - shard-glk:          SKIP [fdo#109271] -> PASS +1

  * igt@kms_plane_scaling@pipe-b-scaler-with-clipping-clamping:
    - shard-glk:          SKIP [fdo#109271] / [fdo#109278] -> PASS

  * igt@kms_rotation_crc@multiplane-rotation:
    - shard-kbl:          INCOMPLETE [fdo#103665] -> PASS

  * igt@kms_vblank@pipe-b-ts-continuation-modeset:
    - shard-apl:          FAIL [fdo#104894] -> PASS

  * igt@kms_vblank@pipe-b-ts-continuation-suspend:
    - shard-kbl:          FAIL [fdo#104894] -> PASS

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
  [fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
  [fdo#104894]: https://bugs.freedesktop.org/show_bug.cgi?id=104894
  [fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
  [fdo#105767]: https://bugs.freedesktop.org/show_bug.cgi?id=105767
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109660]: https://bugs.freedesktop.org/show_bug.cgi?id=109660
  [fdo#110222]: https://bugs.freedesktop.org/show_bug.cgi?id=110222
  [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912


Participating hosts (10 -> 5)
------------------------------

  Missing    (5): shard-skl pig-hsw-4770r pig-glk-j5005 shard-iclb pig-skl-6260u 


Build changes
-------------

    * IGT: IGT_4899 -> IGTPW_2693
    * Piglit: piglit_4509 -> None

  CI_DRM_5796: 2165d3631bdb91a7b80110b1f76633a19666d0f6 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2693: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2693/
  IGT_4899: ba96339c238180b38d05d7fa2dca772d49eee332 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2693/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [igt-dev] [PATCH i-g-t] tests/kms_ccs: Use igt_plane_has_format_mod()
  2019-03-22 19:43 ` Dhinakaran Pandiyan
@ 2019-03-25  7:27   ` Ville Syrjälä
  0 siblings, 0 replies; 5+ messages in thread
From: Ville Syrjälä @ 2019-03-25  7:27 UTC (permalink / raw)
  To: Dhinakaran Pandiyan; +Cc: igt-dev

On Fri, Mar 22, 2019 at 12:43:47PM -0700, Dhinakaran Pandiyan wrote:
> On Fri, 2019-03-22 at 21:11 +0200, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Replace the open coded IN_FORMATS parsing with
> > igt_plane_has_format_mod() now that we have such a thing.
> > 
> > v2: Remove all the extra cruft too
> >     Deal with data->ccs_modifier
> > 
> > Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>

Thanks. Pushed.

-- 
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-03-25  7:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-22 19:11 [igt-dev] [PATCH i-g-t] tests/kms_ccs: Use igt_plane_has_format_mod() Ville Syrjala
2019-03-22 19:43 ` Dhinakaran Pandiyan
2019-03-25  7:27   ` Ville Syrjälä
2019-03-22 19:48 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-03-23 21:19 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.