From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: sunpeng.li@amd.com
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] lib/igt_fb: Require FB modifiers only when needed
Date: Fri, 12 Oct 2018 15:17:23 +0300 [thread overview]
Message-ID: <20181012121723.GO9144@intel.com> (raw)
In-Reply-To: <1539296256-16598-1-git-send-email-sunpeng.li@amd.com>
On Thu, Oct 11, 2018 at 06:17:36PM -0400, sunpeng.li@amd.com wrote:
> From: Leo Li <sunpeng.li@amd.com>
>
> AMDGPU doesn't have modifier support. However, __kms_addfb requests
> modifier support on all calls to igt_create_fb_with_bo_size.
>
> Therefore, don't request modifier support if not needed.
>
> Signed-off-by: Leo Li <sunpeng.li@amd.com>
> ---
> lib/igt_fb.c | 8 +++++++-
> lib/ioctl_wrappers.c | 3 ++-
> 2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> index 35be2e8..3253236 100644
> --- a/lib/igt_fb.c
> +++ b/lib/igt_fb.c
> @@ -913,6 +913,12 @@ igt_create_fb_with_bo_size(int fd, int width, int height,
> /* FIXME allow the caller to pass these in */
> enum igt_color_encoding color_encoding = IGT_COLOR_YCBCR_BT709;
> enum igt_color_range color_range = IGT_COLOR_YCBCR_LIMITED_RANGE;
> + uint32_t flags = 0;
> +
> + if (tiling != LOCAL_DRM_FORMAT_MOD_NONE &&
> + tiling != LOCAL_I915_FORMAT_MOD_X_TILED)
> + flags = LOCAL_DRM_MODE_FB_MODIFIERS;
> +
Check out the discussion at
https://lists.freedesktop.org/archives/igt-dev/2018-October/006282.html
At least I like Daniel's suggestion there.
>
> fb_init(fb, fd, width, height, format, tiling,
> color_encoding, color_range);
> @@ -935,7 +941,7 @@ igt_create_fb_with_bo_size(int fd, int width, int height,
> fb->width, fb->height,
> fb->drm_format, fb->tiling,
> fb->strides, fb->offsets, fb->num_planes,
> - LOCAL_DRM_MODE_FB_MODIFIERS,
> + flags,
> &fb->fb_id));
>
> return fb->fb_id;
> diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
> index 0929c43..017314a 100644
> --- a/lib/ioctl_wrappers.c
> +++ b/lib/ioctl_wrappers.c
> @@ -1678,7 +1678,8 @@ int __kms_addfb(int fd, uint32_t handle,
> struct drm_mode_fb_cmd2 f;
> int ret, i;
>
> - igt_require_fb_modifiers(fd);
> + if (modifier)
> + igt_require_fb_modifiers(fd);
>
> memset(&f, 0, sizeof(f));
>
> --
> 2.7.4
>
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
--
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2018-10-12 12:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-11 22:17 [igt-dev] [PATCH i-g-t] lib/igt_fb: Require FB modifiers only when needed sunpeng.li
2018-10-11 22:54 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2018-10-12 12:17 ` Ville Syrjälä [this message]
2018-10-12 13:03 ` [igt-dev] [PATCH i-g-t] " Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181012121723.GO9144@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=sunpeng.li@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.