* [Intel-gfx] [PATCH] drm/i915: Remove memory frequency calculation
@ 2021-10-13 0:24 José Roberto de Souza
2021-10-13 0:44 ` Matt Roper
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: José Roberto de Souza @ 2021-10-13 0:24 UTC (permalink / raw)
To: intel-gfx; +Cc: Yakui Zhao, Matt Roper, José Roberto de Souza
This memory frequency calculated is only used to check if it is zero,
what is not useful as it will never actually be zero.
Also the calculation is wrong, we should be checking other bit to
select the appropriate frequency multiplier while this code is stuck
with a fixed multiplier.
So here dropping it as whole.
Cc: Yakui Zhao <yakui.zhao@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Fixes: f8112cb9574b ("drm/i915/gen11+: Only load DRAM information from pcode")
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
drivers/gpu/drm/i915/i915_reg.h | 2 --
drivers/gpu/drm/i915/intel_dram.c | 12 ------------
2 files changed, 14 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index a897f4abea0c3..03b6c505249dc 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -11145,9 +11145,7 @@ enum skl_power_gate {
#define BXT_DRAM_TYPE_LPDDR4 (0x2 << 22)
#define BXT_DRAM_TYPE_DDR4 (0x4 << 22)
-#define SKL_MEMORY_FREQ_MULTIPLIER_HZ 266666666
#define SKL_MC_BIOS_DATA_0_0_0_MCHBAR_PCU _MMIO(MCHBAR_MIRROR_BASE_SNB + 0x5E04)
-#define SKL_REQ_DATA_MASK (0xF << 0)
#define DG1_GEAR_TYPE REG_BIT(16)
#define SKL_MAD_INTER_CHANNEL_0_0_0_MCHBAR_MCMAIN _MMIO(MCHBAR_MIRROR_BASE_SNB + 0x5000)
diff --git a/drivers/gpu/drm/i915/intel_dram.c b/drivers/gpu/drm/i915/intel_dram.c
index 30a0cab5eff46..31933b1e7277b 100644
--- a/drivers/gpu/drm/i915/intel_dram.c
+++ b/drivers/gpu/drm/i915/intel_dram.c
@@ -244,7 +244,6 @@ static int
skl_get_dram_info(struct drm_i915_private *i915)
{
struct dram_info *dram_info = &i915->dram_info;
- u32 mem_freq_khz, val;
int ret;
dram_info->type = skl_get_dram_type(i915);
@@ -255,17 +254,6 @@ skl_get_dram_info(struct drm_i915_private *i915)
if (ret)
return ret;
- val = intel_uncore_read(&i915->uncore,
- SKL_MC_BIOS_DATA_0_0_0_MCHBAR_PCU);
- mem_freq_khz = DIV_ROUND_UP((val & SKL_REQ_DATA_MASK) *
- SKL_MEMORY_FREQ_MULTIPLIER_HZ, 1000);
-
- if (dram_info->num_channels * mem_freq_khz == 0) {
- drm_info(&i915->drm,
- "Couldn't get system memory bandwidth\n");
- return -EINVAL;
- }
-
return 0;
}
--
2.33.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915: Remove memory frequency calculation
2021-10-13 0:24 [Intel-gfx] [PATCH] drm/i915: Remove memory frequency calculation José Roberto de Souza
@ 2021-10-13 0:44 ` Matt Roper
2021-10-13 0:45 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2021-10-13 1:15 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2 siblings, 0 replies; 4+ messages in thread
From: Matt Roper @ 2021-10-13 0:44 UTC (permalink / raw)
To: José Roberto de Souza; +Cc: intel-gfx, Yakui Zhao
On Tue, Oct 12, 2021 at 05:24:55PM -0700, José Roberto de Souza wrote:
> This memory frequency calculated is only used to check if it is zero,
> what is not useful as it will never actually be zero.
>
> Also the calculation is wrong, we should be checking other bit to
> select the appropriate frequency multiplier while this code is stuck
> with a fixed multiplier.
>
> So here dropping it as whole.
I think we can do similar cleanup in bxt_get_dram_info() too. The value
of BXT_P_CR_MC_BIOS_REQ_0_0_0 that we read is used to obtain
mem_freq_khz and dram_channels/num_active_channels, but none of those
variables are ever used for anything except a needless zero-check.
Matt
> Cc: Yakui Zhao <yakui.zhao@intel.com>
> Cc: Matt Roper <matthew.d.roper@intel.com>
> Fixes: f8112cb9574b ("drm/i915/gen11+: Only load DRAM information from pcode")
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> ---
> drivers/gpu/drm/i915/i915_reg.h | 2 --
> drivers/gpu/drm/i915/intel_dram.c | 12 ------------
> 2 files changed, 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index a897f4abea0c3..03b6c505249dc 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -11145,9 +11145,7 @@ enum skl_power_gate {
> #define BXT_DRAM_TYPE_LPDDR4 (0x2 << 22)
> #define BXT_DRAM_TYPE_DDR4 (0x4 << 22)
>
> -#define SKL_MEMORY_FREQ_MULTIPLIER_HZ 266666666
> #define SKL_MC_BIOS_DATA_0_0_0_MCHBAR_PCU _MMIO(MCHBAR_MIRROR_BASE_SNB + 0x5E04)
> -#define SKL_REQ_DATA_MASK (0xF << 0)
> #define DG1_GEAR_TYPE REG_BIT(16)
>
> #define SKL_MAD_INTER_CHANNEL_0_0_0_MCHBAR_MCMAIN _MMIO(MCHBAR_MIRROR_BASE_SNB + 0x5000)
> diff --git a/drivers/gpu/drm/i915/intel_dram.c b/drivers/gpu/drm/i915/intel_dram.c
> index 30a0cab5eff46..31933b1e7277b 100644
> --- a/drivers/gpu/drm/i915/intel_dram.c
> +++ b/drivers/gpu/drm/i915/intel_dram.c
> @@ -244,7 +244,6 @@ static int
> skl_get_dram_info(struct drm_i915_private *i915)
> {
> struct dram_info *dram_info = &i915->dram_info;
> - u32 mem_freq_khz, val;
> int ret;
>
> dram_info->type = skl_get_dram_type(i915);
> @@ -255,17 +254,6 @@ skl_get_dram_info(struct drm_i915_private *i915)
> if (ret)
> return ret;
>
> - val = intel_uncore_read(&i915->uncore,
> - SKL_MC_BIOS_DATA_0_0_0_MCHBAR_PCU);
> - mem_freq_khz = DIV_ROUND_UP((val & SKL_REQ_DATA_MASK) *
> - SKL_MEMORY_FREQ_MULTIPLIER_HZ, 1000);
> -
> - if (dram_info->num_channels * mem_freq_khz == 0) {
> - drm_info(&i915->drm,
> - "Couldn't get system memory bandwidth\n");
> - return -EINVAL;
> - }
> -
> return 0;
> }
>
> --
> 2.33.0
>
--
Matt Roper
Graphics Software Engineer
VTT-OSGC Platform Enablement
Intel Corporation
(916) 356-2795
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Remove memory frequency calculation
2021-10-13 0:24 [Intel-gfx] [PATCH] drm/i915: Remove memory frequency calculation José Roberto de Souza
2021-10-13 0:44 ` Matt Roper
@ 2021-10-13 0:45 ` Patchwork
2021-10-13 1:15 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2021-10-13 0:45 UTC (permalink / raw)
To: José Roberto de Souza; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: Remove memory frequency calculation
URL : https://patchwork.freedesktop.org/series/95748/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip
2fbf85e7741f drm/i915: Remove memory frequency calculation
-:19: WARNING:UNKNOWN_COMMIT_ID: Unknown commit id 'f8112cb9574b', maybe rebased or not pulled?
#19:
Fixes: f8112cb9574b ("drm/i915/gen11+: Only load DRAM information from pcode")
total: 0 errors, 1 warnings, 0 checks, 33 lines checked
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Remove memory frequency calculation
2021-10-13 0:24 [Intel-gfx] [PATCH] drm/i915: Remove memory frequency calculation José Roberto de Souza
2021-10-13 0:44 ` Matt Roper
2021-10-13 0:45 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
@ 2021-10-13 1:15 ` Patchwork
2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2021-10-13 1:15 UTC (permalink / raw)
To: Souza, Jose; +Cc: intel-gfx
[-- Attachment #1: Type: text/plain, Size: 4617 bytes --]
== Series Details ==
Series: drm/i915: Remove memory frequency calculation
URL : https://patchwork.freedesktop.org/series/95748/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_10728 -> Patchwork_21323
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21323/index.html
Known issues
------------
Here are the changes found in Patchwork_21323 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_selftest@live@execlists:
- fi-bsw-nick: [PASS][1] -> [INCOMPLETE][2] ([i915#2940])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10728/fi-bsw-nick/igt@i915_selftest@live@execlists.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21323/fi-bsw-nick/igt@i915_selftest@live@execlists.html
* igt@kms_flip@basic-plain-flip@c-dp1:
- fi-cfl-8109u: [PASS][3] -> [FAIL][4] ([i915#4165])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10728/fi-cfl-8109u/igt@kms_flip@basic-plain-flip@c-dp1.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21323/fi-cfl-8109u/igt@kms_flip@basic-plain-flip@c-dp1.html
* igt@kms_frontbuffer_tracking@basic:
- fi-cml-u2: [PASS][5] -> [DMESG-WARN][6] ([i915#4269])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10728/fi-cml-u2/igt@kms_frontbuffer_tracking@basic.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21323/fi-cml-u2/igt@kms_frontbuffer_tracking@basic.html
* igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-b:
- fi-cfl-8109u: [PASS][7] -> [DMESG-WARN][8] ([i915#295]) +14 similar issues
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10728/fi-cfl-8109u/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-b.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21323/fi-cfl-8109u/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-b.html
* igt@runner@aborted:
- fi-bsw-nick: NOTRUN -> [FAIL][9] ([fdo#109271] / [i915#1436] / [i915#3428])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21323/fi-bsw-nick/igt@runner@aborted.html
#### Possible fixes ####
* igt@i915_selftest@live@hangcheck:
- {fi-hsw-gt1}: [DMESG-WARN][10] ([i915#3303]) -> [PASS][11]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10728/fi-hsw-gt1/igt@i915_selftest@live@hangcheck.html
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21323/fi-hsw-gt1/igt@i915_selftest@live@hangcheck.html
* igt@i915_selftest@live@perf:
- {fi-tgl-dsi}: [DMESG-WARN][12] ([i915#2867]) -> [PASS][13] +9 similar issues
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10728/fi-tgl-dsi/igt@i915_selftest@live@perf.html
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21323/fi-tgl-dsi/igt@i915_selftest@live@perf.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#2722]: https://gitlab.freedesktop.org/drm/intel/issues/2722
[i915#2867]: https://gitlab.freedesktop.org/drm/intel/issues/2867
[i915#2940]: https://gitlab.freedesktop.org/drm/intel/issues/2940
[i915#295]: https://gitlab.freedesktop.org/drm/intel/issues/295
[i915#3057]: https://gitlab.freedesktop.org/drm/intel/issues/3057
[i915#3303]: https://gitlab.freedesktop.org/drm/intel/issues/3303
[i915#3428]: https://gitlab.freedesktop.org/drm/intel/issues/3428
[i915#3970]: https://gitlab.freedesktop.org/drm/intel/issues/3970
[i915#4165]: https://gitlab.freedesktop.org/drm/intel/issues/4165
[i915#4269]: https://gitlab.freedesktop.org/drm/intel/issues/4269
Participating hosts (41 -> 37)
------------------------------
Missing (4): fi-ctg-p8600 fi-ilk-m540 fi-bsw-cyan fi-hsw-4200u
Build changes
-------------
* Linux: CI_DRM_10728 -> Patchwork_21323
CI-20190529: 20190529
CI_DRM_10728: 82a9f298afec66c882e710078138891826ce5e22 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6242: 721fd85ee95225ed5df322f7182bdfa9b86a3e68 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_21323: 2fbf85e7741f5f7b83caa5c6314900be1c303d04 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
2fbf85e7741f drm/i915: Remove memory frequency calculation
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21323/index.html
[-- Attachment #2: Type: text/html, Size: 5189 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-10-13 1:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13 0:24 [Intel-gfx] [PATCH] drm/i915: Remove memory frequency calculation José Roberto de Souza
2021-10-13 0:44 ` Matt Roper
2021-10-13 0:45 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2021-10-13 1:15 ` [Intel-gfx] ✓ Fi.CI.BAT: success " 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.