From: "Kahola, Mika" <mika.kahola@intel.com>
To: "Siddiqui, Ayaz A" <ayaz.siddiqui@intel.com>,
"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Cc: "Siddiqui, Ayaz A" <ayaz.siddiqui@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t 1/1] lib/rendercopy_gen9: Program MOCS value based on platform
Date: Fri, 6 Aug 2021 11:12:00 +0000 [thread overview]
Message-ID: <2f2adec22b834113ab24a23b45f6ff0a@intel.com> (raw)
In-Reply-To: <20210803110934.970874-2-ayaz.siddiqui@intel.com>
> -----Original Message-----
> From: igt-dev <igt-dev-bounces@lists.freedesktop.org> On Behalf Of Ayaz A
> Siddiqui
> Sent: Tuesday, August 3, 2021 2:10 PM
> To: igt-dev@lists.freedesktop.org
> Cc: Siddiqui, Ayaz A <ayaz.siddiqui@intel.com>
> Subject: [igt-dev] [PATCH i-g-t 1/1] lib/rendercopy_gen9: Program MOCS value
> based on platform
>
> Gen12 onward platforms does not support coachability via PTE.
> So I915_MOCS_PTE( index 1) may point to unspecified/reserved or some other
> coachability MOCS index. This may leads to data corruption.
>
> A helper function has been added to provide UC MOCS index based on platform.
>
> Signed-off-by: Ayaz A Siddiqui <ayaz.siddiqui@intel.com>
> ---
> lib/rendercopy_gen9.c | 33 ++++++++++++++++++++++++++++++++-
> 1 file changed, 32 insertions(+), 1 deletion(-)
>
> diff --git a/lib/rendercopy_gen9.c b/lib/rendercopy_gen9.c index
> eecf73d318..5845d3b280 100644
> --- a/lib/rendercopy_gen9.c
> +++ b/lib/rendercopy_gen9.c
> @@ -23,6 +23,7 @@
> #include "gen9_render.h"
> #include "intel_reg.h"
> #include "igt_aux.h"
> +#include "intel_chipset.h"
>
> #define VERTEX_SIZE (3*4)
>
> @@ -115,12 +116,42 @@ static const uint32_t gen12_render_copy[][4] = {
> { 0x80040131, 0x00000004, 0x50007144, 0x00c40000 }, };
>
> +
> +/*
> + * Gen >= 12 onwards don't have a setting for PTE,
> + * so using I915_MOCS_PTE as mocs index may leads to
s/leads/lead/g
> + * some undefined MOCS behavior.
> + * Correct MOCS index should be referred from BSPCES
s/BSPCES/BSpec/g
> + * and programmed accordingly.
> + * This helper function is providing appropraite UC index.
s/ appropraite/appropriate/g
With these minor typos in comment sections, this is
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
> + */
> +static uint8_t
> +intel_get_uc_mocs(int fd) {
> +
> + uint16_t devid = intel_get_drm_devid(fd);
> + uint8_t uc_index;
> +
> + if (IS_DG1(devid))
> + uc_index = 1;
> + else if (IS_GEN12(devid))
> + uc_index = 3;
> + else
> + uc_index = I915_MOCS_PTE;
> +
> + /*
> + * BitField [6:1] represents index to MOCS Tables
> + * BitField [0] represents Encryption/Decryption
> + */
> + return uc_index << 1;
> +}
> +
> /* Mostly copy+paste from gen6, except height, width, pitch moved */ static
> uint32_t gen8_bind_buf(struct intel_bb *ibb, const struct intel_buf *buf, int
> is_dst) {
> struct gen9_surface_state *ss;
> uint32_t write_domain, read_domain;
> uint64_t address;
> + int i915 = buf_ops_get_fd(buf->bops);
>
> igt_assert_lte(buf->surface[0].stride, 256*1024);
> igt_assert_lte(intel_buf_width(buf), 16384); @@ -151,7 +182,7 @@
> gen8_bind_buf(struct intel_bb *ibb, const struct intel_buf *buf, int is_dst) {
> else if (buf->tiling != I915_TILING_NONE)
> ss->ss0.tiled_mode = 3;
>
> - ss->ss1.memory_object_control = I915_MOCS_PTE << 1;
> + ss->ss1.memory_object_control = intel_get_uc_mocs(i915);
>
> if (buf->tiling == I915_TILING_Yf)
> ss->ss5.trmode = 1;
> --
> 2.26.2
next prev parent reply other threads:[~2021-08-06 11:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-03 11:09 [igt-dev] [PATCH i-g-t 0/1] lib/rendercopy_gen9: Program platform specific MOCS index Ayaz A Siddiqui
2021-08-03 11:09 ` [igt-dev] [PATCH i-g-t 1/1] lib/rendercopy_gen9: Program MOCS value based on platform Ayaz A Siddiqui
2021-08-06 11:12 ` Kahola, Mika [this message]
2021-08-03 11:59 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/rendercopy_gen9: Program platform specific MOCS index Patchwork
2021-08-03 23:53 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2021-08-16 16:56 ` [igt-dev] [PATCH i-g-t 0/1] " Ville Syrjälä
2021-08-16 17:25 ` Siddiqui, Ayaz A
2021-08-16 17:44 ` Ville Syrjälä
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=2f2adec22b834113ab24a23b45f6ff0a@intel.com \
--to=mika.kahola@intel.com \
--cc=ayaz.siddiqui@intel.com \
--cc=igt-dev@lists.freedesktop.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox