-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drm/i915/guc/slpc: Initial definitions for SLPC
Add macros to check for SLPC support. This feature is currently supported for Gen12+ and enabled whenever GuC submission is enabled/selected. Include templates for SLPC init/fini and enable. v2: Move SLPC helper functions to intel_guc_slpc.c/.h. Define basic template for SLPC structure in intel_guc_slpc_types.h. Fix copyright (Michal W) v3: Review comments (Michal W) v4: Include supported/selected inside slpc struct (Michal W) Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com> Signed-off-by: Sundaresan Sujaritha <sujaritha.sundaresan@intel.com> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210730202119.23810-2-vinay.belgaumkar@intel.com
- Loading branch information
Vinay Belgaumkar
authored and
John Harrison
committed
Aug 3, 2021
1 parent
3989de0
commit dff0fc4
Showing
8 changed files
with
105 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// SPDX-License-Identifier: MIT | ||
/* | ||
* Copyright © 2021 Intel Corporation | ||
*/ | ||
|
||
#include "i915_drv.h" | ||
#include "intel_guc_slpc.h" | ||
#include "gt/intel_gt.h" | ||
|
||
static inline struct intel_guc *slpc_to_guc(struct intel_guc_slpc *slpc) | ||
{ | ||
return container_of(slpc, struct intel_guc, slpc); | ||
} | ||
|
||
static bool __detect_slpc_supported(struct intel_guc *guc) | ||
{ | ||
/* GuC SLPC is unavailable for pre-Gen12 */ | ||
return guc->submission_supported && | ||
GRAPHICS_VER(guc_to_gt(guc)->i915) >= 12; | ||
} | ||
|
||
static bool __guc_slpc_selected(struct intel_guc *guc) | ||
{ | ||
if (!intel_guc_slpc_is_supported(guc)) | ||
return false; | ||
|
||
return guc->submission_selected; | ||
} | ||
|
||
void intel_guc_slpc_init_early(struct intel_guc_slpc *slpc) | ||
{ | ||
struct intel_guc *guc = slpc_to_guc(slpc); | ||
|
||
slpc->supported = __detect_slpc_supported(guc); | ||
slpc->selected = __guc_slpc_selected(guc); | ||
} | ||
|
||
int intel_guc_slpc_init(struct intel_guc_slpc *slpc) | ||
{ | ||
return 0; | ||
} | ||
|
||
void intel_guc_slpc_fini(struct intel_guc_slpc *slpc) | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* SPDX-License-Identifier: MIT */ | ||
/* | ||
* Copyright © 2021 Intel Corporation | ||
*/ | ||
|
||
#ifndef _INTEL_GUC_SLPC_H_ | ||
#define _INTEL_GUC_SLPC_H_ | ||
|
||
#include "intel_guc_submission.h" | ||
#include "intel_guc_slpc_types.h" | ||
|
||
static inline bool intel_guc_slpc_is_supported(struct intel_guc *guc) | ||
{ | ||
return guc->slpc.supported; | ||
} | ||
|
||
static inline bool intel_guc_slpc_is_wanted(struct intel_guc *guc) | ||
{ | ||
return guc->slpc.selected; | ||
} | ||
|
||
static inline bool intel_guc_slpc_is_used(struct intel_guc *guc) | ||
{ | ||
return intel_guc_submission_is_used(guc) && intel_guc_slpc_is_wanted(guc); | ||
} | ||
|
||
void intel_guc_slpc_init_early(struct intel_guc_slpc *slpc); | ||
|
||
int intel_guc_slpc_init(struct intel_guc_slpc *slpc); | ||
int intel_guc_slpc_enable(struct intel_guc_slpc *slpc); | ||
void intel_guc_slpc_fini(struct intel_guc_slpc *slpc); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* SPDX-License-Identifier: MIT */ | ||
/* | ||
* Copyright © 2021 Intel Corporation | ||
*/ | ||
|
||
#ifndef _INTEL_GUC_SLPC_TYPES_H_ | ||
#define _INTEL_GUC_SLPC_TYPES_H_ | ||
|
||
#include <linux/types.h> | ||
|
||
struct intel_guc_slpc { | ||
bool supported; | ||
bool selected; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters