From: "K V P, Satyanarayana" <satyanarayana.k.v.p@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>,
<intel-xe@lists.freedesktop.org>
Cc: Matthew Brost <matthew.brost@intel.com>
Subject: Re: [PATCH 5/5] drm/xe/bo: Add xe_bo_has_valid_ccs_bb helper
Date: Fri, 5 Sep 2025 13:12:23 +0530 [thread overview]
Message-ID: <7cb6f98b-dd51-4036-9fba-488415d9284d@intel.com> (raw)
In-Reply-To: <20250904192918.7346-6-michal.wajdeczko@intel.com>
On 05-09-2025 00:59, Michal Wajdeczko wrote:
> This will allow as to drop ugly IS_VF_CCS_BB_VALID macro.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
> Cc: Matthew Brost <matthew.brost@intel.com>
> ---
> drivers/gpu/drm/xe/xe_bo.h | 15 +++++++++++++++
> drivers/gpu/drm/xe/xe_sriov_vf_ccs.c | 2 +-
> drivers/gpu/drm/xe/xe_sriov_vf_ccs_types.h | 8 --------
> 3 files changed, 16 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_bo.h b/drivers/gpu/drm/xe/xe_bo.h
> index 8cce413b5235..5e666fc2d00b 100644
> --- a/drivers/gpu/drm/xe/xe_bo.h
> +++ b/drivers/gpu/drm/xe/xe_bo.h
> @@ -315,6 +315,21 @@ static inline size_t xe_bo_ccs_pages_start(struct xe_bo *bo)
> return PAGE_ALIGN(xe_bo_size(bo));
> }
>
> +/**
> + * xe_bo_has_valid_ccs_bb - Check if CCS's BBs were setup for the BO.
> + * @bo: the &xe_bo to check
> + *
> + * The CCS's BBs should only be setup by the driver VF, but it is safe
> + * to call this function also by non-VF driver.
> + *
> + * Return: true iff the CCS's BBs are setup, false otherwise.
> + */
> +static inline bool xe_bo_has_valid_ccs_bb(struct xe_bo *bo)
> +{
> + return bo->bb_ccs[XE_SRIOV_VF_CCS_READ_CTX] &&
> + bo->bb_ccs[XE_SRIOV_VF_CCS_WRITE_CTX];
> +}
> +
> static inline bool xe_bo_has_pages(struct xe_bo *bo)
> {
> if ((bo->ttm.ttm && ttm_tt_is_populated(bo->ttm.ttm)) ||
> diff --git a/drivers/gpu/drm/xe/xe_sriov_vf_ccs.c b/drivers/gpu/drm/xe/xe_sriov_vf_ccs.c
> index 30aea958a337..eb8436e44ca4 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_vf_ccs.c
> +++ b/drivers/gpu/drm/xe/xe_sriov_vf_ccs.c
> @@ -363,7 +363,7 @@ int xe_sriov_vf_ccs_detach_bo(struct xe_bo *bo)
>
> xe_assert(xe, IS_VF_CCS_READY(xe));
>
> - if (!IS_VF_CCS_BB_VALID(xe, bo))
> + if (!xe_bo_has_valid_ccs_bb(bo))
> return 0;
>
> for_each_ccs_rw_ctx(ctx_id) {
> diff --git a/drivers/gpu/drm/xe/xe_sriov_vf_ccs_types.h b/drivers/gpu/drm/xe/xe_sriov_vf_ccs_types.h
> index 79092e386c4a..4d3c10907135 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_vf_ccs_types.h
> +++ b/drivers/gpu/drm/xe/xe_sriov_vf_ccs_types.h
> @@ -15,14 +15,6 @@ enum xe_sriov_vf_ccs_rw_ctxs {
> XE_SRIOV_VF_CCS_CTX_COUNT
> };
>
> -#define IS_VF_CCS_BB_VALID(xe, bo) ({ \
> - struct xe_device *___xe = (xe); \
> - struct xe_bo *___bo = (bo); \
> - IS_SRIOV_VF(___xe) && \
> - ___bo->bb_ccs[XE_SRIOV_VF_CCS_READ_CTX] && \
> - ___bo->bb_ccs[XE_SRIOV_VF_CCS_WRITE_CTX]; \
> - })
> -
> struct xe_migrate;
> struct xe_sa_manager;
>
LGTM.
Reviewed-by: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
next prev parent reply other threads:[~2025-09-05 7:42 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-04 19:29 [PATCH 0/5] Small improvements around VF CCS Michal Wajdeczko
2025-09-04 19:29 ` [PATCH 1/5] drm/xe/guc: Rename xe_guc_register_exec_queue Michal Wajdeczko
2025-09-05 7:05 ` K V P, Satyanarayana
2025-09-04 19:29 ` [PATCH 2/5] drm/xe/guc: Use proper flag definitions when registering context Michal Wajdeczko
2025-09-04 19:36 ` Matthew Brost
2025-09-04 19:29 ` [PATCH 3/5] drm/xe/vf: Drop IS_VF_CCS_INIT_NEEDED macro Michal Wajdeczko
2025-09-05 3:27 ` Matthew Brost
2025-09-05 7:18 ` K V P, Satyanarayana
2025-09-04 19:29 ` [PATCH 4/5] drm/xe/vf: Use single check when calling VF CCS functions Michal Wajdeczko
2025-09-05 7:40 ` K V P, Satyanarayana
2025-09-04 19:29 ` [PATCH 5/5] drm/xe/bo: Add xe_bo_has_valid_ccs_bb helper Michal Wajdeczko
2025-09-04 20:31 ` Matthew Brost
2025-09-05 7:42 ` K V P, Satyanarayana [this message]
2025-09-04 19:36 ` ✓ CI.KUnit: success for Small improvements around VF CCS Patchwork
2025-09-04 20:19 ` ✓ Xe.CI.BAT: " Patchwork
2025-09-05 11:55 ` ✗ Xe.CI.Full: failure " Patchwork
2025-09-05 12:34 ` Michal Wajdeczko
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=7cb6f98b-dd51-4036-9fba-488415d9284d@intel.com \
--to=satyanarayana.k.v.p@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@intel.com \
--cc=michal.wajdeczko@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox