Re: [PATCH v10 0/4] drm/panfrost: Add support for mt8183 GPU

2021-01-12 Thread Tomeu Vizoso

On 1/13/21 7:06 AM, Nicolas Boichat wrote:

Hi!

Follow-up on the v5 [1], things have gotten significantly
better in the last 9 months, thanks to the efforts on Bifrost
support by the Collabora team (and probably others I'm not
aware of).

I've been testing this series on a MT8183/kukui device, with a
chromeos-5.10 kernel [2], and got basic Chromium OS UI up with
mesa 20.3.2 (lots of artifacts though).


Btw, don't know if you plan to retest with a newer Mesa, but a recent 
master should have pretty good ES 3.0 compliance on the Duet.


Cheers,

Tomeu


devfreq is currently not supported, as we'll need:
  - Clock core support for switching the GPU core clock (see 2/4).
  - Platform-specific handling of the 2-regulator (see 3/4).

Since the latter is easy to detect, patch 3/4 just disables
devfreq if the more than one regulator is specified in the
compatible matching table.

[1] 
https://patchwork.kernel.org/project/linux-mediatek/cover/20200306041345.259332-1-drink...@chromium.org/
[2] https://crrev.com/c/2608070

Changes in v10:
  - Fix the binding to make sure sram-supply property can be provided.

Changes in v9:
  - Explain why devfreq needs to be disabled for GPUs with >1
regulators.

Changes in v8:
  - Use DRM_DEV_INFO instead of ERROR

Changes in v7:
  - Fix GPU ID in commit message
  - Fix GPU ID in commit message

Changes in v6:
  - Rebased, actually tested with recent mesa driver.

Nicolas Boichat (4):
   dt-bindings: gpu: mali-bifrost: Add Mediatek MT8183
   arm64: dts: mt8183: Add node for the Mali GPU
   drm/panfrost: devfreq: Disable devfreq when num_supplies > 1
   drm/panfrost: Add mt8183-mali compatible string

  .../bindings/gpu/arm,mali-bifrost.yaml|  28 +
  arch/arm64/boot/dts/mediatek/mt8183-evb.dts   |   6 +
  .../arm64/boot/dts/mediatek/mt8183-kukui.dtsi |   6 +
  arch/arm64/boot/dts/mediatek/mt8183.dtsi  | 105 ++
  drivers/gpu/drm/panfrost/panfrost_devfreq.c   |   9 ++
  drivers/gpu/drm/panfrost/panfrost_drv.c   |  10 ++
  6 files changed, 164 insertions(+)


___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v10 4/4] drm/panfrost: Add mt8183-mali compatible string

2021-01-12 Thread Nicolas Boichat
Add support for MT8183's G72 Bifrost.

Signed-off-by: Nicolas Boichat 
Reviewed-by: Tomeu Vizoso 
---

(no changes since v7)

Changes in v7:
 - Fix GPU ID in commit message

Changes in v6:
 - Context conflicts, reflow the code.
 - Use ARRAY_SIZE for power domains too.

Changes in v5:
 - Change power domain name from 2d to core2.

Changes in v4:
 - Add power domain names.

Changes in v3:
 - Match mt8183-mali instead of bifrost, as we require special
   handling for the 2 regulators and 3 power domains.

 drivers/gpu/drm/panfrost/panfrost_drv.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c 
b/drivers/gpu/drm/panfrost/panfrost_drv.c
index 83a461bdeea8..ca07098a6141 100644
--- a/drivers/gpu/drm/panfrost/panfrost_drv.c
+++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
@@ -665,6 +665,15 @@ static const struct panfrost_compatible amlogic_data = {
.vendor_quirk = panfrost_gpu_amlogic_quirk,
 };
 
+const char * const mediatek_mt8183_supplies[] = { "mali", "sram" };
+const char * const mediatek_mt8183_pm_domains[] = { "core0", "core1", "core2" 
};
+static const struct panfrost_compatible mediatek_mt8183_data = {
+   .num_supplies = ARRAY_SIZE(mediatek_mt8183_supplies),
+   .supply_names = mediatek_mt8183_supplies,
+   .num_pm_domains = ARRAY_SIZE(mediatek_mt8183_pm_domains),
+   .pm_domain_names = mediatek_mt8183_pm_domains,
+};
+
 static const struct of_device_id dt_match[] = {
/* Set first to probe before the generic compatibles */
{ .compatible = "amlogic,meson-gxm-mali",
@@ -681,6 +690,7 @@ static const struct of_device_id dt_match[] = {
{ .compatible = "arm,mali-t860", .data = _data, },
{ .compatible = "arm,mali-t880", .data = _data, },
{ .compatible = "arm,mali-bifrost", .data = _data, },
+   { .compatible = "mediatek,mt8183-mali", .data = _mt8183_data },
{}
 };
 MODULE_DEVICE_TABLE(of, dt_match);
-- 
2.30.0.284.gd98b1dd5eaa7-goog

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v10 3/4] drm/panfrost: devfreq: Disable devfreq when num_supplies > 1

2021-01-12 Thread Nicolas Boichat
GPUs with more than a single regulator (e.g. G72 on MT8183) will
require platform-specific handling for devfreq, for 2 reasons:
 1. The opp core (drivers/opp/core.c:_generic_set_opp_regulator)
does not support multiple regulators, so we'll need custom
handlers.
 2. Generally, platforms with 2 regulators have platform-specific
constraints on how the voltages should be set (e.g.
minimum/maximum voltage difference between them), so we
should not just create generic handlers that simply
change the voltages without taking care of those constraints.

Disable devfreq for now on those GPUs.

Signed-off-by: Nicolas Boichat 
Reviewed-by: Tomeu Vizoso 
---

(no changes since v9)

Changes in v9:
 - Explain why devfreq needs to be disabled for GPUs with >1
   regulators.

Changes in v8:
 - Use DRM_DEV_INFO instead of ERROR

Changes in v7:
 - Fix GPU ID in commit message

Changes in v6:
 - New change

 drivers/gpu/drm/panfrost/panfrost_devfreq.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c 
b/drivers/gpu/drm/panfrost/panfrost_devfreq.c
index f44d28fad085..812cfecdee3b 100644
--- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c
+++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c
@@ -92,6 +92,15 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev)
struct thermal_cooling_device *cooling;
struct panfrost_devfreq *pfdevfreq = >pfdevfreq;
 
+   if (pfdev->comp->num_supplies > 1) {
+   /*
+* GPUs with more than 1 supply require platform-specific 
handling:
+* continue without devfreq
+*/
+   DRM_DEV_INFO(dev, "More than 1 supply is not supported yet\n");
+   return 0;
+   }
+
opp_table = dev_pm_opp_set_regulators(dev, pfdev->comp->supply_names,
  pfdev->comp->num_supplies);
if (IS_ERR(opp_table)) {
-- 
2.30.0.284.gd98b1dd5eaa7-goog

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v10 1/4] dt-bindings: gpu: mali-bifrost: Add Mediatek MT8183

2021-01-12 Thread Nicolas Boichat
Define a compatible string for the Mali Bifrost GPU found in
Mediatek's MT8183 SoCs.

Signed-off-by: Nicolas Boichat 
---

Changes in v10:
 - Fix the binding to make sure sram-supply property can be provided.

Changes in v6:
 - Rebased, actually tested with recent mesa driver.
 - No change

Changes in v5:
 - Rename "2d" power domain to "core2"

Changes in v4:
 - Add power-domain-names description
   (kept Alyssa's reviewed-by as the change is minor)

Changes in v3:
 - No change

 .../bindings/gpu/arm,mali-bifrost.yaml| 28 +++
 1 file changed, 28 insertions(+)

diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml 
b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
index 184492162e7e..eac561582063 100644
--- a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
+++ b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
@@ -17,6 +17,7 @@ properties:
 items:
   - enum:
   - amlogic,meson-g12a-mali
+  - mediatek,mt8183-mali
   - realtek,rtd1619-mali
   - rockchip,px30-mali
   - const: arm,mali-bifrost # Mali Bifrost GPU model/revision is fully 
discoverable
@@ -41,6 +42,8 @@ properties:
 
   mali-supply: true
 
+  sram-supply: true
+
   operating-points-v2: true
 
   power-domains:
@@ -87,6 +90,31 @@ allOf:
 then:
   required:
 - resets
+  - if:
+  properties:
+compatible:
+  contains:
+const: mediatek,mt8183-mali
+then:
+  properties:
+power-domains:
+  description:
+List of phandle and PM domain specifier as documented in
+Documentation/devicetree/bindings/power/power_domain.txt
+  minItems: 3
+  maxItems: 3
+power-domain-names:
+  items:
+- const: core0
+- const: core1
+- const: core2
+  required:
+- sram-supply
+- power-domains
+- power-domains-names
+else:
+  properties:
+sram-supply: false
 
 examples:
   - |
-- 
2.30.0.284.gd98b1dd5eaa7-goog

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v10 0/4] drm/panfrost: Add support for mt8183 GPU

2021-01-12 Thread Nicolas Boichat
Hi!

Follow-up on the v5 [1], things have gotten significantly
better in the last 9 months, thanks to the efforts on Bifrost
support by the Collabora team (and probably others I'm not
aware of).

I've been testing this series on a MT8183/kukui device, with a
chromeos-5.10 kernel [2], and got basic Chromium OS UI up with
mesa 20.3.2 (lots of artifacts though).

devfreq is currently not supported, as we'll need:
 - Clock core support for switching the GPU core clock (see 2/4).
 - Platform-specific handling of the 2-regulator (see 3/4).

Since the latter is easy to detect, patch 3/4 just disables
devfreq if the more than one regulator is specified in the
compatible matching table.

[1] 
https://patchwork.kernel.org/project/linux-mediatek/cover/20200306041345.259332-1-drink...@chromium.org/
[2] https://crrev.com/c/2608070

Changes in v10:
 - Fix the binding to make sure sram-supply property can be provided.

Changes in v9:
 - Explain why devfreq needs to be disabled for GPUs with >1
   regulators.

Changes in v8:
 - Use DRM_DEV_INFO instead of ERROR

Changes in v7:
 - Fix GPU ID in commit message
 - Fix GPU ID in commit message

Changes in v6:
 - Rebased, actually tested with recent mesa driver.

Nicolas Boichat (4):
  dt-bindings: gpu: mali-bifrost: Add Mediatek MT8183
  arm64: dts: mt8183: Add node for the Mali GPU
  drm/panfrost: devfreq: Disable devfreq when num_supplies > 1
  drm/panfrost: Add mt8183-mali compatible string

 .../bindings/gpu/arm,mali-bifrost.yaml|  28 +
 arch/arm64/boot/dts/mediatek/mt8183-evb.dts   |   6 +
 .../arm64/boot/dts/mediatek/mt8183-kukui.dtsi |   6 +
 arch/arm64/boot/dts/mediatek/mt8183.dtsi  | 105 ++
 drivers/gpu/drm/panfrost/panfrost_devfreq.c   |   9 ++
 drivers/gpu/drm/panfrost/panfrost_drv.c   |  10 ++
 6 files changed, 164 insertions(+)

-- 
2.30.0.284.gd98b1dd5eaa7-goog

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v9 1/4] dt-bindings: gpu: mali-bifrost: Add Mediatek MT8183

2021-01-12 Thread Nicolas Boichat
On Tue, Jan 12, 2021 at 11:07 PM Rob Herring  wrote:
>
> On Fri, Jan 08, 2021 at 09:10:08AM +0800, Nicolas Boichat wrote:
> > Define a compatible string for the Mali Bifrost GPU found in
> > Mediatek's MT8183 SoCs.
> >
> > Signed-off-by: Nicolas Boichat 
> > Reviewed-by: Alyssa Rosenzweig 
> > ---
> >
> > (no changes since v6)
> >
> > Changes in v6:
> >  - Rebased, actually tested with recent mesa driver.
> >  - No change
> >
> > Changes in v5:
> >  - Rename "2d" power domain to "core2"
> >
> > Changes in v4:
> >  - Add power-domain-names description
> >(kept Alyssa's reviewed-by as the change is minor)
> >
> > Changes in v3:
> >  - No change
> >
> >  .../bindings/gpu/arm,mali-bifrost.yaml| 25 +++
> >  1 file changed, 25 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml 
> > b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
> > index 184492162e7e..71b613ee5bd7 100644
> > --- a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
> > +++ b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
> > @@ -17,6 +17,7 @@ properties:
> >  items:
> >- enum:
> >- amlogic,meson-g12a-mali
> > +  - mediatek,mt8183-mali
> >- realtek,rtd1619-mali
> >- rockchip,px30-mali
> >- const: arm,mali-bifrost # Mali Bifrost GPU model/revision is fully 
> > discoverable
> > @@ -87,6 +88,30 @@ allOf:
> >  then:
> >required:
> >  - resets
> > +  - if:
> > +  properties:
> > +compatible:
> > +  contains:
> > +const: mediatek,mt8183-mali
> > +then:
> > +  properties:
> > +sram-supply: true
>
> This has to be defined at the top-level or there will be an error when
> it is present (due to additionalProperties).
>
> In this if/then you can do:
>
> else:
>   sram-supply: false
>
> to disallow it if not 'mediatek,mt8183-mali'

I see. Thanks Rob, will send a v10.



>
> > +power-domains:
> > +  description:
> > +List of phandle and PM domain specifier as documented in
> > +Documentation/devicetree/bindings/power/power_domain.txt
> > +  minItems: 3
> > +  maxItems: 3
> > +power-domain-names:
> > +  items:
> > +- const: core0
> > +- const: core1
> > +- const: core2
> > +
> > +  required:
> > +- sram-supply
> > +- power-domains
> > +- power-domains-names
> >
> >  examples:
> >- |
> > --
> > 2.29.2.729.g45daf8777d-goog
> >
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 2/2] drm/amdgpu/display: buffer INTERRUPT_LOW_IRQ_CONTEXT interrupt work

2021-01-12 Thread Andrey Grodzovsky


On 1/4/21 1:01 AM, Xiaogang.Chen wrote:

From: Xiaogang Chen 

amdgpu DM handles INTERRUPT_LOW_IRQ_CONTEXT interrupt(hpd, hpd_rx) by
using work queue and uses single work_struct. If previous interrupt
has not been handled new interrupts(same type) will be discarded and
driver just sends "amdgpu_dm_irq_schedule_work FAILED" message out.
If some important hpd, hpd_rx related interrupts are missed by driver
the hot (un)plug devices may cause system hang or unstable, such as
system resumes from S3 sleep with mst device connected.

This patch dynamically allocates new amdgpu_dm_irq_handler_data for
new interrupts if previous INTERRUPT_LOW_IRQ_CONTEXT interrupt work
has not been handled. So the new interrupt works can be queued to the
same workqueue_struct, instead discard the new interrupts.
All allocated amdgpu_dm_irq_handler_data are put into a single linked
list and will be reused after.



I believe this creates a possible concurrency between already executing work 
item
and the new incoming one for which you allocate a new work item on the fly. 
While
handle_hpd_irq is serialized with aconnector->hpd_lock I am seeing that for 
handle_hpd_rx_irq
it's not locked for MST use case (which is the most frequently used with this 
interrupt).  Did you

verified that handle_hpd_rx_irq is reentrant ?




Signed-off-by: Xiaogang Chen 
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h  |  14 +--
  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c  | 114 ++---
  2 files changed, 80 insertions(+), 48 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
index c9d82b9..730e540 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
@@ -69,18 +69,6 @@ struct common_irq_params {
  };
  
  /**

- * struct irq_list_head - Linked-list for low context IRQ handlers.
- *
- * @head: The list_head within  handler_data
- * @work: A work_struct containing the deferred handler work
- */
-struct irq_list_head {
-   struct list_head head;
-   /* In case this interrupt needs post-processing, 'work' will be queued*/
-   struct work_struct work;
-};
-
-/**
   * struct dm_compressor_info - Buffer info used by frame buffer compression
   * @cpu_addr: MMIO cpu addr
   * @bo_ptr: Pointer to the buffer object
@@ -270,7 +258,7 @@ struct amdgpu_display_manager {
 * Note that handlers are called in the same order as they were
 * registered (FIFO).
 */
-   struct irq_list_head irq_handler_list_low_tab[DAL_IRQ_SOURCES_NUMBER];
+   struct list_head irq_handler_list_low_tab[DAL_IRQ_SOURCES_NUMBER];
  
  	/**

 * @irq_handler_list_high_tab:
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c
index 3577785..ada344a 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c
@@ -82,6 +82,7 @@ struct amdgpu_dm_irq_handler_data {
struct amdgpu_display_manager *dm;
/* DAL irq source which registered for this interrupt. */
enum dc_irq_source irq_source;
+   struct work_struct work;
  };
  
  #define DM_IRQ_TABLE_LOCK(adev, flags) \

@@ -111,20 +112,10 @@ static void init_handler_common_data(struct 
amdgpu_dm_irq_handler_data *hcd,
   */
  static void dm_irq_work_func(struct work_struct *work)
  {
-   struct irq_list_head *irq_list_head =
-   container_of(work, struct irq_list_head, work);
-   struct list_head *handler_list = _list_head->head;
-   struct amdgpu_dm_irq_handler_data *handler_data;
-
-   list_for_each_entry(handler_data, handler_list, list) {
-   DRM_DEBUG_KMS("DM_IRQ: work_func: for dal_src=%d\n",
-   handler_data->irq_source);
+   struct amdgpu_dm_irq_handler_data *handler_data =
+container_of(work, struct amdgpu_dm_irq_handler_data, work);
  
-		DRM_DEBUG_KMS("DM_IRQ: schedule_work: for dal_src=%d\n",

-   handler_data->irq_source);
-
-   handler_data->handler(handler_data->handler_arg);
-   }
+   handler_data->handler(handler_data->handler_arg);
  
  	/* Call a DAL subcomponent which registered for interrupt notification

 * at INTERRUPT_LOW_IRQ_CONTEXT.
@@ -156,7 +147,7 @@ static struct list_head *remove_irq_handler(struct 
amdgpu_device *adev,
break;
case INTERRUPT_LOW_IRQ_CONTEXT:
default:
-   hnd_list = >dm.irq_handler_list_low_tab[irq_source].head;
+   hnd_list = >dm.irq_handler_list_low_tab[irq_source];
break;
}
  
@@ -287,7 +278,8 @@ void *amdgpu_dm_irq_register_interrupt(struct amdgpu_device *adev,

break;
case INTERRUPT_LOW_IRQ_CONTEXT:
default:
-   hnd_list = >dm.irq_handler_list_low_tab[irq_source].head;
+   

Re: r600/nir: enable soft-fp64 for evengreen class hardware - brake compilation of Mesa git

2021-01-12 Thread Dieter Nützel

Hello Gert,

new year, new luck,...;-)

mkdir build
cd build
meson ../ --strip --buildtype release -Ddri-drivers= -Dplatforms=x11 
-Dgallium-drivers=r600,radeonsi,swrast -Dvulkan-drivers=amd 
-Dgallium-nine=true -Dopencl-spirv=true -Dgallium-opencl=standalone 
-Dglvnd=true -Dgallium-va=enabled -Dgallium-xvmc=disabled 
-Dgallium-omx=disabled -Dgallium-xa=disabled



[1067/1508] Compiling C object 
src/gallium/auxiliary/libgallium.a.p/gallivm_lp_bld_format_s3tc.c.o
../src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c: In function 
‘lp_build_fetch_rgtc_rgba_aos’:
../src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c:2649:17: warning: 
‘green_hi’ may be used uninitialized in this function 
[-Wmaybe-uninitialized]
 2649 |  rgba = latc2_to_rgba_aos(gallivm, n, 
format_desc->format,
  | 
^~
 2650 |   red_lo, red_hi, green_lo, 
green_hi, i, j);
  |   
~
../src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c:2649:17: warning: 
‘green_lo’ may be used uninitialized in this function 
[-Wmaybe-uninitialized]
[1089/1508] Compiling C object 
src/gallium/auxiliary/libgallium.a.p/gallivm_lp_bld_nir.c.o

In file included from ../src/gallium/auxiliary/gallivm/lp_bld_nir.c:26:
../src/gallium/auxiliary/gallivm/lp_bld_nir.c: In function 
‘visit_cf_list.isra’:
../src/gallium/auxiliary/gallivm/lp_bld_nir.h:263:27: warning: ‘result’ 
may be used uninitialized in this function [-Wmaybe-uninitialized]
  263 |LLVMTypeRef arr_type = LLVMArrayType(LLVMTypeOf(values[0]), 
value_count);
  |   
^
../src/gallium/auxiliary/gallivm/lp_bld_nir.c:175:4: warning: ‘undef’ 
may be used uninitialized in this function [-Wmaybe-uninitialized]
  175 |assign_ssa(bld_base, ssa->index, ssa->num_components == 1 ? 
vals[0] : 
lp_nir_array_build_gather_values(bld_base->base.gallivm->builder, vals, 
ssa->num_components));
  |
^~~
[1254/1508] Compiling C++ object 
src/gallium/drivers/r600/libr600.a.p/sb_sb_sched.cpp.o
../src/gallium/drivers/r600/sb/sb_sched.cpp: In member function ‘void 
r600_sb::literal_tracker::reset()’:
../src/gallium/drivers/r600/sb/sb_sched.cpp:1953:26: warning: ‘void* 
memset(void*, int, size_t)’ clearing an object of non-trivial type 
‘struct r600_sb::literal’; use assignment or value-initialization 
instead [-Wclass-memaccess]

 1953 |  memset(lt, 0, sizeof(lt));
  |  ^
In file included from ../src/gallium/drivers/r600/sb/sb_sched.cpp:35:
../src/gallium/drivers/r600/sb/sb_bc.h:409:8: note: ‘struct 
r600_sb::literal’ declared here

  409 | struct literal {
  |^~~
[1260/1508] Compiling C object 
src/gallium/drivers/r600/libr600.a.p/r600_state_common.c.o
../src/gallium/drivers/r600/r600_state_common.c: In function 
‘r600_create_shader_state’:
../src/gallium/drivers/r600/r600_state_common.c:960:39: warning: ‘sel’ 
may be used uninitialized in this function [-Wmaybe-uninitialized]

  960 |   sel->lds_patch_outputs_written_mask = 0;
  |   ^~~
../src/gallium/drivers/r600/r600_state_common.c: In function 
‘r600_create_tes_state’:
../src/gallium/drivers/r600/r600_state_common.c:947:10: warning: ‘sel’ 
may be used uninitialized in this function [-Wmaybe-uninitialized]

  947 |  sel->so = state->stream_output;
  |  ^~
../src/gallium/drivers/r600/r600_state_common.c:937:36: note: ‘sel’ was 
declared here

  937 |  struct r600_pipe_shader_selector *sel;
  |^~~
../src/gallium/drivers/r600/r600_state_common.c: In function 
‘r600_create_ps_state’:
../src/gallium/drivers/r600/r600_state_common.c:947:10: warning: ‘sel’ 
may be used uninitialized in this function [-Wmaybe-uninitialized]

  947 |  sel->so = state->stream_output;
  |  ^~
../src/gallium/drivers/r600/r600_state_common.c:937:36: note: ‘sel’ was 
declared here

  937 |  struct r600_pipe_shader_selector *sel;
  |^~~
../src/gallium/drivers/r600/r600_state_common.c: In function 
‘r600_create_gs_state’:
../src/gallium/drivers/r600/r600_state_common.c:951:23: warning: ‘sel’ 
may be used uninitialized in this function [-Wmaybe-uninitialized]

  951 |   sel->gs_output_prim =
  |   ^
  952 |sel->info.properties[TGSI_PROPERTY_GS_OUTPUT_PRIM];
  |~~
../src/gallium/drivers/r600/r600_state_common.c:937:36: note: ‘sel’ was 
declared here

  937 |  struct r600_pipe_shader_selector *sel;
  |^~~
[1318/1508] Compiling C++ object 

Re: [PATCH] drm: amdgpu: pm: Mark vangogh_clk_dpm_is_enabled() as static

2021-01-12 Thread Huang Rui
On Wed, Jan 13, 2021 at 10:21:26AM +0800, Huang Rui wrote:
> On Wed, Jan 13, 2021 at 10:13:02AM +0800, Alex Deucher wrote:
> > On Tue, Jan 12, 2021 at 8:19 PM Huang Rui  wrote:
> > >
> > > On Wed, Jan 13, 2021 at 03:57:22AM +0800, Souptick Joarder wrote:
> > > > kernel test robot throws below warnings ->
> > > >
> > > > drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c:594:6:
> > > > warning: no previous prototype for 'vangogh_clk_dpm_is_enabled'
> > > > [-Wmissing-prototypes]
> > > > drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c:594:6:
> > > > warning: no previous prototype for function 'vangogh_clk_dpm_is_enabled'
> > > > [-Wmissing-prototypes]
> > > >
> > > > Mark vangogh_clk_dpm_is_enabled() as static.
> > > >
> > > > Reported-by: kernel test robot 
> > > > Signed-off-by: Souptick Joarder 
> > > > ---
> > > >  drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c 
> > > > b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> > > > index 75ddcad..3ffe56e 100644
> > > > --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> > > > +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> > > > @@ -610,7 +610,7 @@ static int vangogh_get_profiling_clk_mask(struct 
> > > > smu_context *smu,
> > > >   return 0;
> > > >  }
> > > >
> > > > -bool vangogh_clk_dpm_is_enabled(struct smu_context *smu,
> > > > +static bool vangogh_clk_dpm_is_enabled(struct smu_context *smu,
> > > >   enum smu_clk_type clk_type)
> > >
> > > Ah, I have another patch which will use this function in another file.
> > >
> > 
> > I can drop it if you plan to land those patches soon.
> 
> Thanks Alex. Yes, I will upload them after verify them on the new firmware
> today.

Sorry Alex, I miss read the function name as "cclk_dpm".
This patch is good, please go forward to apply it.

Reviewed-by: Huang Rui 

Thanks,
Ray

> 
> Thanks,
> Ray
> 
> > 
> > Alex
> > 
> > 
> > > Thanks,
> > > Ray
> > >
> > > >  {
> > > >   enum smu_feature_mask feature_id = 0;
> > > > --
> > > > 1.9.1
> > > >
> > > ___
> > > amd-gfx mailing list
> > > amd-...@lists.freedesktop.org
> > > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfxdata=04%7C01%7Cray.huang%40amd.com%7C19fce6891f2d4f6df7de08d8b768c8a9%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637461007972405505%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=v2JGTkklMHOE2hN1s4dYZ1hT7ctLeUHpwkpn1M3nyi8%3Dreserved=0
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 211161] list_del corruption in ttm_pool_shrink

2021-01-12 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=211161

--- Comment #3 from Benji Wiebe (benjiwieb...@gmail.com) ---
(In reply to Alex Deucher from comment #2)

> If it's the same issue, it's fixed with these patches:
> https://cgit.freedesktop.org/drm/drm-misc/commit/?h=drm-misc-
> fixes=e0658f970a7f3d85431c6803b7d5169444fb11b0
> https://cgit.freedesktop.org/drm/drm-misc/commit/?h=drm-misc-
> fixes=a73858ef4d5e1d425e171f0f6a52864176a6a979

OK, thanks. I've sometimes used the whole graphics stack built from source;
I'll do it again, using the latest drm, and see if that fixes it.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm: amdgpu: pm: Mark vangogh_clk_dpm_is_enabled() as static

2021-01-12 Thread Huang Rui
On Wed, Jan 13, 2021 at 10:13:02AM +0800, Alex Deucher wrote:
> On Tue, Jan 12, 2021 at 8:19 PM Huang Rui  wrote:
> >
> > On Wed, Jan 13, 2021 at 03:57:22AM +0800, Souptick Joarder wrote:
> > > kernel test robot throws below warnings ->
> > >
> > > drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c:594:6:
> > > warning: no previous prototype for 'vangogh_clk_dpm_is_enabled'
> > > [-Wmissing-prototypes]
> > > drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c:594:6:
> > > warning: no previous prototype for function 'vangogh_clk_dpm_is_enabled'
> > > [-Wmissing-prototypes]
> > >
> > > Mark vangogh_clk_dpm_is_enabled() as static.
> > >
> > > Reported-by: kernel test robot 
> > > Signed-off-by: Souptick Joarder 
> > > ---
> > >  drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c 
> > > b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> > > index 75ddcad..3ffe56e 100644
> > > --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> > > +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> > > @@ -610,7 +610,7 @@ static int vangogh_get_profiling_clk_mask(struct 
> > > smu_context *smu,
> > >   return 0;
> > >  }
> > >
> > > -bool vangogh_clk_dpm_is_enabled(struct smu_context *smu,
> > > +static bool vangogh_clk_dpm_is_enabled(struct smu_context *smu,
> > >   enum smu_clk_type clk_type)
> >
> > Ah, I have another patch which will use this function in another file.
> >
> 
> I can drop it if you plan to land those patches soon.

Thanks Alex. Yes, I will upload them after verify them on the new firmware
today.

Thanks,
Ray

> 
> Alex
> 
> 
> > Thanks,
> > Ray
> >
> > >  {
> > >   enum smu_feature_mask feature_id = 0;
> > > --
> > > 1.9.1
> > >
> > ___
> > amd-gfx mailing list
> > amd-...@lists.freedesktop.org
> > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfxdata=04%7C01%7Cray.huang%40amd.com%7C19fce6891f2d4f6df7de08d8b768c8a9%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637461007972405505%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=v2JGTkklMHOE2hN1s4dYZ1hT7ctLeUHpwkpn1M3nyi8%3Dreserved=0
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm: amdgpu: pm: Mark vangogh_clk_dpm_is_enabled() as static

2021-01-12 Thread Alex Deucher
On Tue, Jan 12, 2021 at 8:19 PM Huang Rui  wrote:
>
> On Wed, Jan 13, 2021 at 03:57:22AM +0800, Souptick Joarder wrote:
> > kernel test robot throws below warnings ->
> >
> > drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c:594:6:
> > warning: no previous prototype for 'vangogh_clk_dpm_is_enabled'
> > [-Wmissing-prototypes]
> > drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c:594:6:
> > warning: no previous prototype for function 'vangogh_clk_dpm_is_enabled'
> > [-Wmissing-prototypes]
> >
> > Mark vangogh_clk_dpm_is_enabled() as static.
> >
> > Reported-by: kernel test robot 
> > Signed-off-by: Souptick Joarder 
> > ---
> >  drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c 
> > b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> > index 75ddcad..3ffe56e 100644
> > --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> > +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> > @@ -610,7 +610,7 @@ static int vangogh_get_profiling_clk_mask(struct 
> > smu_context *smu,
> >   return 0;
> >  }
> >
> > -bool vangogh_clk_dpm_is_enabled(struct smu_context *smu,
> > +static bool vangogh_clk_dpm_is_enabled(struct smu_context *smu,
> >   enum smu_clk_type clk_type)
>
> Ah, I have another patch which will use this function in another file.
>

I can drop it if you plan to land those patches soon.

Alex


> Thanks,
> Ray
>
> >  {
> >   enum smu_feature_mask feature_id = 0;
> > --
> > 1.9.1
> >
> ___
> amd-gfx mailing list
> amd-...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 211161] list_del corruption in ttm_pool_shrink

2021-01-12 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=211161

Alex Deucher (alexdeuc...@gmail.com) changed:

   What|Removed |Added

 CC||alexdeuc...@gmail.com

--- Comment #2 from Alex Deucher (alexdeuc...@gmail.com) ---
(In reply to Benji Wiebe from comment #0)
> Created attachment 294611 [details]
> kernel BUG dmesg 1
> 
> I've been getting occasional graphics lockups, fixable only by reboot. I was
> hard rebooting until I realized I could ssh in to my desktop still, so here
> are two dmesg logs that I've captured. There's also a report of (I think)
> this same bug in the LKML: https://lkml.org/lkml/2020/12/31/47

If it's the same issue, it's fixed with these patches:
https://cgit.freedesktop.org/drm/drm-misc/commit/?h=drm-misc-fixes=e0658f970a7f3d85431c6803b7d5169444fb11b0
https://cgit.freedesktop.org/drm/drm-misc/commit/?h=drm-misc-fixes=a73858ef4d5e1d425e171f0f6a52864176a6a979

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 5.11 regression fix] drm/ttm: fix combining __GFP_HIGHMEM and __GFP_DMA32 flag for DMA32 pools

2021-01-12 Thread Huang Rui
On Wed, Jan 13, 2021 at 02:32:49AM +0800, Hans de Goede wrote:
> GFP_TRANSHUGE_LIGHT includes __GFP_HIGHMEM and combining
> __GFP_HIGHMEM with __GFP_DMA32 is not allowed.
> 
> So we must not set add GFP_TRANSHUGE_LIGHT to the gfp_flags when
> allocating pages from a dma32 pool.
> 
> This fixes the following oops when using a driver which uses DMA32
> pools such as the vboxvideo driver:
> 
> [  419.852194] [ cut here ]
> [  419.852200] kernel BUG at include/linux/gfp.h:457!
> [  419.852208] invalid opcode:  [#4] SMP PTI
> [  419.852212] CPU: 0 PID: 1522 Comm: Xorg Tainted: G  D   
> 5.11.0-rc2+ #187
> [  419.852214] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS 
> VirtualBox 12/01/2006
> [  419.852216] RIP: 0010:__alloc_pages_nodemask+0x31a/0x3d0
> [  419.85] Code: 00 00 8b 05 a8 3b 93 01 85 c0 0f 85 03 fe ff ff 89 e8 44 
> 89 fa c1 e8 03 80 ca 80 83 e0 03 83 f8 01 44 0f 44 fa e9 e9 fd ff ff <0f> 0b 
> 0f 0b e9 79 fd ff ff 31 c0 e9 88 fd ff ff e8 41 ad fb ff 48
> [  419.852224] RSP: :b1164096bc60 EFLAGS: 00010247
> [  419.852227] RAX:  RBX:  RCX: 
> e8e8
> [  419.852229] RDX:  RSI: 0006 RDI: 
> 00192dc6
> [  419.852230] RBP: 00192dc6 R08:  R09: 
> 
> [  419.852232] R10: 0017 R11: 7ff303d0a000 R12: 
> 0009
> [  419.852233] R13: 0009 R14: 8be4cafe0880 R15: 
> 8be5c26fe000
> [  419.852235] FS:  7ff3046e0f00() GS:8be5dbc0() 
> knlGS:
> [  419.852237] CS:  0010 DS:  ES:  CR0: 80050033
> [  419.852239] CR2: 7ff303d0a000 CR3: 0afd8004 CR4: 
> 000706f0
> [  419.852243] DR0:  DR1:  DR2: 
> 
> [  419.852244] DR3:  DR6: fffe0ff0 DR7: 
> 0400
> [  419.852246] Call Trace:
> [  419.852252]  ttm_pool_alloc+0x2e8/0x5f0 [ttm]
> [  419.852261]  ttm_tt_populate+0x9f/0xe0 [ttm]
> [  419.852267]  ttm_bo_vm_fault_reserved+0x236/0x6e0 [ttm]
> [  419.852274]  ttm_bo_vm_fault+0x4a/0xe0 [ttm]
> [  419.852279]  __do_fault+0x37/0x110
> [  419.852283]  handle_mm_fault+0x1493/0x1990
> [  419.852288]  do_user_addr_fault+0x1c7/0x4c0
> [  419.852292]  exc_page_fault+0x67/0x250
> [  419.852295]  ? asm_exc_page_fault+0x8/0x30
> [  419.852299]  asm_exc_page_fault+0x1e/0x30
> [  419.852301] RIP: 0033:0x7ff304f3cdf8
> [  419.852304] Code: 83 c0 04 83 fa 03 7e ea a8 0f 75 ee 83 fa 7f 7e e1 83 c2 
> 80 89 d6 c1 ee 07 8d 4e 01 48 c1 e1 07 48 01 c1 0f 1f 80 00 00 00 00 <0f> 29 
> 00 48 83 e8 80 0f 29 40 90 0f 29 40 a0 0f 29 40 b0 0f 29 40
> [  419.852306] RSP: 002b:7ffec360e7d8 EFLAGS: 00010206
> [  419.852308] RAX: 7ff303d0a000 RBX: 02e2 RCX: 
> 7ff303d0b300
> [  419.852309] RDX: 12c0 RSI: 0025 RDI: 
> 
> [  419.852311] RBP: 1340 R08:  R09: 
> 
> [  419.852312] R10: 7ff303d0a000 R11: 1340 R12: 
> 7ff303d0a000
> [  419.852313] R13: 556665f1eb30 R14:  R15: 
> 
> [  419.852318] Modules linked in: xt_CHECKSUM xt_MASQUERADE xt_conntrack 
> ipt_REJECT nf_nat_tftp nf_conntrack_tftp tun bridge stp llc nft_objref 
> nf_conntrack_netbios_ns nf_conntrack_broadcast nft_fib_inet nft_fib_ipv4 
> nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject 
> nft_ct nft_chain_nat rfkill ip6table_nat ip6table_mangle ip6table_raw 
> ip6table_security iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 
> nf_defrag_ipv4 iptable_mangle iptable_raw iptable_security ip_set nf_tables 
> vboxsf nfnetlink ip6table_filter ip6_tables iptable_filter sunrpc vfat fat 
> intel_rapl_msr joydev intel_rapl_common intel_powerclamp crct10dif_pclmul 
> crc32_pclmul ghash_clmulni_intel snd_intel8x0 rapl snd_ac97_codec ac97_bus 
> snd_seq snd_seq_device snd_pcm pcspkr snd_timer snd soundcore i2c_piix4 
> vboxguest ip_tables vboxvideo drm_vram_helper drm_kms_helper cec 
> drm_ttm_helper ttm crc32c_intel serio_raw e1000 drm drm_privacy_screen_helper 
> ata_generic pata_acpi video fuse
> [  419.852375] ---[ end trace 511e5346897d9526 ]---
> 
> Note in case of the vboxvideo driver the DMA32 pool is allocated through
> drm_vram_helper_alloc_mm() which is also used by the bochs and
> hisilicon/hibmc drivers.
> 
> Cc: Christian König 
> Fixes: d099fc8f540a ("drm/ttm: new TT backend allocation pool v3")
> Signed-off-by: Hans de Goede 

Thanks.

Reviewed-by: Huang Rui 

> ---
>  drivers/gpu/drm/ttm/ttm_pool.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
> index 7b2f60616750..8b32fd8c8ccc 100644
> --- a/drivers/gpu/drm/ttm/ttm_pool.c
> +++ b/drivers/gpu/drm/ttm/ttm_pool.c
> @@ -80,8 +80,9 @@ static struct page *ttm_pool_alloc_page(struct ttm_pool 

Re: [PATCH] drm: amdgpu: pm: Mark vangogh_clk_dpm_is_enabled() as static

2021-01-12 Thread Huang Rui
On Wed, Jan 13, 2021 at 03:57:22AM +0800, Souptick Joarder wrote:
> kernel test robot throws below warnings ->
> 
> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c:594:6:
> warning: no previous prototype for 'vangogh_clk_dpm_is_enabled'
> [-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c:594:6:
> warning: no previous prototype for function 'vangogh_clk_dpm_is_enabled'
> [-Wmissing-prototypes]
> 
> Mark vangogh_clk_dpm_is_enabled() as static.
> 
> Reported-by: kernel test robot 
> Signed-off-by: Souptick Joarder 
> ---
>  drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c 
> b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> index 75ddcad..3ffe56e 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> @@ -610,7 +610,7 @@ static int vangogh_get_profiling_clk_mask(struct 
> smu_context *smu,
>   return 0;
>  }
>  
> -bool vangogh_clk_dpm_is_enabled(struct smu_context *smu,
> +static bool vangogh_clk_dpm_is_enabled(struct smu_context *smu,
>   enum smu_clk_type clk_type)

Ah, I have another patch which will use this function in another file.

Thanks,
Ray

>  {
>   enum smu_feature_mask feature_id = 0;
> -- 
> 1.9.1
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 211161] list_del corruption in ttm_pool_shrink

2021-01-12 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=211161

--- Comment #1 from Benji Wiebe (benjiwieb...@gmail.com) ---
Created attachment 294613
  --> https://bugzilla.kernel.org/attachment.cgi?id=294613=edit
kernel BUG dmesg 2

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 211161] New: list_del corruption in ttm_pool_shrink

2021-01-12 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=211161

Bug ID: 211161
   Summary: list_del corruption in ttm_pool_shrink
   Product: Drivers
   Version: 2.5
Kernel Version: 5.11.0-rc3
  Hardware: All
OS: Linux
  Tree: Mainline
Status: NEW
  Severity: normal
  Priority: P1
 Component: Video(DRI - non Intel)
  Assignee: drivers_video-...@kernel-bugs.osdl.org
  Reporter: benjiwieb...@gmail.com
Regression: No

Created attachment 294611
  --> https://bugzilla.kernel.org/attachment.cgi?id=294611=edit
kernel BUG dmesg 1

I've been getting occasional graphics lockups, fixable only by reboot. I was
hard rebooting until I realized I could ssh in to my desktop still, so here are
two dmesg logs that I've captured. There's also a report of (I think) this same
bug in the LKML: https://lkml.org/lkml/2020/12/31/47

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v3, 12/15] drm/mediatek: separate ccorr module

2021-01-12 Thread Chun-Kuang Hu
Hi, Yongqiang:

Yongqiang Niu  於 2021年1月11日 週一 下午3:54寫道:
>
> ccorr ctm matrix bits will be different in mt8192

This patch has conflicts with the series "Decouple Mediatek DRM sub
driver" [1] which has been applied to mediatek-drm-next, so please
rebase this patch onto mediatek-drm-next.

[1] https://patchwork.kernel.org/project/linux-mediatek/list/?series=399915

Regards,
Chun-Kuang.

>
> Signed-off-by: Yongqiang Niu 
> ---
>  drivers/gpu/drm/mediatek/Makefile   |   3 +-
>  drivers/gpu/drm/mediatek/mtk_disp_ccorr.c   | 222 
> 
>  drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c |  92 +---
>  drivers/gpu/drm/mediatek/mtk_drm_drv.c  |   8 +-
>  drivers/gpu/drm/mediatek/mtk_drm_drv.h  |   1 +
>  5 files changed, 231 insertions(+), 95 deletions(-)
>  create mode 100644 drivers/gpu/drm/mediatek/mtk_disp_ccorr.c
>
> diff --git a/drivers/gpu/drm/mediatek/Makefile 
> b/drivers/gpu/drm/mediatek/Makefile
> index ce5ad59..a02f534 100644
> --- a/drivers/gpu/drm/mediatek/Makefile
> +++ b/drivers/gpu/drm/mediatek/Makefile
> @@ -1,6 +1,7 @@
>  # SPDX-License-Identifier: GPL-2.0
>
> -mediatek-drm-y := mtk_disp_color.o \
> +mediatek-drm-y := mtk_disp_ccorr.o \
> + mtk_disp_color.o \
>   mtk_disp_gamma.o \
>   mtk_disp_ovl.o \
>   mtk_disp_postmask.o \
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ccorr.c 
> b/drivers/gpu/drm/mediatek/mtk_disp_ccorr.c
> new file mode 100644
> index 000..63b3ef6
> --- /dev/null
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_ccorr.c
> @@ -0,0 +1,222 @@
> +/*
> + * SPDX-License-Identifier:
> + *
> + * Copyright (c) 2020 MediaTek Inc.
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include "mtk_drm_crtc.h"
> +#include "mtk_drm_ddp_comp.h"
> +
> +#define DISP_CCORR_EN  0x
> +#define CCORR_EN   BIT(0)
> +#define DISP_CCORR_CFG 0x0020
> +#define CCORR_RELAY_MODE   BIT(0)
> +#define CCORR_ENGINE_ENBIT(1)
> +#define CCORR_GAMMA_OFFBIT(2)
> +#define CCORR_WGAMUT_SRC_CLIP  BIT(3)
> +#define DISP_CCORR_SIZE0x0030
> +#define DISP_CCORR_COEF_0  0x0080
> +#define DISP_CCORR_COEF_1  0x0084
> +#define DISP_CCORR_COEF_2  0x0088
> +#define DISP_CCORR_COEF_3  0x008C
> +#define DISP_CCORR_COEF_4  0x0090
> +
> +struct mtk_disp_ccorr_data {
> +   u32 reserved;
> +};
> +
> +/**
> + * struct mtk_disp_ccorr - DISP_CCORR driver structure
> + * @ddp_comp - structure containing type enum and hardware resources
> + * @crtc - associated crtc to report irq events to
> + */
> +struct mtk_disp_ccorr {
> +   struct mtk_ddp_comp ddp_comp;
> +   const struct mtk_disp_ccorr_data*data;
> +};
> +
> +static inline struct mtk_disp_ccorr *comp_to_ccorr(struct mtk_ddp_comp *comp)
> +{
> +   return container_of(comp, struct mtk_disp_ccorr, ddp_comp);
> +}
> +
> +static void mtk_ccorr_config(struct mtk_ddp_comp *comp, unsigned int w,
> +unsigned int h, unsigned int vrefresh,
> +unsigned int bpc, struct cmdq_pkt *cmdq_pkt)
> +{
> +   mtk_ddp_write(cmdq_pkt, w << 16 | h, comp, DISP_CCORR_SIZE);
> +   mtk_ddp_write(cmdq_pkt, CCORR_ENGINE_EN, comp, DISP_CCORR_CFG);
> +}
> +
> +static void mtk_ccorr_start(struct mtk_ddp_comp *comp)
> +{
> +   writel(CCORR_EN, comp->regs + DISP_CCORR_EN);
> +}
> +
> +static void mtk_ccorr_stop(struct mtk_ddp_comp *comp)
> +{
> +   writel_relaxed(0x0, comp->regs + DISP_CCORR_EN);
> +}
> +
> +/* Converts a DRM S31.32 value to the HW S1.10 format. */
> +static u16 mtk_ctm_s31_32_to_s1_10(u64 in)
> +{
> +   u16 r;
> +
> +   /* Sign bit. */
> +   r = in & BIT_ULL(63) ? BIT(11) : 0;
> +
> +   if ((in & GENMASK_ULL(62, 33)) > 0) {
> +   /* identity value 0x1 -> 0x400, */
> +   /* if bigger this, set it to max 0x7ff. */
> +   r |= GENMASK(10, 0);
> +   } else {
> +   /* take the 11 most important bits. */
> +   r |= (in >> 22) & GENMASK(10, 0);
> +   }
> +
> +   return r;
> +}
> +
> +static void mtk_ccorr_ctm_set(struct mtk_ddp_comp *comp,
> + struct drm_crtc_state *state)
> +{
> +   struct drm_property_blob *blob = state->ctm;
> +   struct drm_color_ctm *ctm;
> +   const u64 *input;
> +   uint16_t coeffs[9] = { 0 };
> +   int i;
> +   struct cmdq_pkt *cmdq_pkt = NULL;
> +
> +   if (!blob)
> +   return;
> +
> +   ctm = (struct drm_color_ctm *)blob->data;
> +   input = ctm->matrix;
> +
> +   for (i 

Re: [PATCH v3, 09/15] drm/mediatek: Add pm runtime support for gamma

2021-01-12 Thread Chun-Kuang Hu
Hi, Yongqiang:

Yongqiang Niu  於 2021年1月11日 週一 下午3:48寫道:

>
> gamma power domain need controled in the device.

In this series, why only gamma and color add pm runtime support? I
think all ddp component need pm runtime support. And pm runtime
support is not related to mt8192, so move these patches out of this
series.

Regards,
Chun-Kuang.

>
> Signed-off-by: Yongqiang Niu 
> Signed-off-by: Yidi Lin 
> ---
>  drivers/gpu/drm/mediatek/mtk_disp_gamma.c | 5 +
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c 
> b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c
> index 3c1ea07..da93079 100644
> --- a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c
> @@ -10,6 +10,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>
>  #include "mtk_drm_crtc.h"
> @@ -156,6 +157,8 @@ static int mtk_disp_gamma_probe(struct platform_device 
> *pdev)
>
> platform_set_drvdata(pdev, priv);
>
> +   pm_runtime_enable(dev);
> +
> ret = component_add(dev, _disp_gamma_component_ops);
> if (ret)
> dev_err(dev, "Failed to add component: %d\n", ret);
> @@ -165,6 +168,8 @@ static int mtk_disp_gamma_probe(struct platform_device 
> *pdev)
>
>  static int mtk_disp_gamma_remove(struct platform_device *pdev)
>  {
> +   pm_runtime_disable(>dev);
> +
> component_del(>dev, _disp_gamma_component_ops);
>
> return 0;
> --
> 1.8.1.1.dirty
> ___
> Linux-mediatek mailing list
> linux-media...@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 40/40] drm/amd/display/dc/core/dc_stream: Demote non-conformant kernel-doc headers

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:253: warning: 
> Function parameter or member 'pStream' not described in 
> 'dc_optimize_timing_for_fsft'
>  drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:253: warning: 
> Function parameter or member 'max_input_rate_in_khz' not described in 
> 'dc_optimize_timing_for_fsft'
>  drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:270: warning: 
> Function parameter or member 'stream' not described in 
> 'dc_stream_set_cursor_attributes'
>  drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:270: warning: 
> Function parameter or member 'attributes' not described in 
> 'dc_stream_set_cursor_attributes'
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c 
> b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
> index c103f858375d0..25fa712a78474 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
> @@ -244,7 +244,7 @@ struct dc_stream_status *dc_stream_get_status(
>  }
>
>  #ifndef TRIM_FSFT
> -/**
> +/*
>   * dc_optimize_timing_for_fsft() - dc to optimize timing
>   */
>  bool dc_optimize_timing_for_fsft(
> @@ -260,8 +260,7 @@ bool dc_optimize_timing_for_fsft(
>  }
>  #endif
>
> -
> -/**
> +/*
>   * dc_stream_set_cursor_attributes() - Update cursor attributes and set 
> cursor surface address
>   */
>  bool dc_stream_set_cursor_attributes(
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 39/40] drm/amd/display/dc/core/dc_surface: Demote kernel-doc abuse

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_surface.c:119: warning: 
> Cannot understand  
> *
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Aurabindo Pillai 
> Cc: Josip Pavic 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex


> ---
>  drivers/gpu/drm/amd/display/dc/core/dc_surface.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_surface.c 
> b/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
> index 3d7d27435f15e..e6b9c6a718413 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
> @@ -115,7 +115,7 @@ struct dc_plane_state *dc_create_plane_state(struct dc 
> *dc)
> return plane_state;
>  }
>
> -/**
> +/*
>   
> *
>   *  Function: dc_plane_get_status
>   *
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 37/40] drm/amd/display/dc/dce60/dce60_resource: Make local functions static

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:522:17: 
> warning: no previous prototype for ‘dce60_aux_engine_create’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:560:20: 
> warning: no previous prototype for ‘dce60_i2c_hw_create’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:576:20: 
> warning: no previous prototype for ‘dce60_i2c_sw_create’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:710:22: 
> warning: no previous prototype for ‘dce60_link_encoder_create’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:749:22: 
> warning: no previous prototype for ‘dce60_clock_source_create’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:773:6: 
> warning: no previous prototype for ‘dce60_clock_source_destroy’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:863:6: 
> warning: no previous prototype for ‘dce60_validate_bandwidth’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:908:16: 
> warning: no previous prototype for ‘dce60_validate_global’ 
> [-Wmissing-prototypes]
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Mauro Rossi 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  .../drm/amd/display/dc/dce60/dce60_resource.c| 16 
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce60/dce60_resource.c 
> b/drivers/gpu/drm/amd/display/dc/dce60/dce60_resource.c
> index e9dd78c484d6e..64f4a0da146bf 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce60/dce60_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce60/dce60_resource.c
> @@ -519,7 +519,7 @@ static struct output_pixel_processor *dce60_opp_create(
> return >base;
>  }
>
> -struct dce_aux *dce60_aux_engine_create(
> +static struct dce_aux *dce60_aux_engine_create(
> struct dc_context *ctx,
> uint32_t inst)
>  {
> @@ -557,7 +557,7 @@ static const struct dce_i2c_mask i2c_masks = {
> I2C_COMMON_MASK_SH_LIST_DCE_COMMON_BASE(_MASK)
>  };
>
> -struct dce_i2c_hw *dce60_i2c_hw_create(
> +static struct dce_i2c_hw *dce60_i2c_hw_create(
> struct dc_context *ctx,
> uint32_t inst)
>  {
> @@ -573,7 +573,7 @@ struct dce_i2c_hw *dce60_i2c_hw_create(
> return dce_i2c_hw;
>  }
>
> -struct dce_i2c_sw *dce60_i2c_sw_create(
> +static struct dce_i2c_sw *dce60_i2c_sw_create(
> struct dc_context *ctx)
>  {
> struct dce_i2c_sw *dce_i2c_sw =
> @@ -707,7 +707,7 @@ static const struct encoder_feature_support 
> link_enc_feature = {
> .flags.bits.IS_TPS3_CAPABLE = true
>  };
>
> -struct link_encoder *dce60_link_encoder_create(
> +static struct link_encoder *dce60_link_encoder_create(
> const struct encoder_init_data *enc_init_data)
>  {
> struct dce110_link_encoder *enc110 =
> @@ -746,7 +746,7 @@ static struct panel_cntl *dce60_panel_cntl_create(const 
> struct panel_cntl_init_d
> return _cntl->base;
>  }
>
> -struct clock_source *dce60_clock_source_create(
> +static struct clock_source *dce60_clock_source_create(
> struct dc_context *ctx,
> struct dc_bios *bios,
> enum clock_source_id id,
> @@ -770,7 +770,7 @@ struct clock_source *dce60_clock_source_create(
> return NULL;
>  }
>
> -void dce60_clock_source_destroy(struct clock_source **clk_src)
> +static void dce60_clock_source_destroy(struct clock_source **clk_src)
>  {
> kfree(TO_DCE110_CLK_SRC(*clk_src));
> *clk_src = NULL;
> @@ -860,7 +860,7 @@ static void dce60_resource_destruct(struct 
> dce110_resource_pool *pool)
> }
>  }
>
> -bool dce60_validate_bandwidth(
> +static bool dce60_validate_bandwidth(
> struct dc *dc,
> struct dc_state *context,
> bool fast_validate)
> @@ -905,7 +905,7 @@ static bool dce60_validate_surface_sets(
> return true;
>  }
>
> -enum dc_status dce60_validate_global(
> +static enum dc_status dce60_validate_global(
> struct dc *dc,
> struct dc_state *context)
>  {
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 36/40] drm/amd/display/dc/dce100/dce100_resource: Make local functions and ones called by reference static

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:55 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  In file included from 
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:54:
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:614:22: 
> warning: no previous prototype for ‘dce100_link_encoder_create’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:653:32: 
> warning: no previous prototype for ‘dce100_opp_create’ [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:668:17: 
> warning: no previous prototype for ‘dce100_aux_engine_create’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:706:20: 
> warning: no previous prototype for ‘dce100_i2c_hw_create’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:721:22: 
> warning: no previous prototype for ‘dce100_clock_source_create’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:745:6: 
> warning: no previous prototype for ‘dce100_clock_source_destroy’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:834:6: 
> warning: no previous prototype for ‘dce100_validate_bandwidth’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:879:16: 
> warning: no previous prototype for ‘dce100_validate_global’ 
> [-Wmissing-prototypes]
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Anthony Koo 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  .../drm/amd/display/dc/dce100/dce100_resource.c  | 16 
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c 
> b/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c
> index f20ed05a5050d..648169086bcf8 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c
> @@ -611,7 +611,7 @@ static const struct encoder_feature_support 
> link_enc_feature = {
> .flags.bits.IS_TPS3_CAPABLE = true
>  };
>
> -struct link_encoder *dce100_link_encoder_create(
> +static struct link_encoder *dce100_link_encoder_create(
> const struct encoder_init_data *enc_init_data)
>  {
> struct dce110_link_encoder *enc110 =
> @@ -650,7 +650,7 @@ static struct panel_cntl *dce100_panel_cntl_create(const 
> struct panel_cntl_init_
> return _cntl->base;
>  }
>
> -struct output_pixel_processor *dce100_opp_create(
> +static struct output_pixel_processor *dce100_opp_create(
> struct dc_context *ctx,
> uint32_t inst)
>  {
> @@ -665,7 +665,7 @@ struct output_pixel_processor *dce100_opp_create(
> return >base;
>  }
>
> -struct dce_aux *dce100_aux_engine_create(
> +static struct dce_aux *dce100_aux_engine_create(
> struct dc_context *ctx,
> uint32_t inst)
>  {
> @@ -703,7 +703,7 @@ static const struct dce_i2c_mask i2c_masks = {
> I2C_COMMON_MASK_SH_LIST_DCE_COMMON_BASE(_MASK)
>  };
>
> -struct dce_i2c_hw *dce100_i2c_hw_create(
> +static struct dce_i2c_hw *dce100_i2c_hw_create(
> struct dc_context *ctx,
> uint32_t inst)
>  {
> @@ -718,7 +718,7 @@ struct dce_i2c_hw *dce100_i2c_hw_create(
>
> return dce_i2c_hw;
>  }
> -struct clock_source *dce100_clock_source_create(
> +static struct clock_source *dce100_clock_source_create(
> struct dc_context *ctx,
> struct dc_bios *bios,
> enum clock_source_id id,
> @@ -742,7 +742,7 @@ struct clock_source *dce100_clock_source_create(
> return NULL;
>  }
>
> -void dce100_clock_source_destroy(struct clock_source **clk_src)
> +static void dce100_clock_source_destroy(struct clock_source **clk_src)
>  {
> kfree(TO_DCE110_CLK_SRC(*clk_src));
> *clk_src = NULL;
> @@ -831,7 +831,7 @@ static enum dc_status build_mapped_resource(
> return DC_OK;
>  }
>
> -bool dce100_validate_bandwidth(
> +static bool dce100_validate_bandwidth(
> struct dc  *dc,
> struct dc_state *context,
> bool fast_validate)
> @@ -876,7 +876,7 @@ static bool dce100_validate_surface_sets(
> return true;
>  }
>
> -enum dc_status dce100_validate_global(
> +static enum dc_status dce100_validate_global(
> struct dc  *dc,
> struct dc_state *context)
>  {
> --
> 2.25.1
>
> ___
> amd-gfx mailing list
> amd-...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
dri-devel mailing list
dri-devel@lists.freedesktop.org

Re: [PATCH 35/40] drm/amd/display/dc/dce60/dce60_timing_generator: Make 'dce60_configure_crc' invoked by reference static

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_timing_generator.c:192:6:
>  warning: no previous prototype for ‘dce60_configure_crc’ 
> [-Wmissing-prototypes]
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Mauro Rossi 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/dce60/dce60_timing_generator.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce60/dce60_timing_generator.c 
> b/drivers/gpu/drm/amd/display/dc/dce60/dce60_timing_generator.c
> index fc1af0ff0ca4c..c1a85ee374d9d 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce60/dce60_timing_generator.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce60/dce60_timing_generator.c
> @@ -189,8 +189,8 @@ static bool dce60_is_tg_enabled(struct timing_generator 
> *tg)
> return field == 1;
>  }
>
> -bool dce60_configure_crc(struct timing_generator *tg,
> - const struct crc_params *params)
> +static bool dce60_configure_crc(struct timing_generator *tg,
> +   const struct crc_params *params)
>  {
> /* Cannot configure crc on a CRTC that is disabled */
> if (!dce60_is_tg_enabled(tg))
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 34/40] drm/amd/display/dc/dce110/dce110_transform_v: Demote kernel-doc abuse

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_transform_v.c:228: 
> warning: bad line:void
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_transform_v.c:233: 
> warning: Function parameter or member 'xfm_dce' not described in 
> 'program_overscan'
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_transform_v.c:233: 
> warning: Function parameter or member 'data' not described in 
> 'program_overscan'
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  .../display/dc/dce110/dce110_transform_v.c| 19 +--
>  1 file changed, 9 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_transform_v.c 
> b/drivers/gpu/drm/amd/display/dc/dce110/dce110_transform_v.c
> index b1aaab5590cc6..29438c6050dbb 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_transform_v.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_transform_v.c
> @@ -217,16 +217,15 @@ static bool setup_scaling_configuration(
> return is_scaling_needed;
>  }
>
> -/**
> -* Function:
> -* void program_overscan
> -*
> -* Purpose: Programs overscan border
> -* Input:   overscan
> -*
> -* Output:
> -   void
> -*/
> +/*
> + * Function:
> + * void program_overscan
> + *
> + * Purpose: Programs overscan border
> + * Input:   overscan
> + *
> + * Output: void
> + */
>  static void program_overscan(
> struct dce_transform *xfm_dce,
> const struct scaler_data *data)
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 33/40] drm/amd/display/dc/dce110/dce110_resource: Make local functions invoked by reference static

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:262:15: 
> warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:266:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:262:15: 
> note: (near initialization for ‘stream_enc_regs[0].TMDS_CNTL’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:266:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:262:15: 
> warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:267:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:262:15: 
> note: (near initialization for ‘stream_enc_regs[1].TMDS_CNTL’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:267:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:262:15: 
> warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:268:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:262:15: 
> note: (near initialization for ‘stream_enc_regs[2].TMDS_CNTL’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:268:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  In file included from 
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:66:
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:272:3: 
> note: in expansion of macro ‘SE_COMMON_MASK_SH_LIST_DCE110’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:272:3: 
> note: in expansion of macro ‘SE_COMMON_MASK_SH_LIST_DCE110’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:272:3: 
> note: in expansion of macro ‘SE_COMMON_MASK_SH_LIST_DCE110’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:272:3: 
> note: in expansion of macro ‘SE_COMMON_MASK_SH_LIST_DCE110’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:276:3: 
> note: in expansion of macro ‘SE_COMMON_MASK_SH_LIST_DCE110’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:276:3: 
> note: in expansion of macro ‘SE_COMMON_MASK_SH_LIST_DCE110’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:276:3: 
> note: in expansion of macro ‘SE_COMMON_MASK_SH_LIST_DCE110’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:276:3: 
> note: in expansion of macro ‘SE_COMMON_MASK_SH_LIST_DCE110’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:553:3: 
> note: in expansion of macro ‘HWSEQ_DCE11_MASK_SH_LIST’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:553:3: 
> note: in expansion of macro ‘HWSEQ_DCE11_MASK_SH_LIST’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:553:3: 
> note: in expansion of macro ‘HWSEQ_DCE11_MASK_SH_LIST’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:553:3: 
> note: in expansion of macro ‘HWSEQ_DCE11_MASK_SH_LIST’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:557:3: 
> note: in expansion of macro ‘HWSEQ_DCE11_MASK_SH_LIST’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:557:3: 
> note: in expansion of macro ‘HWSEQ_DCE11_MASK_SH_LIST’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:557:3: 
> note: in expansion of macro ‘HWSEQ_DCE11_MASK_SH_LIST’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:557:3: 
> note: in expansion of macro ‘HWSEQ_DCE11_MASK_SH_LIST’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:594:3: 
> note: in expansion of macro ‘MI_DCE11_MASK_SH_LIST’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:594:3: 
> note: in expansion of macro ‘MI_DCE11_MASK_SH_LIST’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:599:3: 
> note: in expansion of macro ‘MI_DCE11_MASK_SH_LIST’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:599:3: 
> note: in expansion of macro ‘MI_DCE11_MASK_SH_LIST’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:718:17: 
> warning: no previous prototype for ‘dce110_aux_engine_create’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:756:20: 
> warning: no previous prototype for ‘dce110_i2c_hw_create’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:771:22: 
> warning: no previous prototype for ‘dce110_clock_source_create’ 
> 

Re: [PATCH 32/40] drm/amd/display/dc/dce110/Makefile: Ignore -Woverride-init warning

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  In file included from 
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:66:
>  
> drivers/gpu/drm/amd/amdgpu/../include/asic_reg/dce/dce_11_0_sh_mask.h:5936:51:
>  warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_stream_encoder.h:116:16: 
> note: in expansion of macro ‘DIG_FE_CNTL__DIG_STEREOSYNC_SELECT__SHIFT’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_stream_encoder.h:306:2: 
> note: in expansion of macro ‘SE_SF’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:272:3: 
> note: in expansion of macro ‘SE_COMMON_MASK_SH_LIST_DCE110’
>  
> drivers/gpu/drm/amd/amdgpu/../include/asic_reg/dce/dce_11_0_sh_mask.h:5936:51:
>  note: (near initialization for ‘se_shift.DIG_STEREOSYNC_SELECT’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_stream_encoder.h:116:16: 
> note: in expansion of macro ‘DIG_FE_CNTL__DIG_STEREOSYNC_SELECT__SHIFT’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_stream_encoder.h:306:2: 
> note: in expansion of macro ‘SE_SF’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:272:3: 
> note: in expansion of macro ‘SE_COMMON_MASK_SH_LIST_DCE110’
>  
> drivers/gpu/drm/amd/amdgpu/../include/asic_reg/dce/dce_11_0_sh_mask.h:5938:52:
>  warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_stream_encoder.h:116:16: 
> note: in expansion of macro ‘DIG_FE_CNTL__DIG_STEREOSYNC_GATE_EN__SHIFT’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_stream_encoder.h:307:2: 
> note: in expansion of macro ‘SE_SF’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:272:3: 
> note: in expansion of macro ‘SE_COMMON_MASK_SH_LIST_DCE110’
>  
> drivers/gpu/drm/amd/amdgpu/../include/asic_reg/dce/dce_11_0_sh_mask.h:5938:52:
>  note: (near initialization for ‘se_shift.DIG_STEREOSYNC_GATE_EN’)
>
>  NB: Snipped for brevity
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/dce110/Makefile | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce110/Makefile 
> b/drivers/gpu/drm/amd/display/dc/dce110/Makefile
> index d564c0eb8b045..84ab48df0c261 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce110/Makefile
> +++ b/drivers/gpu/drm/amd/display/dc/dce110/Makefile
> @@ -23,6 +23,8 @@
>  # Makefile for the 'controller' sub-component of DAL.
>  # It provides the control and status of HW CRTC block.
>
> +CFLAGS_$(AMDDALPATH)/dc/dce110/dce110_resource.o = $(call 
> cc-disable-warning, override-init)
> +
>  DCE110 = dce110_timing_generator.o \
>  dce110_compressor.o dce110_hw_sequencer.o dce110_resource.o \
>  dce110_opp_regamma_v.o dce110_opp_csc_v.o dce110_timing_generator_v.o \
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 31/40] drm/amd/display/dc/dce110/dce110_mem_input_v: Include our own header, containing prototypes

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_mem_input_v.c:1034:6: 
> warning: no previous prototype for ‘dce110_mem_input_v_construct’ 
> [-Wmissing-prototypes]
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Lee Jones 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c 
> b/drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c
> index 19b1976139b69..8bbb499067f74 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c
> @@ -34,6 +34,7 @@
>  #include "inc/dce_calcs.h"
>
>  #include "dce/dce_mem_input.h"
> +#include "dce110_mem_input_v.h"
>
>  static void set_flip_control(
> struct dce_mem_input *mem_input110,
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 30/40] drm/amd/display/dc/dce110/dce110_timing_generator_v: Demote kernel-doc abuse and line up comments

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator_v.c:54:
>  warning: Function parameter or member 'tg' not described in 
> 'dce110_timing_generator_v_enable_crtc'
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator_v.c:216:
>  warning: Function parameter or member 'tg' not described in 
> 'dce110_timing_generator_v_wait_for_vactive'
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex


> ---
>  .../dc/dce110/dce110_timing_generator_v.c | 19 +--
>  1 file changed, 9 insertions(+), 10 deletions(-)
>
> diff --git 
> a/drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator_v.c 
> b/drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator_v.c
> index a13a2f58944e3..c509384fff543 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator_v.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator_v.c
> @@ -46,17 +46,16 @@
>   *
>   
> **/
>
> -/**
> -* Enable CRTCV
> -*/
> +/*
> + * Enable CRTCV
> + */
>
>  static bool dce110_timing_generator_v_enable_crtc(struct timing_generator 
> *tg)
>  {
>  /*
> -* Set MASTER_UPDATE_MODE to 0
> -* This is needed for DRR, and also suggested to be default value by Syed.
> -*/
> -
> + * Set MASTER_UPDATE_MODE to 0
> + * This is needed for DRR, and also suggested to be default value by Syed.
> + */
> uint32_t value;
>
> value = 0;
> @@ -209,9 +208,9 @@ static void 
> dce110_timing_generator_v_wait_for_vblank(struct timing_generator *t
> }
>  }
>
> -/**
> -* Wait till we are in VActive (anywhere in VActive)
> -*/
> +/*
> + * Wait till we are in VActive (anywhere in VActive)
> + */
>  static void dce110_timing_generator_v_wait_for_vactive(struct 
> timing_generator *tg)
>  {
> while (dce110_timing_generator_v_is_in_vertical_blank(tg)) {
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 29/40] drm/amd/display/dc/dce112/dce112_resource: Make local functions and ones called by reference static

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:55 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:620:22: 
> warning: no previous prototype for ‘dce112_link_encoder_create’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:674:32: 
> warning: no previous prototype for ‘dce112_opp_create’ [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:689:17: 
> warning: no previous prototype for ‘dce112_aux_engine_create’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:727:20: 
> warning: no previous prototype for ‘dce112_i2c_hw_create’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:742:22: 
> warning: no previous prototype for ‘dce112_clock_source_create’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:766:6: 
> warning: no previous prototype for ‘dce112_clock_source_destroy’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:1027:16: 
> warning: no previous prototype for ‘dce112_validate_global’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:1205:29: 
> warning: no previous prototype for ‘dce112_resource_cap’ 
> [-Wmissing-prototypes]
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Anthony Koo 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  .../drm/amd/display/dc/dce112/dce112_resource.c  | 16 
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c 
> b/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c
> index f99b1c0845908..c68e576a21990 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c
> @@ -617,7 +617,7 @@ static const struct encoder_feature_support 
> link_enc_feature = {
> .flags.bits.IS_TPS4_CAPABLE = true
>  };
>
> -struct link_encoder *dce112_link_encoder_create(
> +static struct link_encoder *dce112_link_encoder_create(
> const struct encoder_init_data *enc_init_data)
>  {
> struct dce110_link_encoder *enc110 =
> @@ -671,7 +671,7 @@ static struct input_pixel_processor *dce112_ipp_create(
> return >base;
>  }
>
> -struct output_pixel_processor *dce112_opp_create(
> +static struct output_pixel_processor *dce112_opp_create(
> struct dc_context *ctx,
> uint32_t inst)
>  {
> @@ -686,7 +686,7 @@ struct output_pixel_processor *dce112_opp_create(
> return >base;
>  }
>
> -struct dce_aux *dce112_aux_engine_create(
> +static struct dce_aux *dce112_aux_engine_create(
> struct dc_context *ctx,
> uint32_t inst)
>  {
> @@ -724,7 +724,7 @@ static const struct dce_i2c_mask i2c_masks = {
> I2C_COMMON_MASK_SH_LIST_DCE110(_MASK)
>  };
>
> -struct dce_i2c_hw *dce112_i2c_hw_create(
> +static struct dce_i2c_hw *dce112_i2c_hw_create(
> struct dc_context *ctx,
> uint32_t inst)
>  {
> @@ -739,7 +739,7 @@ struct dce_i2c_hw *dce112_i2c_hw_create(
>
> return dce_i2c_hw;
>  }
> -struct clock_source *dce112_clock_source_create(
> +static struct clock_source *dce112_clock_source_create(
> struct dc_context *ctx,
> struct dc_bios *bios,
> enum clock_source_id id,
> @@ -763,7 +763,7 @@ struct clock_source *dce112_clock_source_create(
> return NULL;
>  }
>
> -void dce112_clock_source_destroy(struct clock_source **clk_src)
> +static void dce112_clock_source_destroy(struct clock_source **clk_src)
>  {
> kfree(TO_DCE110_CLK_SRC(*clk_src));
> *clk_src = NULL;
> @@ -1024,7 +1024,7 @@ enum dc_status dce112_add_stream_to_ctx(
> return result;
>  }
>
> -enum dc_status dce112_validate_global(
> +static enum dc_status dce112_validate_global(
> struct dc *dc,
> struct dc_state *context)
>  {
> @@ -1202,7 +1202,7 @@ static void bw_calcs_data_update_from_pplib(struct dc 
> *dc)
> dm_pp_notify_wm_clock_changes(dc->ctx, _ranges);
>  }
>
> -const struct resource_caps *dce112_resource_cap(
> +static const struct resource_caps *dce112_resource_cap(
> struct hw_asic_id *asic_id)
>  {
> if (ASIC_REV_IS_POLARIS11_M(asic_id->hw_internal_rev) ||
> --
> 2.25.1
>
> ___
> amd-gfx mailing list
> amd-...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 27/40] drm/amd/display/dc/dce110/dce110_compressor: Strip out unused function 'controller_id_to_index'

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_compressor.c:429:14: 
> warning: no previous prototype for ‘controller_id_to_index’ 
> [-Wmissing-prototypes]
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Lee Jones 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied. Thanks!

Alex


> ---
>  .../amd/display/dc/dce110/dce110_compressor.c | 25 ---
>  1 file changed, 25 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c 
> b/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
> index 18b0a69b0b1e8..44564a4742b52 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
> @@ -425,31 +425,6 @@ void get_max_support_fbc_buffersize(unsigned int *max_x, 
> unsigned int *max_y)
>  */
>  }
>
> -
> -unsigned int controller_id_to_index(enum controller_id controller_id)
> -{
> -   unsigned int index = 0;
> -
> -   switch (controller_id) {
> -   case CONTROLLER_ID_D0:
> -   index = 0;
> -   break;
> -   case CONTROLLER_ID_D1:
> -   index = 1;
> -   break;
> -   case CONTROLLER_ID_D2:
> -   index = 2;
> -   break;
> -   case CONTROLLER_ID_D3:
> -   index = 3;
> -   break;
> -   default:
> -   break;
> -   }
> -   return index;
> -}
> -
> -
>  static const struct compressor_funcs dce110_compressor_funcs = {
> .power_up_fbc = dce110_compressor_power_up_fbc,
> .enable_fbc = dce110_compressor_enable_fbc,
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 26/40] drm/amd/display/dc/dce110/dce110_timing_generator: Demote kernel-doc abuses to standard function headers

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c:79: 
> warning: Cannot understand  
> *
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c:124:
>  warning: Function parameter or member 'tg' not described in 
> 'dce110_timing_generator_enable_crtc'
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c:179:
>  warning: Cannot understand  
> *
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c:233:
>  warning: Function parameter or member 'tg' not described in 
> 'dce110_timing_generator_disable_crtc'
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c:258:
>  warning: Function parameter or member 'tg' not described in 
> 'program_horz_count_by_2'
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c:258:
>  warning: Function parameter or member 'timing' not described in 
> 'program_horz_count_by_2'
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c:284:
>  warning: Function parameter or member 'tg' not described in 
> 'dce110_timing_generator_program_timing_generator'
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c:284:
>  warning: Function parameter or member 'dc_crtc_timing' not described in 
> 'dce110_timing_generator_program_timing_generator'
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c:356:
>  warning: Cannot understand  
> *
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c:525:
>  warning: Cannot understand  
> *
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c:561:
>  warning: Cannot understand  
> *
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c:1118:
>  warning: Function parameter or member 'tg' not described in 
> 'dce110_timing_generator_validate_timing'
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c:1118:
>  warning: Function parameter or member 'timing' not described in 
> 'dce110_timing_generator_validate_timing'
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c:1118:
>  warning: Function parameter or member 'signal' not described in 
> 'dce110_timing_generator_validate_timing'
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c:1174:
>  warning: Function parameter or member 'tg' not described in 
> 'dce110_timing_generator_wait_for_vblank'
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c:1198:
>  warning: Function parameter or member 'tg' not described in 
> 'dce110_timing_generator_wait_for_vactive'
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c:1208:
>  warning: Cannot understand  
> *
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c:1386:
>  warning: Cannot understand  
> *
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c:1768:
>  warning: Cannot understand  
> *
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c:1801:
>  warning: Function parameter or member 'tg' not described in 
> 'dce110_timing_generator_disable_vga'
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c:1851:
>  warning: Function parameter or member 'tg' not described in 
> 'dce110_timing_generator_set_overscan_color_black'
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c:1851:
>  warning: Function parameter or member 'color' not described in 
> 'dce110_timing_generator_set_overscan_color_black'
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c:1851:
>  warning: Excess function parameter 'param' description in 
> 'dce110_timing_generator_set_overscan_color_black'
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Anthony Koo 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex


> ---
>  .../dc/dce110/dce110_timing_generator.c   | 71 +--
>  1 file changed, 34 

Re: [PATCH 25/40] drm/amd/display/dc/dce120/dce120_timing_generator: Remove unused function 'dce120_timing_generator_get_position'

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:602:13:
>  warning: ‘dce120_timing_generator_get_position’ defined but not used 
> [-Wunused-function]
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Lee Jones 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  .../dc/dce120/dce120_timing_generator.c   | 43 ---
>  1 file changed, 43 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce120/dce120_timing_generator.c 
> b/drivers/gpu/drm/amd/display/dc/dce120/dce120_timing_generator.c
> index d02ecb983c9cd..b57c466124e76 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce120/dce120_timing_generator.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce120/dce120_timing_generator.c
> @@ -589,49 +589,6 @@ static void dce120_timing_generator_set_drr(
> }
>  }
>
> -/*
> - 
> *
> - *  Function: dce120_timing_generator_get_position
> - *
> - *  @brief
> - * Returns CRTC vertical/horizontal counters
> - *
> - *  @param [out] position
> - 
> *
> - */
> -static void dce120_timing_generator_get_position(struct timing_generator *tg,
> -   struct crtc_position *position)
> -{
> -   uint32_t value;
> -   struct dce110_timing_generator *tg110 = DCE110TG_FROM_TG(tg);
> -
> -   value = dm_read_reg_soc15(
> -   tg->ctx,
> -   mmCRTC0_CRTC_STATUS_POSITION,
> -   tg110->offsets.crtc);
> -
> -   position->horizontal_count = get_reg_field_value(
> -   value,
> -   CRTC0_CRTC_STATUS_POSITION,
> -   CRTC_HORZ_COUNT);
> -
> -   position->vertical_count = get_reg_field_value(
> -   value,
> -   CRTC0_CRTC_STATUS_POSITION,
> -   CRTC_VERT_COUNT);
> -
> -   value = dm_read_reg_soc15(
> -   tg->ctx,
> -   mmCRTC0_CRTC_NOM_VERT_POSITION,
> -   tg110->offsets.crtc);
> -
> -   position->nominal_vcount = get_reg_field_value(
> -   value,
> -   CRTC0_CRTC_NOM_VERT_POSITION,
> -   CRTC_VERT_COUNT_NOM);
> -}
> -
> -
>  static void dce120_timing_generator_get_crtc_scanoutpos(
> struct timing_generator *tg,
> uint32_t *v_blank_start,
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 24/40] drm/amd/pm/swsmu/smu11/vangogh_ppt: Make local function 'vangogh_clk_dpm_is_enabled' static

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c:613:6: warning: 
> no previous prototype for ‘vangogh_clk_dpm_is_enabled’ [-Wmissing-prototypes]
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Xiaojian Du 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied the same patch from someone else earlier today.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c 
> b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> index 75ddcadf3802a..37bd4c647418d 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> @@ -610,8 +610,8 @@ static int vangogh_get_profiling_clk_mask(struct 
> smu_context *smu,
> return 0;
>  }
>
> -bool vangogh_clk_dpm_is_enabled(struct smu_context *smu,
> -   enum smu_clk_type clk_type)
> +static bool vangogh_clk_dpm_is_enabled(struct smu_context *smu,
> +  enum smu_clk_type clk_type)
>  {
> enum smu_feature_mask feature_id = 0;
>
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 23/40] drm/amd/display/dc/dce110/dce110_mem_input_v: Make local functions static

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_mem_input_v.c:471:6: 
> warning: no previous prototype for ‘dce_mem_input_v_is_surface_pending’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_mem_input_v.c:486:6: 
> warning: no previous prototype for 
> ‘dce_mem_input_v_program_surface_flip_and_addr’ [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_mem_input_v.c:563:6: 
> warning: no previous prototype for ‘dce_mem_input_v_program_pte_vm’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_mem_input_v.c:636:6: 
> warning: no previous prototype for ‘dce_mem_input_v_program_surface_config’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_mem_input_v.c:922:6: 
> warning: no previous prototype for ‘dce_mem_input_v_program_display_marks’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_mem_input_v.c:945:6: 
> warning: no previous prototype for 
> ‘dce_mem_input_program_chroma_display_marks’ [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_mem_input_v.c:966:6: 
> warning: no previous prototype for ‘dce110_allocate_mem_input_v’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_mem_input_v.c:1008:6: 
> warning: no previous prototype for ‘dce110_free_mem_input_v’ 
> [-Wmissing-prototypes]
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  .../amd/display/dc/dce110/dce110_mem_input_v.c   | 16 
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c 
> b/drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c
> index d54172d88f5f3..19b1976139b69 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c
> @@ -468,7 +468,7 @@ static void program_pixel_format(
> }
>  }
>
> -bool dce_mem_input_v_is_surface_pending(struct mem_input *mem_input)
> +static bool dce_mem_input_v_is_surface_pending(struct mem_input *mem_input)
>  {
> struct dce_mem_input *mem_input110 = TO_DCE_MEM_INPUT(mem_input);
> uint32_t value;
> @@ -483,7 +483,7 @@ bool dce_mem_input_v_is_surface_pending(struct mem_input 
> *mem_input)
> return false;
>  }
>
> -bool dce_mem_input_v_program_surface_flip_and_addr(
> +static bool dce_mem_input_v_program_surface_flip_and_addr(
> struct mem_input *mem_input,
> const struct dc_plane_address *address,
> bool flip_immediate)
> @@ -560,7 +560,7 @@ static const unsigned int *get_dvmm_hw_setting(
> }
>  }
>
> -void dce_mem_input_v_program_pte_vm(
> +static void dce_mem_input_v_program_pte_vm(
> struct mem_input *mem_input,
> enum surface_pixel_format format,
> union dc_tiling_info *tiling_info,
> @@ -633,7 +633,7 @@ void dce_mem_input_v_program_pte_vm(
> dm_write_reg(mem_input110->base.ctx, mmUNP_DVMM_PTE_ARB_CONTROL_C, 
> value);
>  }
>
> -void dce_mem_input_v_program_surface_config(
> +static void dce_mem_input_v_program_surface_config(
> struct mem_input *mem_input,
> enum surface_pixel_format format,
> union dc_tiling_info *tiling_info,
> @@ -919,7 +919,7 @@ static void program_nbp_watermark_c(
> marks);
>  }
>
> -void dce_mem_input_v_program_display_marks(
> +static void dce_mem_input_v_program_display_marks(
> struct mem_input *mem_input,
> struct dce_watermarks nbp,
> struct dce_watermarks stutter,
> @@ -942,7 +942,7 @@ void dce_mem_input_v_program_display_marks(
>
>  }
>
> -void dce_mem_input_program_chroma_display_marks(
> +static void dce_mem_input_program_chroma_display_marks(
> struct mem_input *mem_input,
> struct dce_watermarks nbp,
> struct dce_watermarks stutter,
> @@ -963,7 +963,7 @@ void dce_mem_input_program_chroma_display_marks(
> stutter);
>  }
>
> -void dce110_allocate_mem_input_v(
> +static void dce110_allocate_mem_input_v(
> struct mem_input *mi,
> uint32_t h_total,/* for current stream */
> uint32_t v_total,/* for current stream */
> @@ -1005,7 +1005,7 @@ void dce110_allocate_mem_input_v(
>
>  }
>
> -void dce110_free_mem_input_v(
> +static void dce110_free_mem_input_v(
> struct mem_input *mi,
> uint32_t total_stream_num)
>  {
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> 

Re: [PATCH 22/40] drm/amd/display/dc/dce110/dce110_hw_sequencer: Demote non-conformant kernel-doc header

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_hw_sequencer.c:1639: 
> warning: Function parameter or member 'dc' not described in 
> 'dce110_enable_accelerated_mode'
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_hw_sequencer.c:1639: 
> warning: Function parameter or member 'context' not described in 
> 'dce110_enable_accelerated_mode'
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c 
> b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
> index 4c230f1de9a30..c57405fa4bebc 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
> @@ -1628,7 +1628,7 @@ static struct dc_link *get_edp_link_with_sink(
> return link;
>  }
>
> -/**
> +/*
>   * When ASIC goes from VBIOS/VGA mode to driver/accelerated mode we need:
>   *  1. Power down all DC HW blocks
>   *  2. Disable VGA engine on all controllers
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v5 04/21] gpu: host1x: Remove cancelled waiters immediately

2021-01-12 Thread Mikko Perttunen

On 1/13/21 12:07 AM, Dmitry Osipenko wrote:

11.01.2021 16:00, Mikko Perttunen пишет:

-void host1x_intr_put_ref(struct host1x *host, unsigned int id, void *ref)
+void host1x_intr_put_ref(struct host1x *host, unsigned int id, void *ref,
+bool flush)
  {
struct host1x_waitlist *waiter = ref;
struct host1x_syncpt *syncpt;
  
-	while (atomic_cmpxchg(>state, WLS_PENDING, WLS_CANCELLED) ==

-  WLS_REMOVED)
-   schedule();
+   atomic_cmpxchg(>state, WLS_PENDING, WLS_CANCELLED);
  
  	syncpt = host->syncpt + id;

-   (void)process_wait_list(host, syncpt,
-   host1x_syncpt_load(host->syncpt + id));
+
+   spin_lock(>intr.lock);
+   if (atomic_cmpxchg(>state, WLS_CANCELLED, WLS_HANDLED) ==
+   WLS_CANCELLED) {
+   list_del(>list);
+   kref_put(>refcount, waiter_release);
+   }
+   spin_unlock(>intr.lock);
+
+   if (flush) {
+   /* Wait until any concurrently executing handler has finished. 
*/
+   while (atomic_read(>state) != WLS_HANDLED)
+   cpu_relax();
+   }


A busy-loop shouldn't be used in kernel unless there is a very good
reason. The wait_event() should be used instead.

But please don't hurry to update this patch, we may need or want to
retire the host1x-waiter and then these all waiter-related patches won't
be needed.



Yes, we should improve the intr code to remove all this complexity. But 
let's merge this first to get a functional baseline and do larger design 
changes in follow-up patches.


It is cumbersome for me to develop further series (of which I have 
several under work and planning) with this baseline series not being 
merged. The uncertainty on the approval of the UAPI design also makes it 
hard to know whether it makes sense for me to work on top of this code 
or not, so I'd like to focus on what's needed to get this merged instead 
of further redesign of the driver at this time.


Mikko
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 21/40] drm/amd/display/dc/dce110/dce110_compressor: Remove unused function 'dce110_get_required_compressed_surfacesize

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_compressor.c:415:6: 
> warning: no previous prototype for 
> ‘dce110_get_required_compressed_surfacesize’ [-Wmissing-prototypes]
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  .../amd/display/dc/dce110/dce110_compressor.c | 30 ---
>  1 file changed, 30 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c 
> b/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
> index 72b580a4eb856..18b0a69b0b1e8 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
> @@ -412,36 +412,6 @@ void dce110_compressor_destroy(struct compressor 
> **compressor)
> *compressor = NULL;
>  }
>
> -bool dce110_get_required_compressed_surfacesize(struct fbc_input_info 
> fbc_input_info,
> -   struct 
> fbc_requested_compressed_size size)
> -{
> -   bool result = false;
> -
> -   unsigned int max_x = FBC_MAX_X, max_y = FBC_MAX_Y;
> -
> -   get_max_support_fbc_buffersize(_x, _y);
> -
> -   if (fbc_input_info.dynamic_fbc_buffer_alloc == 0) {
> -   /*
> -* For DCE11 here use Max HW supported size:  HW Support up 
> to 3840x2400 resolution
> -* or 18000 chunks.
> -*/
> -   size.preferred_size = size.min_size = 
> align_to_chunks_number_per_line(max_x) * max_y * 4;  /* (For FBC when LPT not 
> supported). */
> -   size.preferred_size_alignment = size.min_size_alignment = 
> 0x100;   /* For FBC when LPT not supported */
> -   size.bits.preferred_must_be_framebuffer_pool = 1;
> -   size.bits.min_must_be_framebuffer_pool = 1;
> -
> -   result = true;
> -   }
> -   /*
> -* Maybe to add registry key support with optional size here to 
> override above
> -* for debugging purposes
> -*/
> -
> -   return result;
> -}
> -
> -
>  void get_max_support_fbc_buffersize(unsigned int *max_x, unsigned int *max_y)
>  {
> *max_x = FBC_MAX_X;
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 20/40] drm/amd/display/dc/dce110/dce110_timing_generator: Remove unused variable 'value_crtc_vtotal'

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c: 
> In function ‘dce110_timing_generator_tear_down_global_swap_lock’:
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_timing_generator.c:1354:12:
>  warning: variable ‘value_crtc_vtotal’ set but not used 
> [-Wunused-but-set-variable]
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Aric Cyr 
> Cc: Anthony Koo 
> Cc: Tony Cheng 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex


> ---
>  .../gpu/drm/amd/display/dc/dce110/dce110_timing_generator.c  | 5 +
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator.c 
> b/drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator.c
> index 1ea7db8eeb988..9a6c411bb7fe6 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator.c
> @@ -1351,10 +1351,7 @@ void 
> dce110_timing_generator_tear_down_global_swap_lock(
>
> /* Restore DCP_GSL_PURPOSE_SURFACE_FLIP */
> {
> -   uint32_t value_crtc_vtotal;
> -
> -   value_crtc_vtotal = dm_read_reg(tg->ctx,
> -   CRTC_REG(mmCRTC_V_TOTAL));
> +   dm_read_reg(tg->ctx, CRTC_REG(mmCRTC_V_TOTAL));
>
> set_reg_field_value(value,
> 0,
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 19/40] drm/amd/display/dc/dce/dce_opp: Remove duplicate entries causing 'field overwritten' issues

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  In file included from 
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:59:
>  
> drivers/gpu/drm/amd/amdgpu/../include/asic_reg/dce/dce_11_2_sh_mask.h:10480:62:
>  warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.h:96:16: note: in 
> expansion of macro ‘FMT_BIT_DEPTH_CONTROL__FMT_TEMPORAL_DITHER_EN__SHIFT’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.h:114:2: note: in 
> expansion of macro ‘OPP_SF’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.h:148:2: note: in 
> expansion of macro ‘OPP_COMMON_MASK_SH_LIST_DCE_COMMON_BASE’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:321:2: 
> note: in expansion of macro ‘OPP_COMMON_MASK_SH_LIST_DCE_112’
>  
> drivers/gpu/drm/amd/amdgpu/../include/asic_reg/dce/dce_11_2_sh_mask.h:10480:62:
>  note: (near initialization for ‘opp_shift.FMT_TEMPORAL_DITHER_EN’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.h:96:16: note: in 
> expansion of macro ‘FMT_BIT_DEPTH_CONTROL__FMT_TEMPORAL_DITHER_EN__SHIFT’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.h:114:2: note: in 
> expansion of macro ‘OPP_SF’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.h:148:2: note: in 
> expansion of macro ‘OPP_COMMON_MASK_SH_LIST_DCE_COMMON_BASE’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:321:2: 
> note: in expansion of macro ‘OPP_COMMON_MASK_SH_LIST_DCE_112’
>  
> drivers/gpu/drm/amd/amdgpu/../include/asic_reg/dce/dce_11_2_sh_mask.h:10479:60:
>  warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.h:96:16: note: in 
> expansion of macro ‘FMT_BIT_DEPTH_CONTROL__FMT_TEMPORAL_DITHER_EN_MASK’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.h:114:2: note: in 
> expansion of macro ‘OPP_SF’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.h:148:2: note: in 
> expansion of macro ‘OPP_COMMON_MASK_SH_LIST_DCE_COMMON_BASE’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:325:2: 
> note: in expansion of macro ‘OPP_COMMON_MASK_SH_LIST_DCE_112’
>  
> drivers/gpu/drm/amd/amdgpu/../include/asic_reg/dce/dce_11_2_sh_mask.h:10479:60:
>  note: (near initialization for ‘opp_mask.FMT_TEMPORAL_DITHER_EN’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.h:96:16: note: in 
> expansion of macro ‘FMT_BIT_DEPTH_CONTROL__FMT_TEMPORAL_DITHER_EN_MASK’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.h:114:2: note: in 
> expansion of macro ‘OPP_SF’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.h:148:2: note: in 
> expansion of macro ‘OPP_COMMON_MASK_SH_LIST_DCE_COMMON_BASE’
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Mauro Rossi 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/dce/dce_opp.h | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_opp.h 
> b/drivers/gpu/drm/amd/display/dc/dce/dce_opp.h
> index 4d484ef60f357..bf1ffc3629c7f 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce/dce_opp.h
> +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_opp.h
> @@ -111,7 +111,6 @@ enum dce110_opp_reg_type {
> OPP_SF(FMT_DITHER_RAND_R_SEED, FMT_RAND_R_SEED, mask_sh),\
> OPP_SF(FMT_DITHER_RAND_G_SEED, FMT_RAND_G_SEED, mask_sh),\
> OPP_SF(FMT_DITHER_RAND_B_SEED, FMT_RAND_B_SEED, mask_sh),\
> -   OPP_SF(FMT_BIT_DEPTH_CONTROL, FMT_TEMPORAL_DITHER_EN, mask_sh),\
> OPP_SF(FMT_BIT_DEPTH_CONTROL, FMT_TEMPORAL_DITHER_RESET, mask_sh),\
> OPP_SF(FMT_BIT_DEPTH_CONTROL, FMT_TEMPORAL_DITHER_OFFSET, mask_sh),\
> OPP_SF(FMT_BIT_DEPTH_CONTROL, FMT_TEMPORAL_DITHER_DEPTH, mask_sh),\
> @@ -219,7 +218,6 @@ enum dce110_opp_reg_type {
> OPP_SF(FMT_DITHER_RAND_R_SEED, FMT_RAND_R_SEED, mask_sh),\
> OPP_SF(FMT_DITHER_RAND_G_SEED, FMT_RAND_G_SEED, mask_sh),\
> OPP_SF(FMT_DITHER_RAND_B_SEED, FMT_RAND_B_SEED, mask_sh),\
> -   OPP_SF(FMT_BIT_DEPTH_CONTROL, FMT_TEMPORAL_DITHER_EN, mask_sh),\
> OPP_SF(FMT_BIT_DEPTH_CONTROL, FMT_TEMPORAL_DITHER_RESET, mask_sh),\
> OPP_SF(FMT_BIT_DEPTH_CONTROL, FMT_TEMPORAL_DITHER_OFFSET, mask_sh),\
> OPP_SF(FMT_BIT_DEPTH_CONTROL, FMT_TEMPORAL_DITHER_DEPTH, mask_sh),\
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 18/40] drm/amd/display/dc/dce112/Makefile: Ignore -Woverride-init warning

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> This file uses a complex abstracted set of hierarchical macros to
> setup its applicable register lists within constant structures.
> However in the case of TMDS_CNTL we wish to mark it as not applicable
> for this use-case.
>
> One method would be to de-const all of the definitions and users, then
> manually zero out TMDS_CNTL from the list.  Another would be to create
> a new set of hierarchical macros to omit TMDS_CNTL entirely.  Both
> would entail a great deal of unnecessary changes and maintenance
> burden.
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:286:15: 
> warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:290:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:286:15: 
> note: (near initialization for ‘stream_enc_regs[0].TMDS_CNTL’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:290:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:286:15: 
> warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:291:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:286:15: 
> note: (near initialization for ‘stream_enc_regs[1].TMDS_CNTL’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:291:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:286:15: 
> warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:292:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:286:15: 
> note: (near initialization for ‘stream_enc_regs[2].TMDS_CNTL’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:292:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:286:15: 
> warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:293:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:286:15: 
> note: (near initialization for ‘stream_enc_regs[3].TMDS_CNTL’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:293:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:286:15: 
> warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:294:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:286:15: 
> note: (near initialization for ‘stream_enc_regs[4].TMDS_CNTL’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:294:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:286:15: 
> warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:295:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:286:15: 
> note: (near initialization for ‘stream_enc_regs[5].TMDS_CNTL’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:295:2: 
> note: in expansion of macro ‘stream_enc_regs’
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/dce112/Makefile | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce112/Makefile 
> b/drivers/gpu/drm/amd/display/dc/dce112/Makefile
> index 8e090446d5119..9de6501702d2c 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce112/Makefile
> +++ b/drivers/gpu/drm/amd/display/dc/dce112/Makefile
> @@ -23,6 +23,8 @@
>  # Makefile for the 'controller' sub-component of DAL.
>  # It provides the control and status of HW CRTC block.
>
> +CFLAGS_$(AMDDALPATH)/dc/dce112/dce112_resource.o = $(call 
> cc-disable-warning, override-init)
> +
>  DCE112 = dce112_compressor.o dce112_hw_sequencer.o \
>  dce112_resource.o
>
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing 

Re: [PATCH 17/40] drm/amd/display/dc/dce/dce_aux: Remove duplicate line causing 'field overwritten' issue

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  In file included from 
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:59:
>  
> drivers/gpu/drm/amd/amdgpu/../include/asic_reg/dce/dce_11_2_sh_mask.h:10014:58:
>  warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.h:214:16: note: in 
> expansion of macro ‘AUX_SW_DATA__AUX_SW_AUTOINCREMENT_DISABLE__SHIFT’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.h:127:2: note: in 
> expansion of macro ‘AUX_SF’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:177:2: 
> note: in expansion of macro ‘DCE_AUX_MASK_SH_LIST’
>  
> drivers/gpu/drm/amd/amdgpu/../include/asic_reg/dce/dce_11_2_sh_mask.h:10014:58:
>  note: (near initialization for ‘aux_shift.AUX_SW_AUTOINCREMENT_DISABLE’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.h:214:16: note: in 
> expansion of macro ‘AUX_SW_DATA__AUX_SW_AUTOINCREMENT_DISABLE__SHIFT’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.h:127:2: note: in 
> expansion of macro ‘AUX_SF’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:177:2: 
> note: in expansion of macro ‘DCE_AUX_MASK_SH_LIST’
>  
> drivers/gpu/drm/amd/amdgpu/../include/asic_reg/dce/dce_11_2_sh_mask.h:10013:56:
>  warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.h:214:16: note: in 
> expansion of macro ‘AUX_SW_DATA__AUX_SW_AUTOINCREMENT_DISABLE_MASK’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.h:127:2: note: in 
> expansion of macro ‘AUX_SF’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:181:2: 
> note: in expansion of macro ‘DCE_AUX_MASK_SH_LIST’
>  
> drivers/gpu/drm/amd/amdgpu/../include/asic_reg/dce/dce_11_2_sh_mask.h:10013:56:
>  note: (near initialization for ‘aux_mask.AUX_SW_AUTOINCREMENT_DISABLE’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.h:214:16: note: in 
> expansion of macro ‘AUX_SW_DATA__AUX_SW_AUTOINCREMENT_DISABLE_MASK’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.h:127:2: note: in 
> expansion of macro ‘AUX_SF’
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/dce/dce_aux.h | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.h 
> b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.h
> index 382465862f297..277484cf853e4 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.h
> +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.h
> @@ -124,7 +124,6 @@ struct dce110_aux_registers {
> AUX_SF(AUX_SW_CONTROL, AUX_SW_GO, mask_sh),\
> AUX_SF(AUX_SW_DATA, AUX_SW_AUTOINCREMENT_DISABLE, mask_sh),\
> AUX_SF(AUX_SW_DATA, AUX_SW_DATA_RW, mask_sh),\
> -   AUX_SF(AUX_SW_DATA, AUX_SW_AUTOINCREMENT_DISABLE, mask_sh),\
> AUX_SF(AUX_SW_DATA, AUX_SW_INDEX, mask_sh),\
> AUX_SF(AUX_SW_DATA, AUX_SW_DATA, mask_sh),\
> AUX_SF(AUX_SW_STATUS, AUX_SW_REPLY_BYTE_COUNT, mask_sh),\
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 16/40] drm/amd/display/dc/dce120/dce120_timing_generator: Demote non-kerneldoc headers

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:602:13:
>  warning: ‘dce120_timing_generator_get_position’ defined but not used 
> [-Wunused-function]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:73: 
> warning: Cannot understand  
> *
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:593:
>  warning: Cannot understand  
> *
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Lee Jones 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  .../gpu/drm/amd/display/dc/dce120/dce120_timing_generator.c   | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce120/dce120_timing_generator.c 
> b/drivers/gpu/drm/amd/display/dc/dce120/dce120_timing_generator.c
> index ebc7d61e8bf36..d02ecb983c9cd 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce120/dce120_timing_generator.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce120/dce120_timing_generator.c
> @@ -69,7 +69,7 @@
>  #define CRTC_REG_SET_3(reg, field1, val1, field2, val2, field3, val3)  \
> CRTC_REG_SET_N(reg, 3, FD(reg##__##field1), val1, 
> FD(reg##__##field2), val2, FD(reg##__##field3), val3)
>
> -/**
> +/*
>   
> *
>   *  Function: is_in_vertical_blank
>   *
> @@ -589,7 +589,7 @@ static void dce120_timing_generator_set_drr(
> }
>  }
>
> -/**
> +/*
>   
> *
>   *  Function: dce120_timing_generator_get_position
>   *
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 15/40] drm/amd/display/dc/dce120/dce120_resource: Staticify local functions

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:426:32: 
> warning: no previous prototype for ‘dce120_opp_create’ [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:440:17: 
> warning: no previous prototype for ‘dce120_aux_engine_create’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:478:20: 
> warning: no previous prototype for ‘dce120_i2c_hw_create’ 
> [-Wmissing-prototypes]
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Anthony Koo 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c 
> b/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c
> index f1e3d2888eacc..c65e4d125c8e2 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c
> @@ -423,7 +423,7 @@ static const struct dce110_clk_src_mask cs_mask = {
> CS_COMMON_MASK_SH_LIST_DCE_112(_MASK)
>  };
>
> -struct output_pixel_processor *dce120_opp_create(
> +static struct output_pixel_processor *dce120_opp_create(
> struct dc_context *ctx,
> uint32_t inst)
>  {
> @@ -437,7 +437,7 @@ struct output_pixel_processor *dce120_opp_create(
>  ctx, inst, _regs[inst], _shift, 
> _mask);
> return >base;
>  }
> -struct dce_aux *dce120_aux_engine_create(
> +static struct dce_aux *dce120_aux_engine_create(
> struct dc_context *ctx,
> uint32_t inst)
>  {
> @@ -475,7 +475,7 @@ static const struct dce_i2c_mask i2c_masks = {
> I2C_COMMON_MASK_SH_LIST_DCE110(_MASK)
>  };
>
> -struct dce_i2c_hw *dce120_i2c_hw_create(
> +static struct dce_i2c_hw *dce120_i2c_hw_create(
> struct dc_context *ctx,
> uint32_t inst)
>  {
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 12/40] drm/amd/display/dc/dce120/Makefile: Ignore -Woverride-init warning

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> This file uses a complex abstracted set of hierarchical macros to
> setup its applicable register lists within constant structures.
> However in the case of TMDS_CNTL we wish to mark it as not applicable
> for this use-case.
>
> One method would be to de-const all of the definitions and users, then
> manually zero out TMDS_CNTL from the list.  Another would be to create
> a new set of hierarchical macros to omit TMDS_CNTL entirely.  Both
> would entail a great deal of unnecessary changes and maintenance
> burden.
>
> Instead, let's just silence the warning.
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
> warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:281:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
> note: (near initialization for ‘stream_enc_regs[0].TMDS_CNTL’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:281:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
> warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:282:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
> note: (near initialization for ‘stream_enc_regs[1].TMDS_CNTL’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:282:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
> warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:283:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
> note: (near initialization for ‘stream_enc_regs[2].TMDS_CNTL’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:283:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
> warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:284:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
> note: (near initialization for ‘stream_enc_regs[3].TMDS_CNTL’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:284:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
> warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:285:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
> note: (near initialization for ‘stream_enc_regs[4].TMDS_CNTL’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:285:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
> warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:286:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
> note: (near initialization for ‘stream_enc_regs[5].TMDS_CNTL’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:286:2: 
> note: in expansion of macro ‘stream_enc_regs’
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex


> ---
>  drivers/gpu/drm/amd/display/dc/dce120/Makefile | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce120/Makefile 
> b/drivers/gpu/drm/amd/display/dc/dce120/Makefile
> index 37db1f8d45ea5..a9cc4b73270bb 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce120/Makefile
> +++ b/drivers/gpu/drm/amd/display/dc/dce120/Makefile
> @@ -24,6 +24,8 @@
>  # It provides the control and status of HW CRTC block.
>
>
> +CFLAGS_$(AMDDALPATH)/dc/dce120/dce120_resource.o = $(call 
> cc-disable-warning, override-init)
> +
>  DCE120 = dce120_resource.o dce120_timing_generator.o \
>  dce120_hw_sequencer.o
>
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list

Re: [PATCH 11/40] drm/amd/display/dc/dce120/dce120_timing_generator:

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:101:6:
>  warning: no previous prototype for ‘dce120_timing_generator_validate_timing’ 
> [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:128:6:
>  warning: no previous prototype for ‘dce120_tg_validate_timing’ 
> [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:136:6:
>  warning: no previous prototype for ‘dce120_timing_generator_enable_crtc’ 
> [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:156:6:
>  warning: no previous prototype for 
> ‘dce120_timing_generator_set_early_control’ [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:169:10:
>  warning: no previous prototype for 
> ‘dce120_timing_generator_get_vblank_counter’ [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:184:6:
>  warning: no previous prototype for 
> ‘dce120_timing_generator_get_crtc_position’ [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:210:6:
>  warning: no previous prototype for ‘dce120_timing_generator_wait_for_vblank’ 
> [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:232:6:
>  warning: no previous prototype for 
> ‘dce120_timing_generator_wait_for_vactive’ [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:245:6:
>  warning: no previous prototype for 
> ‘dce120_timing_generator_setup_global_swap_lock’ [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:282:6:
>  warning: no previous prototype for 
> ‘dce120_timing_generator_tear_down_global_swap_lock’ [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:303:6:
>  warning: no previous prototype for 
> ‘dce120_timing_generator_enable_reset_trigger’ [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:350:6:
>  warning: no previous prototype for 
> ‘dce120_timing_generator_disable_reset_trigger’ [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:370:6:
>  warning: no previous prototype for 
> ‘dce120_timing_generator_did_triggered_reset_occur’ [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:387:6:
>  warning: no previous prototype for ‘dce120_timing_generator_disable_vga’ 
> [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:428:6:
>  warning: no previous prototype for 
> ‘dce120_timing_generator_program_blanking’ [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:488:6:
>  warning: no previous prototype for 
> ‘dce120_timing_generator_program_blank_color’ [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:501:6:
>  warning: no previous prototype for 
> ‘dce120_timing_generator_set_overscan_color_black’ [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:543:6:
>  warning: no previous prototype for ‘dce120_timing_generator_set_drr’ 
> [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:602:6:
>  warning: no previous prototype for ‘dce120_timing_generator_get_position’ 
> [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:635:6:
>  warning: no previous prototype for 
> ‘dce120_timing_generator_get_crtc_scanoutpos’ [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:664:6:
>  warning: no previous prototype for 
> ‘dce120_timing_generator_enable_advanced_request’ [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:702:6:
>  warning: no previous prototype for ‘dce120_tg_program_blank_color’ 
> [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:725:6:
>  warning: no previous prototype for ‘dce120_tg_set_overscan_color’ 
> [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:752:6:
>  warning: no previous prototype for ‘dce120_tg_is_blanked’ 
> [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:773:6:
>  warning: no previous prototype for ‘dce120_tg_set_blank’ 
> [-Wmissing-prototypes]
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:792:6:

Re: [PATCH 10/40] drm/amd/display/dc/dce120/dce120_hw_sequencer: Encompass defines in same clause as their use

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:19 PM Lee Jones  wrote:
>
> Ideally someone should strip-out all these garbage 'if 0's.
>
> Tempted to carry out the work myself on principle!
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_hw_sequencer.c:53:47: 
> warning: ‘reg_offsets’ defined but not used [-Wunused-const-variable=]
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/dce120/dce120_hw_sequencer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce120/dce120_hw_sequencer.c 
> b/drivers/gpu/drm/amd/display/dc/dce120/dce120_hw_sequencer.c
> index 66a13aa39c951..d4afe6c824d2c 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce120/dce120_hw_sequencer.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce120/dce120_hw_sequencer.c
> @@ -50,6 +50,7 @@ struct dce120_hw_seq_reg_offsets {
> uint32_t crtc;
>  };
>
> +#if 0
>  static const struct dce120_hw_seq_reg_offsets reg_offsets[] = {
>  {
> .crtc = (mmCRTC0_CRTC_GSL_CONTROL - mmCRTC0_CRTC_GSL_CONTROL),
> @@ -79,7 +80,6 @@ static const struct dce120_hw_seq_reg_offsets reg_offsets[] 
> = {
>  
> /***
>   * Private definitions
>   
> **/
> -#if 0
>  static void dce120_init_pte(struct dc_context *ctx, uint8_t controller_id)
>  {
> uint32_t addr;
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 09/40] drm/amd/display/dc/gpio/diagnostics/hw_factory_diag: Include our own header containing prototypes

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:19 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/diagnostics/hw_factory_diag.c:50:6:
>  warning: no previous prototype for ‘dal_hw_factory_diag_fpga_init’ 
> [-Wmissing-prototypes]
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex


> ---
>  .../gpu/drm/amd/display/dc/gpio/diagnostics/hw_factory_diag.c| 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git 
> a/drivers/gpu/drm/amd/display/dc/gpio/diagnostics/hw_factory_diag.c 
> b/drivers/gpu/drm/amd/display/dc/gpio/diagnostics/hw_factory_diag.c
> index df68430aeb0c2..c6e28f6bf1a27 100644
> --- a/drivers/gpu/drm/amd/display/dc/gpio/diagnostics/hw_factory_diag.c
> +++ b/drivers/gpu/drm/amd/display/dc/gpio/diagnostics/hw_factory_diag.c
> @@ -28,6 +28,7 @@
>   */
>
>  #include "dm_services.h"
> +#include "hw_factory_diag.h"
>  #include "include/gpio_types.h"
>  #include "../hw_factory.h"
>
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 08/40] drm/amd/display/dc/gpio/diagnostics/hw_factory_diag: Fix struct declared inside parameter list error

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:19 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/diagnostics/hw_factory_diag.h:30:43:
>  warning: ‘struct hw_factory’ declared inside parameter list will not be 
> visible outside of this definition or declaration
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/diagnostics/hw_factory_diag.h:30:6:
>  note: previous declaration of ‘dal_hw_factory_diag_fpga_init’ was here
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/diagnostics/hw_factory_diag.h:30:43:
>  warning: ‘struct hw_factory’ declared inside parameter list will not be 
> visible outside of this definition or declaration
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/diagnostics/hw_factory_diag.h:30:6:
>  note: previous declaration of ‘dal_hw_factory_diag_fpga_init’ was here
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/diagnostics/hw_factory_diag.h:30:43:
>  warning: ‘struct hw_factory’ declared inside parameter list will not be 
> visible outside of this definition or declaration
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/diagnostics/hw_factory_diag.h:30:6:
>  note: previous declaration of ‘dal_hw_factory_diag_fpga_init’ was here
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  .../gpu/drm/amd/display/dc/gpio/diagnostics/hw_factory_diag.h   | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git 
> a/drivers/gpu/drm/amd/display/dc/gpio/diagnostics/hw_factory_diag.h 
> b/drivers/gpu/drm/amd/display/dc/gpio/diagnostics/hw_factory_diag.h
> index 8a74f6adb8eee..bf68eb1d9a1d2 100644
> --- a/drivers/gpu/drm/amd/display/dc/gpio/diagnostics/hw_factory_diag.h
> +++ b/drivers/gpu/drm/amd/display/dc/gpio/diagnostics/hw_factory_diag.h
> @@ -26,6 +26,8 @@
>  #ifndef __DAL_HW_FACTORY_DIAG_FPGA_H__
>  #define __DAL_HW_FACTORY_DIAG_FPGA_H__
>
> +struct hw_factory;
> +
>  /* Initialize HW factory function pointers and pin info */
>  void dal_hw_factory_diag_fpga_init(struct hw_factory *factory);
>
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 07/40] drm/amd/display/dc/irq/irq_service: Make local function static

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:19 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/irq/irq_service.c:82:31: warning: 
> no previous prototype for ‘find_irq_source_info’ [-Wmissing-prototypes]
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Mauro Rossi 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/irq/irq_service.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/irq/irq_service.c 
> b/drivers/gpu/drm/amd/display/dc/irq/irq_service.c
> index 6bf27bde87240..5f245bde54ff7 100644
> --- a/drivers/gpu/drm/amd/display/dc/irq/irq_service.c
> +++ b/drivers/gpu/drm/amd/display/dc/irq/irq_service.c
> @@ -79,7 +79,7 @@ void dal_irq_service_destroy(struct irq_service 
> **irq_service)
> *irq_service = NULL;
>  }
>
> -const struct irq_source_info *find_irq_source_info(
> +static const struct irq_source_info *find_irq_source_info(
> struct irq_service *irq_service,
> enum dc_irq_source source)
>  {
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 06/40] drm/amd/display/dc/gpio/diagnostics/hw_translate_diag: Include our own header containing prototypes

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:19 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  
> drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/diagnostics/hw_translate_diag.c:37:6:
>  warning: no previous prototype for ‘dal_hw_translate_diag_fpga_init’ 
> [-Wmissing-prototypes]
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  .../gpu/drm/amd/display/dc/gpio/diagnostics/hw_translate_diag.c  | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git 
> a/drivers/gpu/drm/amd/display/dc/gpio/diagnostics/hw_translate_diag.c 
> b/drivers/gpu/drm/amd/display/dc/gpio/diagnostics/hw_translate_diag.c
> index bf90688469271..e5138a5a8eb5a 100644
> --- a/drivers/gpu/drm/amd/display/dc/gpio/diagnostics/hw_translate_diag.c
> +++ b/drivers/gpu/drm/amd/display/dc/gpio/diagnostics/hw_translate_diag.c
> @@ -24,6 +24,7 @@
>   */
>
>  #include "dm_services.h"
> +#include "hw_translate_diag.h"
>  #include "include/gpio_types.h"
>
>  #include "../hw_translate.h"
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 05/40] drm/amd/display/dc/dce/dce_transform: Demote kernel-doc abuse

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:19 PM Lee Jones  wrote:
>
> The header doesn't provide any additional parameter descriptions.
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_transform.c:1104: warning: 
> Cannot understand  
> *
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Mauro Rossi 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/dce/dce_transform.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c 
> b/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c
> index 6121bb7b009b8..abbaa6b0b2db9 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c
> @@ -1100,7 +1100,7 @@ static void program_gamut_remap(
>
>  }
>
> -/**
> +/*
>   
> *
>   *  Function: dal_transform_wide_gamut_set_gamut_remap
>   *
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 04/40] drm/amd/display/dc/dce/dce_opp: Demote non-compliant kernel-doc headers

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:19 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:109: warning: 
> Function parameter or member 'opp110' not described in 'set_truncation'
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:109: warning: 
> Function parameter or member 'params' not described in 'set_truncation'
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:154: warning: 
> Function parameter or member 'opp110' not described in 'dce60_set_truncation'
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:154: warning: 
> Function parameter or member 'params' not described in 'dce60_set_truncation'
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:204: warning: 
> Function parameter or member 'opp110' not described in 'set_spatial_dither'
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:204: warning: 
> Function parameter or member 'params' not described in 'set_spatial_dither'
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:308: warning: 
> Function parameter or member 'opp110' not described in 'set_temporal_dither'
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:308: warning: 
> Function parameter or member 'params' not described in 'set_temporal_dither'
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:370: warning: 
> Function parameter or member 'opp110' not described in 
> 'dce110_opp_set_clamping'
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:370: warning: 
> Function parameter or member 'params' not described in 
> 'dce110_opp_set_clamping'
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:430: warning: 
> Function parameter or member 'opp110' not described in 
> 'dce60_opp_set_clamping'
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:430: warning: 
> Function parameter or member 'params' not described in 
> 'dce60_opp_set_clamping'
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:478: warning: 
> Function parameter or member 'opp110' not described in 'set_pixel_encoding'
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:478: warning: 
> Function parameter or member 'params' not described in 'set_pixel_encoding'
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:514: warning: 
> Function parameter or member 'opp110' not described in 
> 'dce60_set_pixel_encoding'
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:514: warning: 
> Function parameter or member 'params' not described in 
> 'dce60_set_pixel_encoding'
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Mauro Rossi 
> Cc: Lee Jones 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/dce/dce_opp.c | 16 
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c 
> b/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
> index 2bf8f5a2e0c22..4600231da6cbb 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
> @@ -97,7 +97,7 @@ enum {
>
>
>
> -/**
> +/*
>   * set_truncation
>   * 1) set truncation depth: 0 for 18 bpp or 1 for 24 bpp
>   * 2) enable truncation
> @@ -142,7 +142,7 @@ static void set_truncation(
>  }
>
>  #if defined(CONFIG_DRM_AMD_DC_SI)
> -/**
> +/*
>   * dce60_set_truncation
>   * 1) set truncation depth: 0 for 18 bpp or 1 for 24 bpp
>   * 2) enable truncation
> @@ -183,7 +183,7 @@ static void dce60_set_truncation(
>  }
>  #endif
>
> -/**
> +/*
>   * set_spatial_dither
>   * 1) set spatial dithering mode: pattern of seed
>   * 2) set spatial dithering depth: 0 for 18bpp or 1 for 24bpp
> @@ -291,7 +291,7 @@ static void set_spatial_dither(
> FMT_SPATIAL_DITHER_EN, 1);
>  }
>
> -/**
> +/*
>   * SetTemporalDither (Frame Modulation)
>   * 1) set temporal dither depth
>   * 2) select pattern: from hard-coded pattern or programmable pattern
> @@ -355,7 +355,7 @@ static void set_temporal_dither(
> FMT_TEMPORAL_DITHER_EN, 1);
>  }
>
> -/**
> +/*
>   * Set Clamping
>   * 1) Set clamping format based on bpc - 0 for 6bpc (No clamping)
>   * 1 for 8 bpc
> @@ -415,7 +415,7 @@ void dce110_opp_set_clamping(
>  }
>
>  #if defined(CONFIG_DRM_AMD_DC_SI)
> -/**
> +/*
>   * Set Clamping for DCE6 parts
>   * 1) Set clamping format based on bpc - 0 for 6bpc (No clamping)
>   * 1 for 8 bpc
> @@ -465,7 +465,7 @@ static void dce60_opp_set_clamping(
>  }
>  #endif
>
> -/**
> +/*
>   * set_pixel_encoding
>   *
>   * Set Pixel Encoding
> @@ -501,7 +501,7 @@ static void set_pixel_encoding(
>  }
>
>  #if defined(CONFIG_DRM_AMD_DC_SI)
> -/**
> +/*
>   * dce60_set_pixel_encoding
>   * DCE6 has no 

Re: [PATCH 02/40] drm/amd/display/dc/dce/dce_link_encoder: Remove unused variable 'value0'

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:19 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_link_encoder.c: In function 
> ‘dce110_link_encoder_update_mst_stream_allocation_table’:
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_link_encoder.c:1506:11: 
> warning: variable ‘value0’ set but not used [-Wunused-but-set-variable]
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Mauro Rossi 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c 
> b/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c
> index 0ef2f4d9d8bf3..1e77ffee71b30 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c
> @@ -1503,7 +1503,6 @@ void 
> dce110_link_encoder_update_mst_stream_allocation_table(
> const struct link_mst_stream_allocation_table *table)
>  {
> struct dce110_link_encoder *enc110 = TO_DCE110_LINK_ENC(enc);
> -   uint32_t value0 = 0;
> uint32_t value1 = 0;
> uint32_t value2 = 0;
> uint32_t slots = 0;
> @@ -1604,7 +1603,7 @@ void 
> dce110_link_encoder_update_mst_stream_allocation_table(
> do {
> udelay(10);
>
> -   value0 = REG_READ(DP_MSE_SAT_UPDATE);
> +   REG_READ(DP_MSE_SAT_UPDATE);
>
> REG_GET(DP_MSE_SAT_UPDATE,
> DP_MSE_SAT_UPDATE, );
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 01/40] drm/amd/display/dc/dce/dce_aux: Mark 'dce_aux_transfer_raw' as __maybe_unused

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:19 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c: In function 
> ‘dce_aux_transfer_raw’:
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c:579:7: warning: 
> variable ‘bytes_replied’ set but not used [-Wunused-but-set-variable]
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c 
> b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
> index 3204292a5aeae..d51b5fe91287d 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
> @@ -576,7 +576,7 @@ int dce_aux_transfer_raw(struct ddc_service *ddc,
> *operation_result = get_channel_status(aux_engine, _bytes);
>
> if (*operation_result == AUX_CHANNEL_OPERATION_SUCCEEDED) {
> -   int bytes_replied = 0;
> +   int __maybe_unused bytes_replied = 0;
> bytes_replied = read_channel_reply(aux_engine, 
> payload->length,
>  payload->data, payload->reply,
>  );
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm: amdgpu: pm: Mark vangogh_clk_dpm_is_enabled() as static

2021-01-12 Thread Alex Deucher
On Tue, Jan 12, 2021 at 3:23 PM Souptick Joarder  wrote:
>
> kernel test robot throws below warnings ->
>
> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c:594:6:
> warning: no previous prototype for 'vangogh_clk_dpm_is_enabled'
> [-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c:594:6:
> warning: no previous prototype for function 'vangogh_clk_dpm_is_enabled'
> [-Wmissing-prototypes]
>
> Mark vangogh_clk_dpm_is_enabled() as static.
>
> Reported-by: kernel test robot 
> Signed-off-by: Souptick Joarder 

Applied.  Thanks!

Alex


> ---
>  drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c 
> b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> index 75ddcad..3ffe56e 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> @@ -610,7 +610,7 @@ static int vangogh_get_profiling_clk_mask(struct 
> smu_context *smu,
> return 0;
>  }
>
> -bool vangogh_clk_dpm_is_enabled(struct smu_context *smu,
> +static bool vangogh_clk_dpm_is_enabled(struct smu_context *smu,
> enum smu_clk_type clk_type)
>  {
> enum smu_feature_mask feature_id = 0;
> --
> 1.9.1
>
> ___
> amd-gfx mailing list
> amd-...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 1/1] drm/amdgpu: Remove unused variable

2021-01-12 Thread Alex Deucher
On Tue, Jan 12, 2021 at 12:46 PM Nirmoy Das  wrote:
>
> Remove unused space_needed variable.
>
> Fixes: 453f617a30a ("drm/amdgpu: Resize BAR0 to the maximum available size, 
> even if it doesn't cover VRAM")
> Signed-off-by: Nirmoy Das 

Reviewed-by: Alex Deucher 

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 348ac678a230..5888367b1000 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -1106,7 +1106,6 @@ void amdgpu_device_wb_free(struct amdgpu_device *adev, 
> u32 wb)
>   */
>  int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
>  {
> -   u64 space_needed = roundup_pow_of_two(adev->gmc.real_vram_size);
> int rbar_size = pci_rebar_bytes_to_size(adev->gmc.real_vram_size);
> struct pci_bus *root;
> struct resource *res;
> --
> 2.29.2
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH V5 0/3] Decouple config data for configfs

2021-01-12 Thread Melissa Wen
On 01/12, Sumera Priyadarsini wrote:
> This patchset aims to lay down some prep work before configfs can be
> implemented for the vkms driver. The first patch in the series adds a
> new type vkms_config to track device configuration. The second and third
> patch add module testing support for writeback operations.
> 
> The first patch is developed by Daniel Vetter.
> 
> Daniel Vetter (1):
>   drm/vkms: Add vkms_config type
> 
> Sumera Priyadarsini (3):
>   drm/vkms: Add vkms_config type
>   drm/vkms: Add support for writeback module
>   drm/vkms: Add information about module options
> 
>  Documentation/gpu/vkms.rst | 12 
>  drivers/gpu/drm/vkms/vkms_drv.c| 45 --
>  drivers/gpu/drm/vkms/vkms_drv.h| 13 +++--
>  drivers/gpu/drm/vkms/vkms_output.c | 13 +
>  4 files changed, 68 insertions(+), 15 deletions(-)

Applied to drm-misc-next.
I fixed the extra line issue while applying.

Thanks for your patches,

Melissa

> 
> ---
> Changes in v2:
>  - add Co-developed-by tag
>  
> Changes in v3:
>  - correct usage of Co-developed by tag(Melissa)
>  - add enable_writeback_feature(Melissa)
>  - modify commit message(Melissa)
> 
> Changes in v4:
>  - split previous patch into patchset(Melissa)
>  - fix checkpatch issue(Melissa)
>  - update docs(Daniel)
> 
> Changes in v5:
>  - modify docs patch(Daniel)
> -- 
> 2.25.1
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v7 00/17] follow_pfn and other iomap races

2021-01-12 Thread Stephen Rothwell
Hi Daniel,

On Tue, 12 Jan 2021 14:24:27 +0100 Daniel Vetter  wrote:
> 
> As Jason suggested, I've pulled the first 1 patches into a topic branch.
> 
> Stephen, can you please add the below to linux-next for the 5.12 merge
> window?
> 
> git://anongit.freedesktop.org/drm/drm topic/iomem-mmap-vs-gup

Added from today.

Thanks for adding your subsystem tree as a participant of linux-next.  As
you may know, this is not a judgement of your code.  The purpose of
linux-next is for integration testing and to lower the impact of
conflicts between subsystems in the next merge window. 

You will need to ensure that the patches/commits in your tree/series have
been:
 * submitted under GPL v2 (or later) and include the Contributor's
Signed-off-by,
 * posted to the relevant mailing list,
 * reviewed by you (or another maintainer of your subsystem tree),
 * successfully unit tested, and 
 * destined for the current or next Linux merge window.

Basically, this should be just what you would send to Linus (or ask him
to fetch).  It is allowed to be rebased if you deem it necessary.

-- 
Cheers,
Stephen Rothwell 
s...@canb.auug.org.au


pgpzIoTEacOOY.pgp
Description: OpenPGP digital signature
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Reboot crash at msm_atomic_commit_tail

2021-01-12 Thread Fabio Estevam
Hi,

I have noticed that on an imx53-qsb, it is no longer possible to
reboot the system as it fails like this:

Requesting system reboot
[   23.819116] cfg80211: failed to load regulatory.db
[   23.827569] imx-sdma 63fb.sdma: external firmware not found,
using ROM firmware
[   23.956838] ci_hdrc ci_hdrc.0: remove, state 1
[   23.968029] usb usb1: USB disconnect, device number 1
[   23.976033] usb 1-1: USB disconnect, device number 2
[   24.234253] ci_hdrc ci_hdrc.0: USB bus 1 deregistered
[   24.268964] 8<--- cut here ---
[   24.274602] Unable to handle kernel NULL pointer dereference at
virtual address 
[   24.283434] pgd = (ptrval)
[   24.286387] [] *pgd=ca212831
[   24.290788] Internal error: Oops: 17 [#1] SMP ARM
[   24.295609] Modules linked in:
[   24.298777] CPU: 0 PID: 197 Comm: init Not tainted
5.11.0-rc2-next-20210111 #333
[   24.306276] Hardware name: Freescale i.MX53 (Device Tree Support)
[   24.312442] PC is at msm_atomic_commit_tail+0x54/0xb9c
[   24.317743] LR is at commit_tail+0xa4/0x1b0
[   24.322032] pc : []lr : []psr: 6013
[   24.328374] sp : c28d1d50  ip : c23a3000  fp : 
[   24.333670] r10: c2816780  r9 : c12d71c0  r8 : c17fb018
[   24.338967] r7 : c23a3000  r6 : c2816780  r5 :   r4 : 
[   24.345572] r3 : c24c2c00  r2 : c23a3000  r1 : c0769b24  r0 : 
[   24.352177] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[   24.359407] Control: 10c5387d  Table: 72858019  DAC: 0051
[   24.365220] Process init (pid: 197, stack limit = 0x(ptrval))
[   24.371052] Stack: (0xc28d1d50 to 0xc28d2000)
[   24.375508] 1d40: 
 9682f000 0005
[   24.383794] 1d60: 3031e53d  0dc0 c0f816d8 c23a3000
c23a3000  c17fb018
[   24.392079] 1d80: c12d71c0 c2816780  c06db0b4 a5f7faba
0005  c2816780
[   24.400363] 1da0:  c23a3000  c17fb018 c12d71c0
c24c20a0  c06dbed0
[   24.408647] 1dc0:   c2816780 c23a349c c2816780
c28d1dfc c23a34a4 c06db604
[   24.416932] 1de0: c23a3000  c1609388 c12ba9dc c17fb018
c06db704 c2965e80 c2965e80
[   24.425214] 1e00: 0008 0001   c175f454
 c175f458 c1c669cc
[   24.433498] 1e20:  c12bebb8  0001 0008
 c23a32ec c23a32ec
[   24.441783] 1e40:  433f193b c24c2014 c24c2014 c24c2010
c17674c8 c1e68bec c07c76e8
[   24.450067] 1e60:  c16158d8 c1609388 fee1dead 
c28d 0058 c0153730
[   24.458350] 1e80: 01234567 c01539d4 fffe  
  
[   24.466633] 1ea0:     
  c1609388
[   24.474917] 1ec0: c29663c8   c0e17954 e000
 0001 
[   24.483200] 1ee0: c1609388 c1609388 c16093d4 433f193b 
c1581584 e000 1ea51000
[   24.491485] 1f00: 0001 0080 c1609388 c1609794 c29663c8
  c0e17954
[   24.499769] 1f20:    c1609388 c1609388
c16093d4  c1609388
[   24.508054] 1f40: c29663c8 c0183f24 c2965e80 c1609388 0001
c1609794 c2995090 c018ce7c
[   24.516337] 1f60: 0001 c2995080 c0136e80 c010012c 
0001 c158b21c c0e22334
[   24.524622] 1f80: c158b21c c010019c c1609794 433f193b 
beefefd4 0001 0058
[   24.532907] 1fa0: c0100264 c0100080  beefefd4 fee1dead
28121969 01234567 
[   24.541191] 1fc0:  beefefd4 0001 0058 
 b6f1ef74 
[   24.549476] 1fe0: 000d7298 beefed40 00091a48 b6e8894c 6010
fee1dead  
[   24.557742] [] (msm_atomic_commit_tail) from []
(commit_tail+0xa4/0x1b0)
[   24.566349] [] (commit_tail) from []
(drm_atomic_helper_commit+0x154/0x188)
[   24.575193] [] (drm_atomic_helper_commit) from
[] (drm_atomic_helper_disable_all+0x154/0x1c0)
[   24.585599] [] (drm_atomic_helper_disable_all) from
[] (drm_atomic_helper_shutdown+0x94/0x12c)
[   24.596094] [] (drm_atomic_helper_shutdown) from
[] (device_shutdown+0x118/0x250)
[   24.605475] [] (device_shutdown) from []
(kernel_restart+0xc/0x68)
[   24.613574] [] (kernel_restart) from []
(__do_sys_reboot+0x144/0x200)
[   24.621915] [] (__do_sys_reboot) from []
(ret_fast_syscall+0x0/0x2c)
[   24.630160] Exception stack(0xc28d1fa8 to 0xc28d1ff0)
[   24.635315] 1fa0:    beefefd4 fee1dead
28121969 01234567 
[   24.643600] 1fc0:  beefefd4 0001 0058 
 b6f1ef74 
[   24.651867] 1fe0: 000d7298 beefed40 00091a48 b6e8894c
[   24.657025] Code: 1592208c 1185521c e153 1af8 (e5942000)
[   24.663681] ---[ end trace 9a1e129deec83f42 ]---
[   25.670432] Kernel panic - not syncing: Attempted to kill init!
exitcode=0x
[   25.678331] ---[ end Kernel panic - not syncing: Attempted to kill
init! exitcode=0x ]---

It happens on 5.4 as well as 5.11-rc2.

Any ideas?

Thanks,

Fabio Estevam

Re: [PATCH] drm/bridge: ti-sn65dsi86: rename GPIO register bits

2021-01-12 Thread Uwe Kleine-König
On Mon, Jan 11, 2021 at 02:25:37PM -0800, Doug Anderson wrote:
> Hi,
> 
> On Mon, Jan 11, 2021 at 2:16 PM Doug Anderson  wrote:
> >
> > Hi,
> >
> > On Thu, Dec 10, 2020 at 12:19 AM Shawn Guo  wrote:
> > >
> > > From: Shawn Guo 
> > >
> > > It renames GPIO register bits to drop 'SN_' prefix, so that they are
> > > consistent to other definitions - prefixing register name with 'SN_' but
> > > not for bit fields.
> > >
> > > Signed-off-by: Shawn Guo 
> > > ---
> > >  drivers/gpu/drm/bridge/ti-sn65dsi86.c | 26 +-
> > >  1 file changed, 13 insertions(+), 13 deletions(-)
> >
> > Sorry for taking so long to get back to this.  I think it came into my
> > inbox at the same time as a pile of other things and then got lost.
> > Your change looks good to me.  Sorry for being inconsistent when
> > adding those defines and thanks for fixing them!
> >
> > Reviewed-by: Douglas Anderson 
> 
> Hrm, I just caught up on more email and found that in:
> 
> https://lore.kernel.org/r/20201210174338.kecryijwptzc2...@pengutronix.de
> 
> ...that Uwe would prefer to keep these bits what I have and change all
> the others.  ;-)  I don't have a strong opinion either way, but I
> definitely agree that it'd be better for all the defines to be
> consistent.  If I had to arbitrarily make the decision one way or the
> other I'd probably land Shawn's patch but I certainly wouldn't object
> if we went Uwe's way either.  :-P

For the the relevant argument for prefixes is that tools like ctags and
cscope work more reliable. Take for example the name TX_TIMEOUT. There
are around 60 symbols with that name in the kernel tree. This is quite
annoying if you want to jump from a certain use to its definition.

Best regards
Uwe

-- 
Pengutronix e.K.   | Uwe Kleine-König|
Industrial Linux Solutions | https://www.pengutronix.de/ |


signature.asc
Description: PGP signature
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 5.11 regression fix] drm/ttm: fix combining __GFP_HIGHMEM and __GFP_DMA32 flag for DMA32 pools

2021-01-12 Thread Hans de Goede
GFP_TRANSHUGE_LIGHT includes __GFP_HIGHMEM and combining
__GFP_HIGHMEM with __GFP_DMA32 is not allowed.

So we must not set add GFP_TRANSHUGE_LIGHT to the gfp_flags when
allocating pages from a dma32 pool.

This fixes the following oops when using a driver which uses DMA32
pools such as the vboxvideo driver:

[  419.852194] [ cut here ]
[  419.852200] kernel BUG at include/linux/gfp.h:457!
[  419.852208] invalid opcode:  [#4] SMP PTI
[  419.852212] CPU: 0 PID: 1522 Comm: Xorg Tainted: G  D   
5.11.0-rc2+ #187
[  419.852214] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS 
VirtualBox 12/01/2006
[  419.852216] RIP: 0010:__alloc_pages_nodemask+0x31a/0x3d0
[  419.85] Code: 00 00 8b 05 a8 3b 93 01 85 c0 0f 85 03 fe ff ff 89 e8 44 
89 fa c1 e8 03 80 ca 80 83 e0 03 83 f8 01 44 0f 44 fa e9 e9 fd ff ff <0f> 0b 0f 
0b e9 79 fd ff ff 31 c0 e9 88 fd ff ff e8 41 ad fb ff 48
[  419.852224] RSP: :b1164096bc60 EFLAGS: 00010247
[  419.852227] RAX:  RBX:  RCX: e8e8
[  419.852229] RDX:  RSI: 0006 RDI: 00192dc6
[  419.852230] RBP: 00192dc6 R08:  R09: 
[  419.852232] R10: 0017 R11: 7ff303d0a000 R12: 0009
[  419.852233] R13: 0009 R14: 8be4cafe0880 R15: 8be5c26fe000
[  419.852235] FS:  7ff3046e0f00() GS:8be5dbc0() 
knlGS:
[  419.852237] CS:  0010 DS:  ES:  CR0: 80050033
[  419.852239] CR2: 7ff303d0a000 CR3: 0afd8004 CR4: 000706f0
[  419.852243] DR0:  DR1:  DR2: 
[  419.852244] DR3:  DR6: fffe0ff0 DR7: 0400
[  419.852246] Call Trace:
[  419.852252]  ttm_pool_alloc+0x2e8/0x5f0 [ttm]
[  419.852261]  ttm_tt_populate+0x9f/0xe0 [ttm]
[  419.852267]  ttm_bo_vm_fault_reserved+0x236/0x6e0 [ttm]
[  419.852274]  ttm_bo_vm_fault+0x4a/0xe0 [ttm]
[  419.852279]  __do_fault+0x37/0x110
[  419.852283]  handle_mm_fault+0x1493/0x1990
[  419.852288]  do_user_addr_fault+0x1c7/0x4c0
[  419.852292]  exc_page_fault+0x67/0x250
[  419.852295]  ? asm_exc_page_fault+0x8/0x30
[  419.852299]  asm_exc_page_fault+0x1e/0x30
[  419.852301] RIP: 0033:0x7ff304f3cdf8
[  419.852304] Code: 83 c0 04 83 fa 03 7e ea a8 0f 75 ee 83 fa 7f 7e e1 83 c2 
80 89 d6 c1 ee 07 8d 4e 01 48 c1 e1 07 48 01 c1 0f 1f 80 00 00 00 00 <0f> 29 00 
48 83 e8 80 0f 29 40 90 0f 29 40 a0 0f 29 40 b0 0f 29 40
[  419.852306] RSP: 002b:7ffec360e7d8 EFLAGS: 00010206
[  419.852308] RAX: 7ff303d0a000 RBX: 02e2 RCX: 7ff303d0b300
[  419.852309] RDX: 12c0 RSI: 0025 RDI: 
[  419.852311] RBP: 1340 R08:  R09: 
[  419.852312] R10: 7ff303d0a000 R11: 1340 R12: 7ff303d0a000
[  419.852313] R13: 556665f1eb30 R14:  R15: 
[  419.852318] Modules linked in: xt_CHECKSUM xt_MASQUERADE xt_conntrack 
ipt_REJECT nf_nat_tftp nf_conntrack_tftp tun bridge stp llc nft_objref 
nf_conntrack_netbios_ns nf_conntrack_broadcast nft_fib_inet nft_fib_ipv4 
nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject 
nft_ct nft_chain_nat rfkill ip6table_nat ip6table_mangle ip6table_raw 
ip6table_security iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 
iptable_mangle iptable_raw iptable_security ip_set nf_tables vboxsf nfnetlink 
ip6table_filter ip6_tables iptable_filter sunrpc vfat fat intel_rapl_msr joydev 
intel_rapl_common intel_powerclamp crct10dif_pclmul crc32_pclmul 
ghash_clmulni_intel snd_intel8x0 rapl snd_ac97_codec ac97_bus snd_seq 
snd_seq_device snd_pcm pcspkr snd_timer snd soundcore i2c_piix4 vboxguest 
ip_tables vboxvideo drm_vram_helper drm_kms_helper cec drm_ttm_helper ttm 
crc32c_intel serio_raw e1000 drm drm_privacy_screen_helper ata_generic 
pata_acpi video fuse
[  419.852375] ---[ end trace 511e5346897d9526 ]---

Note in case of the vboxvideo driver the DMA32 pool is allocated through
drm_vram_helper_alloc_mm() which is also used by the bochs and
hisilicon/hibmc drivers.

Cc: Christian König 
Fixes: d099fc8f540a ("drm/ttm: new TT backend allocation pool v3")
Signed-off-by: Hans de Goede 
---
 drivers/gpu/drm/ttm/ttm_pool.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
index 7b2f60616750..8b32fd8c8ccc 100644
--- a/drivers/gpu/drm/ttm/ttm_pool.c
+++ b/drivers/gpu/drm/ttm/ttm_pool.c
@@ -80,8 +80,9 @@ static struct page *ttm_pool_alloc_page(struct ttm_pool 
*pool, gfp_t gfp_flags,
void *vaddr;
 
if (order) {
-   gfp_flags |= GFP_TRANSHUGE_LIGHT | __GFP_NORETRY |
-   __GFP_KSWAPD_RECLAIM;
+   if (!pool->use_dma32)
+   gfp_flags |= GFP_TRANSHUGE_LIGHT;
+   gfp_flags |= 

RE: [PATCH v16 0/4] RDMA: Add dma-buf support

2021-01-12 Thread Xiong, Jianxin
 -Original Message-
> From: Yishai Hadas 
> Sent: Tuesday, January 12, 2021 4:49 AM
> To: Xiong, Jianxin ; Alex Deucher 
> 
> Cc: Jason Gunthorpe ; Leon Romanovsky ; 
> linux-r...@vger.kernel.org; dri-devel@lists.freedesktop.org;
> Doug Ledford ; Vetter, Daniel ; 
> Christian Koenig ; Yishai
> Hadas 
> Subject: Re: [PATCH v16 0/4] RDMA: Add dma-buf support
> 
> On 1/11/2021 7:55 PM, Xiong, Jianxin wrote:
> >> -Original Message-
> >> From: Alex Deucher 
> >> Sent: Monday, January 11, 2021 9:47 AM
> >> To: Xiong, Jianxin 
> >> Cc: Jason Gunthorpe ; Leon Romanovsky
> >> ; linux-r...@vger.kernel.org;
> >> dri-devel@lists.freedesktop.org; Doug Ledford ;
> >> Vetter, Daniel ; Christian Koenig
> >> 
> >> Subject: Re: [PATCH v16 0/4] RDMA: Add dma-buf support
> >>
> >> On Mon, Jan 11, 2021 at 12:44 PM Xiong, Jianxin  
> >> wrote:
>  -Original Message-
>  From: Jason Gunthorpe 
>  Sent: Monday, January 11, 2021 7:43 AM
>  To: Xiong, Jianxin 
>  Cc: linux-r...@vger.kernel.org; dri-devel@lists.freedesktop.org;
>  Doug Ledford ; Leon Romanovsky
>  ; Sumit Semwal ;
>  Christian Koenig ; Vetter, Daniel
>  
>  Subject: Re: [PATCH v16 0/4] RDMA: Add dma-buf support
> 
>  On Mon, Jan 11, 2021 at 03:24:18PM +, Xiong, Jianxin wrote:
> > Jason, will this series be able to get into 5.12?
>  I was going to ask you where things are after the break?
> 
>  Did everyone agree the userspace stuff is OK now? Is Edward OK with
>  the pyverbs changes, etc
> 
> >>> There is no new comment on the both the kernel and userspace series.
> >>> I assume silence means no objection. I will ask for opinions on the 
> >>> userspace thread.
> >> Do you have a link to the userspace thread?
> >>
> > https://www.spinics.net/lists/linux-rdma/msg98135.html
> >
> Any reason why the 'fork' comment that was given few times wasn't not handled 
> / answered ?
> 
> Specifically,
> 
> ibv_reg_dmabuf_mr() doesn't call ibv_dontfork_range() but ibv_dereg_mr does 
> call its opposite API (i.e. ibv_dofork_range())
> 

Sorry, that part was missed. Strangely enough, a few of your replies didn't 
reach my inbox and I just found them in the web archives:  
https://www.spinics.net/lists/linux-rdma/msg97973.html, and 
https://www.spinics.net/lists/linux-rdma/msg98133.html

I will add check to ibv_dereg_mr() to avoid calling ibv_ibv_dofork_range() for 
dmabuf case.

Thanks a lot for bring this up again.

Jianxin
  


___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PULL] drm-intel-next

2021-01-12 Thread Rodrigo Vivi
Hi Dave and Daniel,

A very short collection of patches, mostly with display fixes. Plus GVT.
The goal is to get both drm-intel-next and drm-intel-gt-next in sync again
through drm-next backports so we can continue with ADL enabling in a topic
branch.

Please be aware that there's a drm only patch here:
commit 7d8ac172d7f1 ("drm: Add function to convert rect in 16.16 fixed format 
to regular format")

Here goes drm-intel-next-2021-01-12:
- PSR fixes and improvements for selective fetch (Jose)
- GVT build fixed and cleanup (Jani)
- RKL display fixes (Lee, Matt)
- DSI fix (Hans)
- Panel Power and Backlight fixes (Anshuman, Jani)
- RPM fix (Chris)
- Fix HTI port checking (Jose)
- Clean-up in cursor code (Ville)
- Once again, trying to use fast+narrow link on eDP (Ville)
- DG1 display fix (Matt)

Thanks,
Rodrigo.

The following changes since commit cb3cfbf79aff7decb4e5ee69a7c74864497f61dc:

  Merge tag 'drm-misc-next-2021-01-06' of 
git://anongit.freedesktop.org/drm/drm-misc into drm-next (2021-01-07 13:40:20 
+0100)

are available in the Git repository at:

  git://anongit.freedesktop.org/drm/drm-intel tags/drm-intel-next-2021-01-12

for you to fetch changes up to cce73665eae238791f4342b29ca54188227717c8:

  drm/i915/dg1: Update voltage swing tables for DP (2021-01-11 19:20:18 -0800)


- PSR fixes and improvements for selective fetch (Jose)
- GVT build fixed and cleanup (Jani)
- RKL display fixes (Lee, Matt)
- DSI fix (Hans)
- Panel Power and Backlight fixes (Anshuman, Jani)
- RPM fix (Chris)
- Fix HTI port checking (Jose)
- Clean-up in cursor code (Ville)
- Once again, trying to use fast+narrow link on eDP (Ville)
- DG1 display fix (Matt)


Anshuman Gupta (1):
  drm/i915/pps: Reuse POWER_DOMAIN_DISPLAY_CORE in pps_{lock, unlock}

Chris Wilson (1):
  drm/i915: Disable RPM wakeref assertions during driver shutdown

Hans de Goede (1):
  drm/i915/dsi: Use unconditional msleep for the panel_on_delay when there 
is no reset-deassert MIPI-sequence

Jani Nikula (10):
  drm/i915/gvt: avoid useless use of inline
  drm/i915/gvt: make execlist.h self-contained
  drm/i915/gvt: make fb_decoder.h self-contained
  drm/i915/gvt: make gtt.h self-contained
  drm/i915/gvt: make interrupt.h self-contained
  drm/i915/gvt: make mmio_context.h self-contained
  drm/i915/gvt: make gvt.h self-contained
  drm/i915/gvt: make scheduler.h self-contained
  drm/i915/gvt: make mpt.h self-contained
  drm/i915/backlight: fix CPU mode backlight takeover on LPT

José Roberto de Souza (5):
  drm: Add function to convert rect in 16.16 fixed format to regular format
  drm/i915/display/psr: Use plane damage clips to calculate damaged area
  drm/i915/display: Split and export main surface calculation from 
skl_check_main_surface()
  drm/i915/display/psr: Program plane's calculated offset to plane SF 
register
  drm/i915: Fix HTI port checking

Lee Shawn C (1):
  drm/i915/rkl: new rkl ddc map for different PCH

Matt Roper (2):
  drm/i915/rkl: Add DP vswing programming tables
  drm/i915/dg1: Update voltage swing tables for DP

Rodrigo Vivi (2):
  Merge tag 'gvt-next-fixes-2020-12-25' of 
https://github.com/intel/gvt-linux into drm-intel-next
  Merge drm/drm-next into drm-intel-next

Ville Syrjälä (2):
  drm/i915: Fix checkpatch warns in cursor code
  drm/i915: Try to use fast+narrow link on eDP again and fall back to the 
old max strategy on failure

 drivers/gpu/drm/i915/Makefile  |  10 +-
 drivers/gpu/drm/i915/display/intel_bios.c  |  10 ++
 drivers/gpu/drm/i915/display/intel_cursor.c|   6 +-
 drivers/gpu/drm/i915/display/intel_ddi.c   |  79 -
 drivers/gpu/drm/i915/display/intel_display.c   |  78 -
 drivers/gpu/drm/i915/display/intel_display.h   |   2 +
 drivers/gpu/drm/i915/display/intel_display_types.h |   1 +
 drivers/gpu/drm/i915/display/intel_dp.c|  83 +++---
 drivers/gpu/drm/i915/display/intel_panel.c |   9 +-
 drivers/gpu/drm/i915/display/intel_psr.c   | 127 ++---
 drivers/gpu/drm/i915/display/intel_vbt_defs.h  |   2 +
 drivers/gpu/drm/i915/display/vlv_dsi.c |  16 ++-
 drivers/gpu/drm/i915/gvt/execlist.h|   3 -
 drivers/gpu/drm/i915/gvt/fb_decoder.h  |   6 +-
 drivers/gpu/drm/i915/gvt/gtt.h |  11 +-
 drivers/gpu/drm/i915/gvt/gvt.h |   4 +
 drivers/gpu/drm/i915/gvt/handlers.c|   3 +-
 drivers/gpu/drm/i915/gvt/interrupt.h   |   5 +-
 drivers/gpu/drm/i915/gvt/mmio_context.h|  11 ++
 drivers/gpu/drm/i915/gvt/mpt.h |   2 +
 drivers/gpu/drm/i915/gvt/scheduler.h   |   5 +
 drivers/gpu/drm/i915/i915_drv.c|   4 +
 

Re: [PATCH] drm/i915/hdcp: Disable the QSES check for HDCP 1.4 over MST

2021-01-12 Thread Jani Nikula


Anshuman, please review.

BR,
Jani.

On Wed, 06 Jan 2021, Sean Paul  wrote:
> From: Sean Paul 
>
> The HDCP 1.4 spec does not require the QUERY_STREAM_ENCRYPTION_STATUS
> check, it was always a nice-to-have. After deploying this across various
> devices, we've determined that some MST bridge chips do not properly
> support this call for HDCP 1.4 (namely Synaptics and Realtek).
>
> I had considered creating a quirk for this, but I think it's more
> prudent to just disable the check entirely since I don't have an idea
> how widespread support is.
>
> Signed-off-by: Sean Paul 
> ---
>  drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 26 +---
>  1 file changed, 1 insertion(+), 25 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c 
> b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> index 03424d20e9f7..b6a9606bf09a 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> @@ -640,30 +640,6 @@ intel_dp_mst_hdcp_toggle_signalling(struct 
> intel_digital_port *dig_port,
>   return ret;
>  }
>  
> -static
> -bool intel_dp_mst_hdcp_check_link(struct intel_digital_port *dig_port,
> -   struct intel_connector *connector)
> -{
> - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
> - struct intel_dp *intel_dp = _port->dp;
> - struct drm_dp_query_stream_enc_status_ack_reply reply;
> - int ret;
> -
> - if (!intel_dp_hdcp_check_link(dig_port, connector))
> - return false;
> -
> - ret = drm_dp_send_query_stream_enc_status(_dp->mst_mgr,
> -   connector->port, );
> - if (ret) {
> - drm_dbg_kms(>drm,
> - "[CONNECTOR:%d:%s] failed QSES ret=%d\n",
> - connector->base.base.id, connector->base.name, ret);
> - return false;
> - }
> -
> - return reply.auth_completed && reply.encryption_enabled;
> -}
> -
>  static const struct intel_hdcp_shim intel_dp_mst_hdcp_shim = {
>   .write_an_aksv = intel_dp_hdcp_write_an_aksv,
>   .read_bksv = intel_dp_hdcp_read_bksv,
> @@ -674,7 +650,7 @@ static const struct intel_hdcp_shim 
> intel_dp_mst_hdcp_shim = {
>   .read_ksv_fifo = intel_dp_hdcp_read_ksv_fifo,
>   .read_v_prime_part = intel_dp_hdcp_read_v_prime_part,
>   .toggle_signalling = intel_dp_mst_hdcp_toggle_signalling,
> - .check_link = intel_dp_mst_hdcp_check_link,
> + .check_link = intel_dp_hdcp_check_link,
>   .hdcp_capable = intel_dp_hdcp_capable,
>  
>   .protocol = HDCP_PROTOCOL_DP,

-- 
Jani Nikula, Intel Open Source Graphics Center
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 1/1] drm/amdgpu: Remove unused variable

2021-01-12 Thread Nirmoy Das
Remove unused space_needed variable.

Fixes: 453f617a30a ("drm/amdgpu: Resize BAR0 to the maximum available size, 
even if it doesn't cover VRAM")
Signed-off-by: Nirmoy Das 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 348ac678a230..5888367b1000 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1106,7 +1106,6 @@ void amdgpu_device_wb_free(struct amdgpu_device *adev, 
u32 wb)
  */
 int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
 {
-   u64 space_needed = roundup_pow_of_two(adev->gmc.real_vram_size);
int rbar_size = pci_rebar_bytes_to_size(adev->gmc.real_vram_size);
struct pci_bus *root;
struct resource *res;
-- 
2.29.2

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: omapfb removal (was: Re: [PATCHv1] video: omapfb2: Make standard and custom DSI command mode panel driver mutually exclusive)

2021-01-12 Thread Laurent Pinchart
Hi Sebastian,

On Tue, Jan 12, 2021 at 05:24:54PM +0100, Sebastian Reichel wrote:
> [dropped linux-next from Cc]
> 
> Hi,
> 
> On Tue, Jan 12, 2021 at 03:10:56PM +0200, Tomi Valkeinen wrote:
> > >> But why is it it we need omapfb at all when we have omapdrm?
> > > 
> > > I think there are two reasons omapfb has not been killed yet. One
> > > reason was missing support for manually updated DSI panels, which
> > > have been working since 1 or 2 kernel releases now. The other reason
> > > is some people using it in combination with an out-of-tree PowerVR
> > > kernel driver. There is currently work going on to use a more recent
> > > PowerVR driver based on omapdrm driven by Maemo Leste people.
> > 
> > omapfb also has a custom sysfs API, so applications that depend on it
> > would not work anymore. I don't know if there are such applications, though.
> > 
> > >> Can we sunset all or some parts of omap support in video/?
> > >> If not, what is missing to do so.
> > > 
> > > IDK the exact status of the PowerVR work and have not been using
> > > omapfb myself for years. I don't think there is a reason to rush
> > > this, so my suggestion is removing it in 3 steps giving people
> > > the chance to complain:
> > > 
> > > 1. Add 'depends on EXPERT' to 'FB_OMAP2' and add deprecation notice
> > >referencing omapdrm in help text in 5.12
> > > 2. Add 'depends on BROKEN' in 5.13
> > > 3. Drop drivers/video/fbdev/omap2 afterwards
> > 
> > I'd love to remove omapfb, but I also fear that there are still people
> > using it. We can try the above sequence, but it's probably better to go
> > slower, as people may not be using the latest kernels.
> 
> I thought about this again and I think the best option is to rename
> CONFIG_FB_OMAP2 to something like CONFIG_FB_OMAP2_DEPRECATED and
> update the help text. That way anyone with CONFIG_FB_OMAP2 in
> their .config will definitely notice the change when upgrading to
> a newer kernel, but can easily fix it temporarily. Help text could
> be
> 
> "This driver will be removed in 2022, please switch to omapdrm."
> 
> and no other intermediate steps are required that way :)

The plan looks good to me.

> But while looking through CONFIG_FB_OMAP2 references I noticed there
> is also a V4L2 driver (CONFIG_VIDEO_OMAP2_VOUT), which seems to
> only work with omapfb. IIUIC that driver provides display overlays
> to V4L. I guess on omapdrm V4L can use DRM planes instead and no
> driver is needed (i.e. this driver could just go away with omapfb)?

One feature that the omapfb2 and the omap-vout drivers provide is
rotation support with VRFB on OMAP3. I haven't moved to omapdrm on an
old project for this reason. It should be possible to implement rotation
support in omapdrm, but I'm not aware of any effort in that direction.

-- 
Regards,

Laurent Pinchart
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 3/4] drm: Extend color correction to support 3D-CLU

2021-01-12 Thread Ville Syrjälä
On Mon, Dec 21, 2020 at 03:57:29AM +0200, Laurent Pinchart wrote:
> From: Kieran Bingham 
> 
> Extend the existing color management properties to support provision
> of a 3D cubic look up table, allowing for color specific adjustments.
> 
> Signed-off-by: Kieran Bingham 
> Co-developed-by: Laurent Pinchart 
> Signed-off-by: Laurent Pinchart 

FYI I've got a WIP 3D LUT implementation for i915 here:
git://github.com/vsyrjala/linux.git 3dlut

I named the prop GAMMA_LUT_3D to indicate its position in the
pipeline (on our hw it's postioned after the normal gamma LUT).
Alas no userspace for it yet, so can't really do anything more 
with it for the time being.

Rudimentary tests also available here:
git://github.com/vsyrjala/intel-gpu-tools.git 3dlut

-- 
Ville Syrjälä
Intel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v3 01/12] drm: Add dummy page per device or GEM object

2021-01-12 Thread Andrey Grodzovsky


On 1/12/21 7:32 AM, Christian König wrote:

Am 12.01.21 um 10:10 schrieb Daniel Vetter:

On Mon, Jan 11, 2021 at 03:45:10PM -0500, Andrey Grodzovsky wrote:

On 1/11/21 11:15 AM, Daniel Vetter wrote:

On Mon, Jan 11, 2021 at 05:13:56PM +0100, Daniel Vetter wrote:

On Fri, Jan 08, 2021 at 04:49:55PM +, Grodzovsky, Andrey wrote:
Ok then, I guess I will proceed with the dummy pages list implementation 
then.


Andrey


From: Koenig, Christian 
Sent: 08 January 2021 09:52
To: Grodzovsky, Andrey ; Daniel Vetter 

Cc: amd-...@lists.freedesktop.org ; 
dri-devel@lists.freedesktop.org ; 
daniel.vet...@ffwll.ch ; r...@kernel.org 
; l.st...@pengutronix.de ; 
yuq...@gmail.com ; e...@anholt.net ; 
Deucher, Alexander ; 
gre...@linuxfoundation.org ; 
ppaala...@gmail.com ; Wentland, Harry 


Subject: Re: [PATCH v3 01/12] drm: Add dummy page per device or GEM object

Mhm, I'm not aware of any let over pointer between TTM and GEM and we
worked quite hard on reducing the size of the amdgpu_bo, so another
extra pointer just for that corner case would suck quite a bit.

We have a ton of other pointers in struct amdgpu_bo (or any of it's lower
things) which are fairly single-use, so I'm really not much seeing the
point in making this a special case. It also means the lifetime management
becomes a bit iffy, since we can't throw away the dummy page then the last
reference to the bo is released (since we don't track it there), but only
when the last pointer to the device is released. Potentially this means a
pile of dangling pages hanging around for too long.

Also if you really, really, really want to have this list, please don't
reinvent it since we have it already. drmm_ is exactly meant for resources
that should be freed when the final drm_device reference disappears.
-Daniel


I maybe was eager to early, see i need to explicitly allocate the dummy page
using page_alloc so
i cannot use drmm_kmalloc for this, so once again like with the list i need
to wrap it with a container struct
which i can then allocate using drmm_kmalloc and inside there will be page
pointer. But then
on release it needs to free the page and so i supposedly need to use 
drmm_add_action

to free the page before the container struct is released but drmm_kmalloc
doesn't allow to set
release action on struct allocation. So I created a new
drmm_kmalloc_with_action API function
but then you also need to supply the optional data pointer for the release
action (the struct page in this case)
and so this all becomes a bit overcomplicated (but doable). Is this extra
API worth adding ? Maybe it can
be useful in general.

drm_add_action_or_reset (for better control flow) has both a void * data
and a cleanup function (and it internally allocates the tracking structure
for that for you). So should work as-is? Allocating a tracking structure
for our tracking structure for a page would definitely be a bit too much.

Essentiall drmm_add_action is your kcalloc_with_action function you want,
as long as all you need is a single void * pointer (we could do the
kzalloc_with_action though, there's enough space, just no need yet for any
of the current users).


Yeah, but my thinking was that we should use the page LRU for this and not 
another container structure.


Christian.



Which specific list did you mean ?

Andrey





-Daniel



___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: fbcon: remove soft scrollback code (missing Doc. patch)

2021-01-12 Thread Daniel Vetter
On Sat, Jan 9, 2021 at 12:11 AM Linus Torvalds
 wrote:
>
> On Fri, Jan 8, 2021 at 11:13 AM Phillip Susi  wrote:
> >
> > > Could we pause this madness? Scrollback is still useful. I needed it
> > > today... it was too small, so command results I was looking for
> > > already scrolled away, but... life will be really painful with 0
> > > scrollback.
> >
> > > You'll need it, too... as soon as you get oops and will want to see
> > > errors just prior to that oops.
> >
> > > If it means I get to maintain it... I'm not happy about it but that's
> > > better than no scrollback.
> >
> > Amen!  What self respecting admin installs a gui on servers?  What do we
> > have to do to get this back in?  What was so buggy with this code that
> > it needed to be removed?  Why was it such a burden to just leave it be?
>
> It really was buggy, with security implications. And we have no maintainers.
>
> So the scroll-back code can't come back until we have a maintainer and
> a cleaner and simpler implementation.
>
> And no, maintaining it really doesn't mean "just get it back to the
> old broken state".
>
> So far I haven't actually seen any patches, which means that it's not
> coming back.
>
> The good news? If you have an actual text VGA console, that should
> still work just fine.

Also on anything that is remotely modern (i.e. runs a drm kernel
modesetting driver undearneath the fbdev/fbcon stack) there's a pile
more issues on top of just the scrollback/fbcon code being a mess.
Specifically the locking is somewhere between yolo and outright
deadlocks. This holds even more so if the use case here is "I want
scrollback for an oops". There's rough sketches for how it could be
solved, but it's all very tricky work.

Also, we need testcases for this, both in-kernel unit-test style stuff
and uapi testcases. Especially the full interaction on a modern stack
between /dev/fb/0, /dev/drm/card0, vt ioctls and the console is a pure
nightmare.

Altogether this is a few years of full time hacking to get this back
into shape, and until that's happening and clearly getting somewhere
the only reasonable thing to do is to delete features in response to
syzkaller crashes.

Also adding dri-devel since defacto that's the only place where
display people hang out nowadays.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v3 01/12] drm: Add dummy page per device or GEM object

2021-01-12 Thread Andrey Grodzovsky

So - basically allocate the page and pass it as void* pointer to drmm_add_action
with a release function which will do the free page, right ?

Andrey

On 1/12/21 4:10 AM, Daniel Vetter wrote:

drm_add_action_or_reset (for better control flow) has both a void * data
and a cleanup function (and it internally allocates the tracking structure
for that for you). So should work as-is? Allocating a tracking structure
for our tracking structure for a page would definitely be a bit too much.

Essentiall drmm_add_action is your kcalloc_with_action function you want,
as long as all you need is a single void * pointer (we could do the
kzalloc_with_action though, there's enough space, just no need yet for any
of the current users).
-Daniel

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v8 1/4] dt-bindings: display: Document the Xylon LogiCVC display controller

2021-01-12 Thread Rob Herring
On Wed, Dec 23, 2020 at 10:29:44PM +0100, Paul Kocialkowski wrote:
> The Xylon LogiCVC is a display controller implemented as programmable
> logic in Xilinx FPGAs.
> 
> Signed-off-by: Paul Kocialkowski 
> Acked-by: Rob Herring 
> ---
>  .../display/xylon,logicvc-display.yaml| 313 ++
>  1 file changed, 313 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/display/xylon,logicvc-display.yaml
> 
> diff --git 
> a/Documentation/devicetree/bindings/display/xylon,logicvc-display.yaml 
> b/Documentation/devicetree/bindings/display/xylon,logicvc-display.yaml
> new file mode 100644
> index ..aca78334ad2c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/xylon,logicvc-display.yaml
> @@ -0,0 +1,313 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +# Copyright 2019 Bootlin
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/display/xylon,logicvc-display.yaml#;
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#;
> +
> +title: Xylon LogiCVC display controller
> +
> +maintainers:
> +  - Paul Kocialkowski 
> +
> +description: |
> +  The Xylon LogiCVC is a display controller that supports multiple layers.
> +  It is usually implemented as programmable logic and was optimized for use
> +  with Xilinx Zynq-7000 SoCs and Xilinx FPGAs.
> +
> +  Because the controller is intended for use in a FPGA, most of the
> +  configuration of the controller takes place at logic configuration 
> bitstream
> +  synthesis time. As a result, many of the device-tree bindings are meant to
> +  reflect the synthesis configuration and must not be configured differently.
> +  Matching synthesis parameters are provided when applicable.
> +
> +  Layers are declared in the "layers" sub-node and have dedicated 
> configuration.
> +  In version 3 of the controller, each layer has fixed memory offset and 
> address
> +  starting from the video memory base address for its framebuffer. In 
> version 4,
> +  framebuffers are configured with a direct memory address instead.
> +
> +properties:
> +  compatible:
> +enum:
> +  - xylon,logicvc-3.02.a-display
> +  - xylon,logicvc-4.01.a-display
> +
> +  reg:
> +maxItems: 1
> +
> +  clocks:
> +minItems: 1
> +maxItems: 4
> +
> +  clock-names:
> +minItems: 1
> +maxItems: 4
> +items:
> +  # vclk is required and must be provided as first item.
> +  - const: vclk
> +  # Other clocks are optional and can be provided in any order.
> +  - enum:
> +  - vclk2
> +  - lvdsclk
> +  - lvdsclkn
> +  - enum:
> +  - vclk2
> +  - lvdsclk
> +  - lvdsclkn
> +  - enum:
> +  - vclk2
> +  - lvdsclk
> +  - lvdsclkn
> +
> +  interrupts:
> +maxItems: 1
> +
> +  memory-region:
> +maxItems: 1
> +
> +  xylon,display-interface:
> +enum:
> +  # Parallel RGB interface (C_DISPLAY_INTERFACE == 0)
> +  - parallel-rgb
> +  # ITU-T BR656 interface (C_DISPLAY_INTERFACE == 1)
> +  - bt656
> +  # 4-bit LVDS interface (C_DISPLAY_INTERFACE == 2)
> +  - lvds-4bits
> +  # 3-bit LVDS interface (C_DISPLAY_INTERFACE == 4)
> +  - lvds-3bits
> +  # DVI interface (C_DISPLAY_INTERFACE == 5)
> +  - dvi
> +description: Display output interface (C_DISPLAY_INTERFACE).

As I mentioned before, we have standard properties for these or you know 
the setting based on the panel/bridge attached. 

> +
> +  xylon,display-colorspace:
> +enum:
> +  # RGB colorspace (C_DISPLAY_COLOR_SPACE == 0)
> +  - rgb
> +  # YUV 4:2:2 colorspace (C_DISPLAY_COLOR_SPACE == 1)
> +  - yuv422
> +  # YUV 4:4:4 colorspace (C_DISPLAY_COLOR_SPACE == 2)
> +  - yuv444
> +description: Display output colorspace (C_DISPLAY_COLOR_SPACE).
> +
> +  xylon,display-depth:
> +$ref: "/schemas/types.yaml#/definitions/uint32"
> +description: Display output depth (C_PIXEL_DATA_WIDTH).
> +
> +  xylon,row-stride:
> +$ref: "/schemas/types.yaml#/definitions/uint32"
> +description: Fixed number of pixels in a framebuffer row (C_ROW_STRIDE).
> +
> +  xylon,syscon:
> +$ref: /schemas/types.yaml#/definitions/phandle
> +description: |
> +  Syscon phandle representing the top-level logicvc instance, useful when
> +  the parent node is not the top-level logicvc instance.

Why do you need to support both ways? Drop this and require it to be the 
parent node.

> +
> +  xylon,dithering:
> +$ref: "/schemas/types.yaml#/definitions/flag"
> +description: Dithering module is enabled (C_XCOLOR)
> +
> +  xylon,background-layer:
> +$ref: "/schemas/types.yaml#/definitions/flag"
> +description: |
> +  The last layer is used to display a black background 
> (C_USE_BACKGROUND).
> +  The layer must still be registered.
> +
> +  xylon,layers-configurable:
> +$ref: "/schemas/types.yaml#/definitions/flag"
> +description: |
> +  Configuration of layers' size, 

Re: [PATCH v9 1/4] dt-bindings: gpu: mali-bifrost: Add Mediatek MT8183

2021-01-12 Thread Rob Herring
On Fri, Jan 08, 2021 at 09:10:08AM +0800, Nicolas Boichat wrote:
> Define a compatible string for the Mali Bifrost GPU found in
> Mediatek's MT8183 SoCs.
> 
> Signed-off-by: Nicolas Boichat 
> Reviewed-by: Alyssa Rosenzweig 
> ---
> 
> (no changes since v6)
> 
> Changes in v6:
>  - Rebased, actually tested with recent mesa driver.
>  - No change
> 
> Changes in v5:
>  - Rename "2d" power domain to "core2"
> 
> Changes in v4:
>  - Add power-domain-names description
>(kept Alyssa's reviewed-by as the change is minor)
> 
> Changes in v3:
>  - No change
> 
>  .../bindings/gpu/arm,mali-bifrost.yaml| 25 +++
>  1 file changed, 25 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml 
> b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
> index 184492162e7e..71b613ee5bd7 100644
> --- a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
> +++ b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
> @@ -17,6 +17,7 @@ properties:
>  items:
>- enum:
>- amlogic,meson-g12a-mali
> +  - mediatek,mt8183-mali
>- realtek,rtd1619-mali
>- rockchip,px30-mali
>- const: arm,mali-bifrost # Mali Bifrost GPU model/revision is fully 
> discoverable
> @@ -87,6 +88,30 @@ allOf:
>  then:
>required:
>  - resets
> +  - if:
> +  properties:
> +compatible:
> +  contains:
> +const: mediatek,mt8183-mali
> +then:
> +  properties:
> +sram-supply: true

This has to be defined at the top-level or there will be an error when 
it is present (due to additionalProperties).

In this if/then you can do:

else:
  sram-supply: false

to disallow it if not 'mediatek,mt8183-mali'

> +power-domains:
> +  description:
> +List of phandle and PM domain specifier as documented in
> +Documentation/devicetree/bindings/power/power_domain.txt
> +  minItems: 3
> +  maxItems: 3
> +power-domain-names:
> +  items:
> +- const: core0
> +- const: core1
> +- const: core2
> +
> +  required:
> +- sram-supply
> +- power-domains
> +- power-domains-names
>  
>  examples:
>- |
> -- 
> 2.29.2.729.g45daf8777d-goog
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 0/4] Revert "drm/amd/display: Expose new CRC window property" and changes associated with this commit

2021-01-12 Thread Alex Deucher
On Tue, Jan 12, 2021 at 9:55 AM Rodrigo Siqueira
 wrote:
>
> Hi,
>
> In the V1, Wayne pointed out two problems:
>
> 1. The revert patch included one extra line that does not belong to it;
> 2. The original patch also had other fixes in the same commit;
>
> I removed the extra line from the reverted patch for tackling this
> issue, and I added one additional patch to this series that includes the
> other fix requested by Wayne.
>
> Thanks
>
> Original cover letter:
> A couple of weeks ago, Daniel highlighted  [1] some issue related to a
> patch entitle "drm/amd/display: Expose new CRC window property". After
> discussion, we realize that we can revert that patch because we will
> need to create a debugfs or full UAPI for CRC soon, which will make this
> code obsolete. We got two other patches related to this same code; for
> this reason, this patchset reverts all changes associated with that
> specific commit.
>
> Rodrigo Siqueira (3):
>   Revert "drm/amd/display: Fix unused variable warning"
>   Revert "drm/amdgpu/disply: fix documentation warnings in display
> manager"
>   Revert "drm/amd/display: Expose new CRC window property"
>
> Wayne Lin (1):
>   drm/amd/display: Fix to be able to stop crc calculation
>

Series is:
Acked-by: Alex Deucher 

>  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 142 ++
>  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h |  38 -
>  .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c |  54 +--
>  .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h |   5 +-
>  4 files changed, 11 insertions(+), 228 deletions(-)
>
> --
> 2.25.1
>
> ___
> amd-gfx mailing list
> amd-...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 4/4] drm/amd/display: Fix to be able to stop crc calculation

2021-01-12 Thread Rodrigo Siqueira
From: Wayne Lin 

[Why]
Find out when we try to disable CRC calculation, crc generation is still
enabled. Main reason is that dc_stream_configure_crc() will never get
called when the source is AMDGPU_DM_PIPE_CRC_SOURCE_NONE.

[How]
Add checking condition that when source is
AMDGPU_DM_PIPE_CRC_SOURCE_NONE, we should also call
dc_stream_configure_crc() to disable crc calculation.

Signed-off-by: Wayne Lin 
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
index c29dc11619f7..66cb8730586b 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
@@ -113,7 +113,7 @@ int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc 
*crtc,
mutex_lock(>dm.dc_lock);
 
/* Enable CRTC CRC generation if necessary. */
-   if (dm_is_crc_source_crtc(source)) {
+   if (dm_is_crc_source_crtc(source) || source == 
AMDGPU_DM_PIPE_CRC_SOURCE_NONE) {
if (!dc_stream_configure_crc(stream_state->ctx->dc,
 stream_state, NULL, enable, 
enable)) {
ret = -EINVAL;
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 3/4] Revert "drm/amd/display: Expose new CRC window property"

2021-01-12 Thread Rodrigo Siqueira
This reverts commit 110d586ba77ed573eb7464ca69b6490ec0b70c5f.

Cc: Wayne Lin 
Cc: Alexander Deucher 
Cc: Harry Wentland 
Cc: Roman Li 
Cc: Bindu R 
Cc: Daniel Vetter 
Signed-off-by: Rodrigo Siqueira 
---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 142 +-
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h |  19 ---
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c |  56 +--
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h |   3 -
 4 files changed, 10 insertions(+), 210 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 1ebd83337e29..3f1e960b1d84 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -938,41 +938,6 @@ static void mmhub_read_system_context(struct amdgpu_device 
*adev, struct dc_phy_
 }
 #endif
 
-#ifdef CONFIG_DEBUG_FS
-static int create_crtc_crc_properties(struct amdgpu_display_manager *dm)
-{
-   dm->crc_win_x_start_property =
-   drm_property_create_range(adev_to_drm(dm->adev),
- DRM_MODE_PROP_ATOMIC,
- "AMD_CRC_WIN_X_START", 0, U16_MAX);
-   if (!dm->crc_win_x_start_property)
-   return -ENOMEM;
-
-   dm->crc_win_y_start_property =
-   drm_property_create_range(adev_to_drm(dm->adev),
- DRM_MODE_PROP_ATOMIC,
- "AMD_CRC_WIN_Y_START", 0, U16_MAX);
-   if (!dm->crc_win_y_start_property)
-   return -ENOMEM;
-
-   dm->crc_win_x_end_property =
-   drm_property_create_range(adev_to_drm(dm->adev),
- DRM_MODE_PROP_ATOMIC,
- "AMD_CRC_WIN_X_END", 0, U16_MAX);
-   if (!dm->crc_win_x_end_property)
-   return -ENOMEM;
-
-   dm->crc_win_y_end_property =
-   drm_property_create_range(adev_to_drm(dm->adev),
- DRM_MODE_PROP_ATOMIC,
- "AMD_CRC_WIN_Y_END", 0, U16_MAX);
-   if (!dm->crc_win_y_end_property)
-   return -ENOMEM;
-
-   return 0;
-}
-#endif
-
 static int amdgpu_dm_init(struct amdgpu_device *adev)
 {
struct dc_init_data init_data;
@@ -1119,10 +1084,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 
dc_init_callbacks(adev->dm.dc, _params);
}
-#endif
-#ifdef CONFIG_DEBUG_FS
-   if (create_crtc_crc_properties(>dm))
-   DRM_ERROR("amdgpu: failed to create crc property.\n");
 #endif
if (amdgpu_dm_initialize_drm_device(adev)) {
DRM_ERROR(
@@ -5456,64 +5417,12 @@ dm_crtc_duplicate_state(struct drm_crtc *crtc)
state->crc_src = cur->crc_src;
state->cm_has_degamma = cur->cm_has_degamma;
state->cm_is_degamma_srgb = cur->cm_is_degamma_srgb;
-#ifdef CONFIG_DEBUG_FS
-   state->crc_window = cur->crc_window;
-#endif
+
/* TODO Duplicate dc_stream after objects are stream object is 
flattened */
 
return >base;
 }
 
-#ifdef CONFIG_DEBUG_FS
-static int amdgpu_dm_crtc_atomic_set_property(struct drm_crtc *crtc,
-   struct drm_crtc_state *crtc_state,
-   struct drm_property *property,
-   uint64_t val)
-{
-   struct drm_device *dev = crtc->dev;
-   struct amdgpu_device *adev = drm_to_adev(dev);
-   struct dm_crtc_state *dm_new_state =
-   to_dm_crtc_state(crtc_state);
-
-   if (property == adev->dm.crc_win_x_start_property)
-   dm_new_state->crc_window.x_start = val;
-   else if (property == adev->dm.crc_win_y_start_property)
-   dm_new_state->crc_window.y_start = val;
-   else if (property == adev->dm.crc_win_x_end_property)
-   dm_new_state->crc_window.x_end = val;
-   else if (property == adev->dm.crc_win_y_end_property)
-   dm_new_state->crc_window.y_end = val;
-   else
-   return -EINVAL;
-
-   return 0;
-}
-
-static int amdgpu_dm_crtc_atomic_get_property(struct drm_crtc *crtc,
-   const struct drm_crtc_state *state,
-   struct drm_property *property,
-   uint64_t *val)
-{
-   struct drm_device *dev = crtc->dev;
-   struct amdgpu_device *adev = drm_to_adev(dev);
-   struct dm_crtc_state *dm_state =
-   to_dm_crtc_state(state);
-
-   if (property == adev->dm.crc_win_x_start_property)
-   *val = dm_state->crc_window.x_start;
-   else if (property == adev->dm.crc_win_y_start_property)
-   *val = dm_state->crc_window.y_start;
-   else if (property == adev->dm.crc_win_x_end_property)
-

[PATCH v2 2/4] Revert "drm/amdgpu/disply: fix documentation warnings in display manager"

2021-01-12 Thread Rodrigo Siqueira
This reverts commit 1206904465c8a9eebff9ca5a65effc8cf8f3cb84.

Cc: Wayne Lin 
Cc: Alexander Deucher 
Cc: Harry Wentland 
Cc: Roman Li 
Cc: Bindu R 
Cc: Daniel Vetter 
Signed-off-by: Rodrigo Siqueira 
---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 21 +--
 1 file changed, 1 insertion(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
index 68df94a8b609..2a370d6a5a26 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
@@ -344,29 +344,10 @@ struct amdgpu_display_manager {
uint32_t active_vblank_irq_count;
 
 #ifdef CONFIG_DEBUG_FS
-   /**
-* @crc_win_x_start_property:
-*
-* X start of the crc calculation window
-*/
+   /* set the crc calculation window*/
struct drm_property *crc_win_x_start_property;
-   /**
-* @crc_win_y_start_property:
-*
-* Y start of the crc calculation window
-*/
struct drm_property *crc_win_y_start_property;
-   /**
-* @crc_win_x_end_property:
-*
-* X end of the crc calculation window
-*/
struct drm_property *crc_win_x_end_property;
-   /**
-* @crc_win_y_end_property:
-*
-* Y end of the crc calculation window
-*/
struct drm_property *crc_win_y_end_property;
 #endif
/**
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 1/4] Revert "drm/amd/display: Fix unused variable warning"

2021-01-12 Thread Rodrigo Siqueira
This reverts commit b5d8f1d02ba7021cad1bd5ad8460ce5611c479d8.

Cc: Wayne Lin 
Cc: Alexander Deucher 
Cc: Harry Wentland 
Cc: Roman Li 
Cc: Bindu R 
Cc: Daniel Vetter 
Signed-off-by: Rodrigo Siqueira 
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +++-
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index de71b6c21590..1ebd83337e29 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -8551,7 +8551,8 @@ static void amdgpu_dm_atomic_commit_tail(struct 
drm_atomic_state *state)
acrtc->dm_irq_params.stream = dm_new_crtc_state->stream;
manage_dm_interrupts(adev, acrtc, true);
}
-   if (IS_ENABLED(CONFIG_DEBUG_FS) && new_crtc_state->active &&
+#ifdef CONFIG_DEBUG_FS
+   if (new_crtc_state->active &&

amdgpu_dm_is_valid_crc_source(dm_new_crtc_state->crc_src)) {
/**
 * Frontend may have changed so reapply the CRC capture
@@ -8572,6 +8573,7 @@ static void amdgpu_dm_atomic_commit_tail(struct 
drm_atomic_state *state)
amdgpu_dm_crtc_configure_crc_source(
crtc, dm_new_crtc_state, 
dm_new_crtc_state->crc_src);
}
+#endif
}
 
for_each_new_crtc_in_state(state, crtc, new_crtc_state, j)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h
index eba2f1d35d07..0235bfb246e5 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h
@@ -46,13 +46,13 @@ static inline bool amdgpu_dm_is_valid_crc_source(enum 
amdgpu_dm_pipe_crc_source
 }
 
 /* amdgpu_dm_crc.c */
+#ifdef CONFIG_DEBUG_FS
 bool amdgpu_dm_crc_window_is_default(struct dm_crtc_state *dm_crtc_state);
 bool amdgpu_dm_crc_window_changed(struct dm_crtc_state *dm_new_crtc_state,
struct dm_crtc_state 
*dm_old_crtc_state);
 int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc,
struct dm_crtc_state *dm_crtc_state,
enum amdgpu_dm_pipe_crc_source source);
-#ifdef CONFIG_DEBUG_FS
 int amdgpu_dm_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name);
 int amdgpu_dm_crtc_verify_crc_source(struct drm_crtc *crtc,
 const char *src_name,
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 0/4] Revert "drm/amd/display: Expose new CRC window property" and changes associated with this commit

2021-01-12 Thread Rodrigo Siqueira
Hi,

In the V1, Wayne pointed out two problems:

1. The revert patch included one extra line that does not belong to it;
2. The original patch also had other fixes in the same commit;

I removed the extra line from the reverted patch for tackling this
issue, and I added one additional patch to this series that includes the
other fix requested by Wayne.

Thanks

Original cover letter:
A couple of weeks ago, Daniel highlighted  [1] some issue related to a
patch entitle "drm/amd/display: Expose new CRC window property". After
discussion, we realize that we can revert that patch because we will
need to create a debugfs or full UAPI for CRC soon, which will make this
code obsolete. We got two other patches related to this same code; for
this reason, this patchset reverts all changes associated with that
specific commit.

Rodrigo Siqueira (3):
  Revert "drm/amd/display: Fix unused variable warning"
  Revert "drm/amdgpu/disply: fix documentation warnings in display
manager"
  Revert "drm/amd/display: Expose new CRC window property"

Wayne Lin (1):
  drm/amd/display: Fix to be able to stop crc calculation

 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 142 ++
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h |  38 -
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c |  54 +--
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h |   5 +-
 4 files changed, 11 insertions(+), 228 deletions(-)

-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v9, 01/11] dt-bindings: mediatek: add rdma-fifo-size description for mt8183 display

2021-01-12 Thread Rob Herring
On Thu, 07 Jan 2021 11:11:11 +0800, Yongqiang Niu wrote:
> rdma fifo size may be different even in same SOC, add this
> property to the corresponding rdma
> 
> Signed-off-by: Yongqiang Niu 
> ---
>  .../devicetree/bindings/display/mediatek/mediatek,disp.txt   | 9 
> +
>  1 file changed, 9 insertions(+)
> 

Reviewed-by: Rob Herring 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


RE: [PATCH 1/2] drm: distinguish return value of drm_dp_check_and_send_link_address.

2021-01-12 Thread Simon Ser
Pushed to drm-misc-next with a re-formatted commit message, thanks for
your contribution!
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [Intel-gfx] [RFC PATCH 098/162] drm/i915/gtt: map the PD up front

2021-01-12 Thread Daniel Vetter
On Tue, Jan 12, 2021 at 10:47:57AM +, Matthew Auld wrote:
> On Fri, 27 Nov 2020 at 13:32, Chris Wilson  wrote:
> >
> > Quoting Matthew Auld (2020-11-27 12:06:14)
> > > We need to general our accessor for the page directories and tables from
> > > using the simple kmap_atomic to support local memory, and this setup
> > > must be done on acquisition of the backing storage prior to entering
> > > fence execution contexts. Here we replace the kmap with the object
> > > maping code that for simple single page shmemfs object will return a
> > > plain kmap, that is then kept for the lifetime of the page directory.
> > >
> > > Signed-off-by: Matthew Auld 
> > > Signed-off-by: Chris Wilson 
> >
> > We are going to really struggle with this on 32b :(
> 
> Just go back to mapping everything on demand like we did previously,
> and unmap as soon as we are done with the current directory across
> alloc/insert/clear?

tbh if you run i915.ko on 32b kernels, on a modern platform, you deserve
all the pain you get. There's quite a bit of work going on to essentially
make kmap functions worse on 32b (we're not yet at the stage where people
propose to nuke them, but getting there slowly), so designing code today
with them in mind as primary justification is backwards.

What we can't do is keep kmap around forever, it'd need to be something
like vmap that has a long-term mapping intention behind it. And at that
point it's probably equally amounts of work to just go back to ad-hoc
kmap. Also the rules have changed somewhat with kmap_local anyway, a kmap
is a lot less painful in the code than it was with kmap_atomic.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm: Improve the output_poll_changed description

2021-01-12 Thread Daniel Vetter
On Tue, Jan 12, 2021 at 06:46:44PM +0800, ZhiJie.Zhang wrote:
> From: zhangzhijie 
> 
> codeview the implementation of few Drivers.

I'm not really understanding what you're trying to say here.

> this callback was used by drm_kms_helper_hotplug_event()
> 
> Signed-off-by: zhangzhijie 
> ---
>  include/drm/drm_mode_config.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h
> index ab424ddd7665..e01c4d0f07d1 100644
> --- a/include/drm/drm_mode_config.h
> +++ b/include/drm/drm_mode_config.h
> @@ -104,7 +104,7 @@ struct drm_mode_config_funcs {
>* changes.
>*
>* Drivers implementing fbdev emulation with the helpers can call
> -  * drm_fb_helper_hotplug_changed from this hook to inform the fbdev
> +  * drm_kms_helper_hotplug_event() from this hook to inform the fbdev
>* helper of output changes.

I think since we touch this, maybe better to revamp it complete. The best
way to handle all this is by registering a struct drm_client, since that
provides the _client_funcs.hotplug callback. Also for fbdev support
drivers shouldn't even use that, but instead use the
drm_fbdev_generic_setup() function, which takes care of everything.

I think we can also remove the FIXME below, since with the drm_client
infrastructure and the generic fbdev emulation we've resolved this all
very neatly now.

Can you please respin with my suggestions taking into account somehow?

Thanks, Daniel

>*
>* FIXME:
> -- 
> 2.29.2
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v4 04/13] drm/shmem-helper: Provide a vmap function for short-term mappings

2021-01-12 Thread Daniel Vetter
On Tue, Jan 12, 2021 at 02:11:24PM +0100, Thomas Zimmermann wrote:
> Hi
> 
> Am 11.01.21 um 17:50 schrieb Daniel Vetter:
> > On Fri, Jan 08, 2021 at 10:43:31AM +0100, Thomas Zimmermann wrote:
> > > Implementations of the vmap/vunmap GEM callbacks may perform pinning
> > > of the BO and may acquire the associated reservation object's lock.
> > > Callers that only require a mapping of the contained memory can thus
> > > interfere with other tasks that require exact pinning, such as scanout.
> > > This is less of an issue with private SHMEM buffers, but may happen
> > > with imported ones.
> > > 
> > > Therefore provide the new interfaces drm_gem_shmem_vmap_local() and
> > > drm_gem_shmem_vunmap_local(), which only perform the vmap/vunmap
> > > operations. Callers have to hold the reservation lock while the mapping
> > > persists.
> > > 
> > > This patch also connects GEM SHMEM helpers to GEM object functions with
> > > equivalent functionality.
> > > 
> > > v4:
> > >   * call dma_buf_{vmap,vunmap}_local() where necessary (Daniel)
> > >   * move driver changes into separate patches (Daniel)
> > > 
> > > Signed-off-by: Thomas Zimmermann 
> > > ---
> > >   drivers/gpu/drm/drm_gem_shmem_helper.c | 90 +++---
> > >   include/drm/drm_gem_shmem_helper.h |  2 +
> > >   2 files changed, 84 insertions(+), 8 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c 
> > > b/drivers/gpu/drm/drm_gem_shmem_helper.c
> > > index 9825c378dfa6..298832b2b43b 100644
> > > --- a/drivers/gpu/drm/drm_gem_shmem_helper.c
> > > +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
> > > @@ -32,6 +32,8 @@ static const struct drm_gem_object_funcs 
> > > drm_gem_shmem_funcs = {
> > >   .get_sg_table = drm_gem_shmem_get_sg_table,
> > >   .vmap = drm_gem_shmem_vmap,
> > >   .vunmap = drm_gem_shmem_vunmap,
> > > + .vmap_local = drm_gem_shmem_vmap_local,
> > > + .vunmap_local = drm_gem_shmem_vunmap_local,
> > >   .mmap = drm_gem_shmem_mmap,
> > >   };
> > > @@ -261,7 +263,8 @@ void drm_gem_shmem_unpin(struct drm_gem_object *obj)
> > >   }
> > >   EXPORT_SYMBOL(drm_gem_shmem_unpin);
> > > -static int drm_gem_shmem_vmap_locked(struct drm_gem_shmem_object *shmem, 
> > > struct dma_buf_map *map)
> > > +static int drm_gem_shmem_vmap_locked(struct drm_gem_shmem_object *shmem, 
> > > struct dma_buf_map *map,
> > > +  bool local)
> > 
> > This is a bit spaghetti and also has the problem that we're not changing
> > shmem->vmap_use_count under different locks, depending upon which path
> > we're taking.
> > 
> > I think the cleanest would be if we pull the if (import_attach) case out
> > of the _locked() version completely, for all cases, and also outside of
> > the shmem->vmap_lock. This means no caching of vmaps in the shmem layer
> > anymore for imported buffers, but this is no longer a problem: We cache
> > them in the exporters instead (I think at least, if not maybe need to fix
> > that where it's expensive).
> 
> If we do that, what protects shmem->vaddr from concurrent access near line
> 281? would it be kept NULL then?
> 
> Also, we have some stats in debugfs (see drm_gem_shmem_print_info) which
> would be incorrect (or misleading at least).

We'd need to disable all that for pass-through vmap of imported objects.

> Given all that, would it be possible to remove vmap_lock in favor of taking
> the resv lock in vmap/vunmap?

All possible (and imo long-term desirable), the trouble is in rolling it
out. I've looked at rolling out dma_resv as the one and only lock for
shmem helpers before, and gave up. Exynos is the worst (but not the only)
offender:
- it has it's own per-object lock
- that per-object lock is taken most often before calling into various
  vfuncs, which means for a gradual transition the dma_resv lock would
  nest within that existing per-object lock (until we've completely
  replaced it)
- but exynos also uses dma_resv already as an outermost lock in its
  command submission path

iow as soon as you add dma_resv_lock anywhere in shmem helpers, we've
angered lockdep with a deadlock.

That means the only path I think is feasible is adding dma_resv lock to
all drivers paths first, _outside_ of any existing driver specific
per-object locks. Then remove the driver-specific object locks, and only
then can we sprinkle dma_resv_assert_locked all over shmem helpers.

Ofc any driver without per-driver locks of their own could directly switch
over to dma_resv lock, but until we've converted over all the drivers with
their own locking shmem helpers would be stuck where they are right now.

I gave up :-/ But maybe if you only try to tackle vmap it might be
feasible, since a lot fewer callers.

Cheers, Daniel

> 
> Best regards
> Thomas
> 
> > 
> > Other option would be to unly pull it out for the _vmap_local case, but
> > that's a bit ugly because no longer symmetrical in the various paths.
> > 
> > >   {
> > >   struct drm_gem_object *obj 

Re: [PATCH] drm/ttm: make the pool shrinker lock a mutex

2021-01-12 Thread Daniel Vetter
On Tue, Jan 12, 2021 at 3:06 PM Christian König
 wrote:
>
> Am 12.01.21 um 15:03 schrieb Daniel Vetter:
> > On Mon, Jan 11, 2021 at 2:57 PM Christian König
> >  wrote:
> >> set_pages_wb() might sleep and so we can't do this in an atomic context.
> >>
> >> Signed-off-by: Christian König 
> >> Reported-by: Mikhail Gavrilov 
> >> Fixes: d099fc8f540a ("drm/ttm: new TT backend allocation pool v3")
> > Hm I guess long term proper fix would be to pull the shrinker into two
> > parts, first part takes the right amount of entries of the list,
> > holding the lock. 2nd part does the releasing (or maybe at least in
> > batches). lru locks should be cheap, doing expensive stuff like
> > flushing or rewriting ptes might not be the best idea.
>
> Yeah, agree. It should actually be trivial, but I didn't wanted the
> churn in fixes.
>
> So just going for the easy fix now and the optimal later on.

Makes sense. Maybe add that as an explanation to the commit message,
if you haven't pushed yet. A-b: on the patch.
-Daniel

>
> Regards,
> Christian.
>
> > -Daniel
> >
> >> ---
> >>   drivers/gpu/drm/ttm/ttm_pool.c | 20 ++--
> >>   1 file changed, 10 insertions(+), 10 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/ttm/ttm_pool.c 
> >> b/drivers/gpu/drm/ttm/ttm_pool.c
> >> index a00b7ab9c14c..6a6eeba423d1 100644
> >> --- a/drivers/gpu/drm/ttm/ttm_pool.c
> >> +++ b/drivers/gpu/drm/ttm/ttm_pool.c
> >> @@ -66,7 +66,7 @@ static struct ttm_pool_type global_uncached[MAX_ORDER];
> >>   static struct ttm_pool_type global_dma32_write_combined[MAX_ORDER];
> >>   static struct ttm_pool_type global_dma32_uncached[MAX_ORDER];
> >>
> >> -static spinlock_t shrinker_lock;
> >> +static struct mutex shrinker_lock;
> >>   static struct list_head shrinker_list;
> >>   static struct shrinker mm_shrinker;
> >>
> >> @@ -249,9 +249,9 @@ static void ttm_pool_type_init(struct ttm_pool_type 
> >> *pt, struct ttm_pool *pool,
> >>  spin_lock_init(>lock);
> >>  INIT_LIST_HEAD(>pages);
> >>
> >> -   spin_lock(_lock);
> >> +   mutex_lock(_lock);
> >>  list_add_tail(>shrinker_list, _list);
> >> -   spin_unlock(_lock);
> >> +   mutex_unlock(_lock);
> >>   }
> >>
> >>   /* Remove a pool_type from the global shrinker list and free all pages */
> >> @@ -259,9 +259,9 @@ static void ttm_pool_type_fini(struct ttm_pool_type 
> >> *pt)
> >>   {
> >>  struct page *p, *tmp;
> >>
> >> -   spin_lock(_lock);
> >> +   mutex_lock(_lock);
> >>  list_del(>shrinker_list);
> >> -   spin_unlock(_lock);
> >> +   mutex_unlock(_lock);
> >>
> >>  list_for_each_entry_safe(p, tmp, >pages, lru)
> >>  ttm_pool_free_page(pt->pool, pt->caching, pt->order, p);
> >> @@ -302,7 +302,7 @@ static unsigned int ttm_pool_shrink(void)
> >>  unsigned int num_freed;
> >>  struct page *p;
> >>
> >> -   spin_lock(_lock);
> >> +   mutex_lock(_lock);
> >>  pt = list_first_entry(_list, typeof(*pt), shrinker_list);
> >>
> >>  p = ttm_pool_type_take(pt);
> >> @@ -314,7 +314,7 @@ static unsigned int ttm_pool_shrink(void)
> >>  }
> >>
> >>  list_move_tail(>shrinker_list, _list);
> >> -   spin_unlock(_lock);
> >> +   mutex_unlock(_lock);
> >>
> >>  return num_freed;
> >>   }
> >> @@ -564,7 +564,7 @@ int ttm_pool_debugfs(struct ttm_pool *pool, struct 
> >> seq_file *m)
> >>   {
> >>  unsigned int i;
> >>
> >> -   spin_lock(_lock);
> >> +   mutex_lock(_lock);
> >>
> >>  seq_puts(m, "\t ");
> >>  for (i = 0; i < MAX_ORDER; ++i)
> >> @@ -600,7 +600,7 @@ int ttm_pool_debugfs(struct ttm_pool *pool, struct 
> >> seq_file *m)
> >>  seq_printf(m, "\ntotal\t: %8lu of %8lu\n",
> >> atomic_long_read(_pages), page_pool_size);
> >>
> >> -   spin_unlock(_lock);
> >> +   mutex_unlock(_lock);
> >>
> >>  return 0;
> >>   }
> >> @@ -644,7 +644,7 @@ int ttm_pool_mgr_init(unsigned long num_pages)
> >>  if (!page_pool_size)
> >>  page_pool_size = num_pages;
> >>
> >> -   spin_lock_init(_lock);
> >> +   mutex_init(_lock);
> >>  INIT_LIST_HEAD(_list);
> >>
> >>  for (i = 0; i < MAX_ORDER; ++i) {
> >> --
> >> 2.25.1
> >>
> >> ___
> >> dri-devel mailing list
> >> dri-devel@lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/dri-devel
> >
> >
>


-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/ttm: make the pool shrinker lock a mutex

2021-01-12 Thread Christian König

Am 12.01.21 um 15:03 schrieb Daniel Vetter:

On Mon, Jan 11, 2021 at 2:57 PM Christian König
 wrote:

set_pages_wb() might sleep and so we can't do this in an atomic context.

Signed-off-by: Christian König 
Reported-by: Mikhail Gavrilov 
Fixes: d099fc8f540a ("drm/ttm: new TT backend allocation pool v3")

Hm I guess long term proper fix would be to pull the shrinker into two
parts, first part takes the right amount of entries of the list,
holding the lock. 2nd part does the releasing (or maybe at least in
batches). lru locks should be cheap, doing expensive stuff like
flushing or rewriting ptes might not be the best idea.


Yeah, agree. It should actually be trivial, but I didn't wanted the 
churn in fixes.


So just going for the easy fix now and the optimal later on.

Regards,
Christian.


-Daniel


---
  drivers/gpu/drm/ttm/ttm_pool.c | 20 ++--
  1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
index a00b7ab9c14c..6a6eeba423d1 100644
--- a/drivers/gpu/drm/ttm/ttm_pool.c
+++ b/drivers/gpu/drm/ttm/ttm_pool.c
@@ -66,7 +66,7 @@ static struct ttm_pool_type global_uncached[MAX_ORDER];
  static struct ttm_pool_type global_dma32_write_combined[MAX_ORDER];
  static struct ttm_pool_type global_dma32_uncached[MAX_ORDER];

-static spinlock_t shrinker_lock;
+static struct mutex shrinker_lock;
  static struct list_head shrinker_list;
  static struct shrinker mm_shrinker;

@@ -249,9 +249,9 @@ static void ttm_pool_type_init(struct ttm_pool_type *pt, 
struct ttm_pool *pool,
 spin_lock_init(>lock);
 INIT_LIST_HEAD(>pages);

-   spin_lock(_lock);
+   mutex_lock(_lock);
 list_add_tail(>shrinker_list, _list);
-   spin_unlock(_lock);
+   mutex_unlock(_lock);
  }

  /* Remove a pool_type from the global shrinker list and free all pages */
@@ -259,9 +259,9 @@ static void ttm_pool_type_fini(struct ttm_pool_type *pt)
  {
 struct page *p, *tmp;

-   spin_lock(_lock);
+   mutex_lock(_lock);
 list_del(>shrinker_list);
-   spin_unlock(_lock);
+   mutex_unlock(_lock);

 list_for_each_entry_safe(p, tmp, >pages, lru)
 ttm_pool_free_page(pt->pool, pt->caching, pt->order, p);
@@ -302,7 +302,7 @@ static unsigned int ttm_pool_shrink(void)
 unsigned int num_freed;
 struct page *p;

-   spin_lock(_lock);
+   mutex_lock(_lock);
 pt = list_first_entry(_list, typeof(*pt), shrinker_list);

 p = ttm_pool_type_take(pt);
@@ -314,7 +314,7 @@ static unsigned int ttm_pool_shrink(void)
 }

 list_move_tail(>shrinker_list, _list);
-   spin_unlock(_lock);
+   mutex_unlock(_lock);

 return num_freed;
  }
@@ -564,7 +564,7 @@ int ttm_pool_debugfs(struct ttm_pool *pool, struct seq_file 
*m)
  {
 unsigned int i;

-   spin_lock(_lock);
+   mutex_lock(_lock);

 seq_puts(m, "\t ");
 for (i = 0; i < MAX_ORDER; ++i)
@@ -600,7 +600,7 @@ int ttm_pool_debugfs(struct ttm_pool *pool, struct seq_file 
*m)
 seq_printf(m, "\ntotal\t: %8lu of %8lu\n",
atomic_long_read(_pages), page_pool_size);

-   spin_unlock(_lock);
+   mutex_unlock(_lock);

 return 0;
  }
@@ -644,7 +644,7 @@ int ttm_pool_mgr_init(unsigned long num_pages)
 if (!page_pool_size)
 page_pool_size = num_pages;

-   spin_lock_init(_lock);
+   mutex_init(_lock);
 INIT_LIST_HEAD(_list);

 for (i = 0; i < MAX_ORDER; ++i) {
--
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel





___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/ttm: make the pool shrinker lock a mutex

2021-01-12 Thread Daniel Vetter
On Mon, Jan 11, 2021 at 2:57 PM Christian König
 wrote:
>
> set_pages_wb() might sleep and so we can't do this in an atomic context.
>
> Signed-off-by: Christian König 
> Reported-by: Mikhail Gavrilov 
> Fixes: d099fc8f540a ("drm/ttm: new TT backend allocation pool v3")

Hm I guess long term proper fix would be to pull the shrinker into two
parts, first part takes the right amount of entries of the list,
holding the lock. 2nd part does the releasing (or maybe at least in
batches). lru locks should be cheap, doing expensive stuff like
flushing or rewriting ptes might not be the best idea.
-Daniel

> ---
>  drivers/gpu/drm/ttm/ttm_pool.c | 20 ++--
>  1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
> index a00b7ab9c14c..6a6eeba423d1 100644
> --- a/drivers/gpu/drm/ttm/ttm_pool.c
> +++ b/drivers/gpu/drm/ttm/ttm_pool.c
> @@ -66,7 +66,7 @@ static struct ttm_pool_type global_uncached[MAX_ORDER];
>  static struct ttm_pool_type global_dma32_write_combined[MAX_ORDER];
>  static struct ttm_pool_type global_dma32_uncached[MAX_ORDER];
>
> -static spinlock_t shrinker_lock;
> +static struct mutex shrinker_lock;
>  static struct list_head shrinker_list;
>  static struct shrinker mm_shrinker;
>
> @@ -249,9 +249,9 @@ static void ttm_pool_type_init(struct ttm_pool_type *pt, 
> struct ttm_pool *pool,
> spin_lock_init(>lock);
> INIT_LIST_HEAD(>pages);
>
> -   spin_lock(_lock);
> +   mutex_lock(_lock);
> list_add_tail(>shrinker_list, _list);
> -   spin_unlock(_lock);
> +   mutex_unlock(_lock);
>  }
>
>  /* Remove a pool_type from the global shrinker list and free all pages */
> @@ -259,9 +259,9 @@ static void ttm_pool_type_fini(struct ttm_pool_type *pt)
>  {
> struct page *p, *tmp;
>
> -   spin_lock(_lock);
> +   mutex_lock(_lock);
> list_del(>shrinker_list);
> -   spin_unlock(_lock);
> +   mutex_unlock(_lock);
>
> list_for_each_entry_safe(p, tmp, >pages, lru)
> ttm_pool_free_page(pt->pool, pt->caching, pt->order, p);
> @@ -302,7 +302,7 @@ static unsigned int ttm_pool_shrink(void)
> unsigned int num_freed;
> struct page *p;
>
> -   spin_lock(_lock);
> +   mutex_lock(_lock);
> pt = list_first_entry(_list, typeof(*pt), shrinker_list);
>
> p = ttm_pool_type_take(pt);
> @@ -314,7 +314,7 @@ static unsigned int ttm_pool_shrink(void)
> }
>
> list_move_tail(>shrinker_list, _list);
> -   spin_unlock(_lock);
> +   mutex_unlock(_lock);
>
> return num_freed;
>  }
> @@ -564,7 +564,7 @@ int ttm_pool_debugfs(struct ttm_pool *pool, struct 
> seq_file *m)
>  {
> unsigned int i;
>
> -   spin_lock(_lock);
> +   mutex_lock(_lock);
>
> seq_puts(m, "\t ");
> for (i = 0; i < MAX_ORDER; ++i)
> @@ -600,7 +600,7 @@ int ttm_pool_debugfs(struct ttm_pool *pool, struct 
> seq_file *m)
> seq_printf(m, "\ntotal\t: %8lu of %8lu\n",
>atomic_long_read(_pages), page_pool_size);
>
> -   spin_unlock(_lock);
> +   mutex_unlock(_lock);
>
> return 0;
>  }
> @@ -644,7 +644,7 @@ int ttm_pool_mgr_init(unsigned long num_pages)
> if (!page_pool_size)
> page_pool_size = num_pages;
>
> -   spin_lock_init(_lock);
> +   mutex_init(_lock);
> INIT_LIST_HEAD(_list);
>
> for (i = 0; i < MAX_ORDER; ++i) {
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel



-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 1/6] drm: Inline AGP wrappers into their only callers

2021-01-12 Thread Daniel Vetter
On Tue, Jan 12, 2021 at 10:56 AM Thomas Zimmermann  wrote:
>
> Hi
>
> Am 12.01.21 um 09:59 schrieb Daniel Vetter:
> > On Tue, Jan 12, 2021 at 09:10:30AM +0100, Thomas Zimmermann wrote:
> >> The AGP wrapper functions serve no purpose.
> >>
> >> Signed-off-by: Thomas Zimmermann 
> >
> > They do, without them we fail compiling (I think at least) when agp isn't
>
> I thought so. But the only callers are in drm_agpsupport.c, which
> depends on CONFIG_AGP in the Makefile. So I expected this to work.

Please add that information to the commit message, with that r-b: me too.
-Daniel

>
> Best regards
> Thomas
>
> > enabled. Did you check for that? I should all work if we have the dummy
> > inlines for relevant agp functions in linux/agp_backend.h.
> > -Daniel
> >
> >> ---
> >>   drivers/gpu/drm/drm_agpsupport.c | 12 ++--
> >>   drivers/gpu/drm/drm_memory.c | 18 --
> >>   include/drm/drm_agpsupport.h | 18 --
> >>   3 files changed, 6 insertions(+), 42 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/drm_agpsupport.c 
> >> b/drivers/gpu/drm/drm_agpsupport.c
> >> index 4c7ad46fdd21..8b690ef306de 100644
> >> --- a/drivers/gpu/drm/drm_agpsupport.c
> >> +++ b/drivers/gpu/drm/drm_agpsupport.c
> >> @@ -285,7 +285,7 @@ int drm_agp_unbind(struct drm_device *dev, struct 
> >> drm_agp_binding *request)
> >>  entry = drm_agp_lookup_entry(dev, request->handle);
> >>  if (!entry || !entry->bound)
> >>  return -EINVAL;
> >> -ret = drm_unbind_agp(entry->memory);
> >> +ret = agp_unbind_memory(entry->memory);
> >>  if (ret == 0)
> >>  entry->bound = 0;
> >>  return ret;
> >> @@ -326,7 +326,7 @@ int drm_agp_bind(struct drm_device *dev, struct 
> >> drm_agp_binding *request)
> >>  if (!entry || entry->bound)
> >>  return -EINVAL;
> >>  page = DIV_ROUND_UP(request->offset, PAGE_SIZE);
> >> -retcode = drm_bind_agp(entry->memory, page);
> >> +retcode = agp_bind_memory(entry->memory, page);
> >>  if (retcode)
> >>  return retcode;
> >>  entry->bound = dev->agp->base + (page << PAGE_SHIFT);
> >> @@ -369,11 +369,11 @@ int drm_agp_free(struct drm_device *dev, struct 
> >> drm_agp_buffer *request)
> >>  if (!entry)
> >>  return -EINVAL;
> >>  if (entry->bound)
> >> -drm_unbind_agp(entry->memory);
> >> +agp_unbind_memory(entry->memory);
> >>
> >>  list_del(>head);
> >>
> >> -drm_free_agp(entry->memory, entry->pages);
> >> +agp_free_memory(entry->memory);
> >>  kfree(entry);
> >>  return 0;
> >>   }
> >> @@ -453,8 +453,8 @@ void drm_legacy_agp_clear(struct drm_device *dev)
> >>
> >>  list_for_each_entry_safe(entry, tempe, >agp->memory, head) {
> >>  if (entry->bound)
> >> -drm_unbind_agp(entry->memory);
> >> -drm_free_agp(entry->memory, entry->pages);
> >> +agp_unbind_memory(entry->memory);
> >> +agp_free_memory(entry->memory);
> >>  kfree(entry);
> >>  }
> >>  INIT_LIST_HEAD(>agp->memory);
> >> diff --git a/drivers/gpu/drm/drm_memory.c b/drivers/gpu/drm/drm_memory.c
> >> index fbea69d6f909..f4f2bffdd5bd 100644
> >> --- a/drivers/gpu/drm/drm_memory.c
> >> +++ b/drivers/gpu/drm/drm_memory.c
> >> @@ -100,24 +100,6 @@ static void *agp_remap(unsigned long offset, unsigned 
> >> long size,
> >>  return addr;
> >>   }
> >>
> >> -/** Wrapper around agp_free_memory() */
> >> -void drm_free_agp(struct agp_memory *handle, int pages)
> >> -{
> >> -agp_free_memory(handle);
> >> -}
> >> -
> >> -/** Wrapper around agp_bind_memory() */
> >> -int drm_bind_agp(struct agp_memory *handle, unsigned int start)
> >> -{
> >> -return agp_bind_memory(handle, start);
> >> -}
> >> -
> >> -/** Wrapper around agp_unbind_memory() */
> >> -int drm_unbind_agp(struct agp_memory *handle)
> >> -{
> >> -return agp_unbind_memory(handle);
> >> -}
> >> -
> >>   #else /*  CONFIG_AGP  */
> >>   static inline void *agp_remap(unsigned long offset, unsigned long size,
> >>struct drm_device *dev)
> >> diff --git a/include/drm/drm_agpsupport.h b/include/drm/drm_agpsupport.h
> >> index 664e120b93e6..f3136750c490 100644
> >> --- a/include/drm/drm_agpsupport.h
> >> +++ b/include/drm/drm_agpsupport.h
> >> @@ -28,10 +28,6 @@ struct drm_agp_head {
> >>
> >>   #if IS_ENABLED(CONFIG_AGP)
> >>
> >> -void drm_free_agp(struct agp_memory * handle, int pages);
> >> -int drm_bind_agp(struct agp_memory * handle, unsigned int start);
> >> -int drm_unbind_agp(struct agp_memory * handle);
> >> -
> >>   struct drm_agp_head *drm_agp_init(struct drm_device *dev);
> >>   void drm_legacy_agp_clear(struct drm_device *dev);
> >>   int drm_agp_acquire(struct drm_device *dev);
> >> @@ -61,20 +57,6 @@ int drm_agp_bind_ioctl(struct drm_device *dev, void 
> >> *data,
> >>
> >>   #else /* CONFIG_AGP */
> >>
> >> -static inline void drm_free_agp(struct agp_memory * 

Re: [PATCH 13/40] drm/amd/display/dc/calcs/dce_calcs: Move some large variables from the stack to the heap

2021-01-12 Thread Lee Jones
On Mon, 11 Jan 2021, Lee Jones wrote:

> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c: In function 
> ‘calculate_bandwidth’:
>  drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:2016:1: warning: 
> the frame size of 1216 bytes is larger than 1024 bytes [-Wframe-larger-than=]
> 
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Colin Ian King 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 
> ---
>  .../gpu/drm/amd/display/dc/calcs/dce_calcs.c  | 21 +++
>  1 file changed, 17 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c 
> b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
> index 158d927c03e55..a0c69fae40ced 100644
> --- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
> +++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
> @@ -98,16 +98,16 @@ static void calculate_bandwidth(
>   int32_t num_cursor_lines;
>  
>   int32_t i, j, k;
> - struct bw_fixed yclk[3];
> - struct bw_fixed sclk[8];
> + struct bw_fixed *yclk;
> + struct bw_fixed *sclk;
>   bool d0_underlay_enable;
>   bool d1_underlay_enable;
>   bool fbc_enabled;
>   bool lpt_enabled;
>   enum bw_defines sclk_message;
>   enum bw_defines yclk_message;
> - enum bw_defines tiling_mode[maximum_number_of_surfaces];
> - enum bw_defines surface_type[maximum_number_of_surfaces];
> + enum bw_defines *tiling_mode;
> + enum bw_defines *surface_type;
>   enum bw_defines voltage;
>   enum bw_defines pipe_check;
>   enum bw_defines hsr_check;
> @@ -122,6 +122,14 @@ static void calculate_bandwidth(
>   int32_t number_of_displays_enabled_with_margin = 0;
>   int32_t number_of_aligned_displays_with_no_margin = 0;
>  
> + yclk = kzalloc(sizeof(*yclk) * 3, GFP_KERNEL);
> + sclk = kzalloc(sizeof(*sclk) * 8, GFP_KERNEL);
> +
> + tiling_mode = kzalloc(sizeof(*tiling_mode) *
> +   maximum_number_of_surfaces, GFP_KERNEL);
> + surface_type = kzalloc(sizeof(*surface_type) *
> +maximum_number_of_surfaces, GFP_KERNEL);

Please refrain from merging this yet.  I missed some error checking.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 14/40] drm/amd/display/dc/calcs/dce_calcs: Remove some large variables from the stack

2021-01-12 Thread Lee Jones
On Mon, 11 Jan 2021, Lee Jones wrote:

> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c: In function 
> ‘bw_calcs_init’:
>  drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:2726:1: warning: 
> the frame size of 1336 bytes is larger than 1024 bytes [-Wframe-larger-than=]
> 
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 
> ---
>  .../gpu/drm/amd/display/dc/calcs/dce_calcs.c  | 1115 +
>  1 file changed, 560 insertions(+), 555 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c 
> b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
> index a0c69fae40ced..f69c2b84d432b 100644
> --- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
> +++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
> @@ -2035,707 +2035,712 @@ void bw_calcs_init(struct bw_calcs_dceip *bw_dceip,
>   struct bw_calcs_vbios *bw_vbios,
>   struct hw_asic_id asic_id)
>  {
> - struct bw_calcs_dceip dceip = { 0 };
> - struct bw_calcs_vbios vbios = { 0 };
> + struct bw_calcs_dceip *dceip;
> + struct bw_calcs_vbios *vbios;
>  
>   enum bw_calcs_version version = bw_calcs_version_from_asic_id(asic_id);
>  
> - dceip.version = version;
> + dceip = kzalloc(sizeof(dceip), GFP_KERNEL);
> + vbios = kzalloc(sizeof(vbios), GFP_KERNEL);

Please don't review/merge this yet.  I missed some error checking.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v7 00/17] follow_pfn and other iomap races

2021-01-12 Thread Daniel Vetter
On Tue, Jan 12, 2021 at 2:24 PM Daniel Vetter  wrote:
>
> On Fri, Nov 27, 2020 at 05:41:14PM +0100, Daniel Vetter wrote:
> > Hi all
> >
> > Another update of my patch series to clamp down a bunch of races and gaps
> > around follow_pfn and other access to iomem mmaps. Previous version:
> >
> > v1: 
> > https://lore.kernel.org/dri-devel/20201007164426.1812530-1-daniel.vet...@ffwll.ch/
> > v2: 
> > https://lore.kernel.org/dri-devel/20201009075934.3509076-1-daniel.vet...@ffwll.ch
> > v3: 
> > https://lore.kernel.org/dri-devel/20201021085655.1192025-1-daniel.vet...@ffwll.ch/
> > v4: 
> > https://lore.kernel.org/dri-devel/20201026105818.2585306-1-daniel.vet...@ffwll.ch/
> > v5: 
> > https://lore.kernel.org/dri-devel/20201030100815.2269-1-daniel.vet...@ffwll.ch/
> > v6: 
> > https://lore.kernel.org/dri-devel/20201119144146.1045202-1-daniel.vet...@ffwll.ch/
> >
> > And the discussion that sparked this journey:
> >
> > https://lore.kernel.org/dri-devel/20201007164426.1812530-1-daniel.vet...@ffwll.ch/
> >
> > I think the first 12 patches are ready for landing. The parts starting
> > with "mm: Add unsafe_follow_pfn" probably need more baking time.
> >
> > Andrew, can you please pick these up, or do you prefer I do a topic branch
> > and send them to Linus directly in the next merge window?
> >
> > Changes in v7:
> > - more acks/reviews
> > - reordered with the ready pieces at the front
> > - simplified the new follow_pfn function as Jason suggested
> >
> > Changes in v6:
> > - Tested v4l userptr as Tomasz suggested. No boom observed
> > - Added RFC for locking down follow_pfn, per discussion with Christoph and
> >   Jason.
> > - Explain why pup_fast is safe in relevant patches, there was a bit a
> >   confusion when discussing v5.
> > - Fix up the resource patch, with CONFIG_IO_STRICT_DEVMEM it crashed on
> >   boot due to an unintended change (reported by John)
> >
> > Changes in v5:
> > - Tomasz found some issues in the media patches
> > - Polish suggested by Christoph for the unsafe_follow_pfn patch
> >
> > Changes in v4:
> > - Drop the s390 patch, that was very stand-alone and now queued up to land
> >   through s390 trees.
> > - Comment polish per Dan's review.
> >
> > Changes in v3:
> > - Bunch of polish all over, no functional changes aside from one barrier
> >   in the resource code, for consistency.
> > - A few more r-b tags.
> >
> > Changes in v2:
> > - tons of small polish all over, thanks to all the reviewers who
> >   spotted issues
> > - I managed to test at least the generic_access_phys and pci mmap revoke
> >   stuff with a few gdb sessions using our i915 debug tools (hence now also
> >   the drm/i915 patch to properly request all the pci bar regions)
> > - reworked approach for the pci mmap revoke: Infrastructure moved into
> >   kernel/resource.c, address_space mapping is now set up at open time for
> >   everyone (which required some sysfs changes). Does indeed look a lot
> >   cleaner and a lot less invasive than I feared at first.
> >
> > Coments and review on the remaining bits very much welcome, especially
> > from the kvm and vfio side.
> >
> > Cheers, Daniel
> >
> > Daniel Vetter (17):
> >   drm/exynos: Stop using frame_vector helpers
> >   drm/exynos: Use FOLL_LONGTERM for g2d cmdlists
> >   misc/habana: Stop using frame_vector helpers
> >   misc/habana: Use FOLL_LONGTERM for userptr
> >   mm/frame-vector: Use FOLL_LONGTERM
> >   media: videobuf2: Move frame_vector into media subsystem
> >   mm: Close race in generic_access_phys
> >   PCI: Obey iomem restrictions for procfs mmap
> >   /dev/mem: Only set filp->f_mapping
> >   resource: Move devmem revoke code to resource framework
> >   sysfs: Support zapping of binary attr mmaps
> >   PCI: Revoke mappings like devmem
>
> As Jason suggested, I've pulled the first 1 patches into a topic branch.

Uh this was meant to read "first _12_ patches" ofc.
-Daniel

>
> Stephen, can you please add the below to linux-next for the 5.12 merge
> window?
>
> git://anongit.freedesktop.org/drm/drm topic/iomem-mmap-vs-gup
>
> Once this part has landed I'll see what to do with the below part.
>
> Thanks, Daniel
>
> >   mm: Add unsafe_follow_pfn
> >   media/videobuf1|2: Mark follow_pfn usage as unsafe
> >   vfio/type1: Mark follow_pfn as unsafe
> >   kvm: pass kvm argument to follow_pfn callsites
> >   mm: add mmu_notifier argument to follow_pfn
> >
> >  arch/powerpc/kvm/book3s_64_mmu_hv.c   |   2 +-
> >  arch/powerpc/kvm/book3s_64_mmu_radix.c|   2 +-
> >  arch/powerpc/kvm/e500_mmu_host.c  |   2 +-
> >  arch/x86/kvm/mmu/mmu.c|   8 +-
> >  drivers/char/mem.c|  86 +-
> >  drivers/gpu/drm/exynos/Kconfig|   1 -
> >  drivers/gpu/drm/exynos/exynos_drm_g2d.c   |  48 
> >  drivers/media/common/videobuf2/Kconfig|   1 -
> >  drivers/media/common/videobuf2/Makefile   |   1 +
> >  .../media/common/videobuf2}/frame_vector.c|  57 -
> 

Re: [PATCH v7 00/17] follow_pfn and other iomap races

2021-01-12 Thread Daniel Vetter
On Fri, Nov 27, 2020 at 05:41:14PM +0100, Daniel Vetter wrote:
> Hi all
> 
> Another update of my patch series to clamp down a bunch of races and gaps
> around follow_pfn and other access to iomem mmaps. Previous version:
> 
> v1: 
> https://lore.kernel.org/dri-devel/20201007164426.1812530-1-daniel.vet...@ffwll.ch/
> v2: 
> https://lore.kernel.org/dri-devel/20201009075934.3509076-1-daniel.vet...@ffwll.ch
> v3: 
> https://lore.kernel.org/dri-devel/20201021085655.1192025-1-daniel.vet...@ffwll.ch/
> v4: 
> https://lore.kernel.org/dri-devel/20201026105818.2585306-1-daniel.vet...@ffwll.ch/
> v5: 
> https://lore.kernel.org/dri-devel/20201030100815.2269-1-daniel.vet...@ffwll.ch/
> v6: 
> https://lore.kernel.org/dri-devel/20201119144146.1045202-1-daniel.vet...@ffwll.ch/
> 
> And the discussion that sparked this journey:
> 
> https://lore.kernel.org/dri-devel/20201007164426.1812530-1-daniel.vet...@ffwll.ch/
> 
> I think the first 12 patches are ready for landing. The parts starting
> with "mm: Add unsafe_follow_pfn" probably need more baking time.
> 
> Andrew, can you please pick these up, or do you prefer I do a topic branch
> and send them to Linus directly in the next merge window?
> 
> Changes in v7:
> - more acks/reviews
> - reordered with the ready pieces at the front
> - simplified the new follow_pfn function as Jason suggested
> 
> Changes in v6:
> - Tested v4l userptr as Tomasz suggested. No boom observed
> - Added RFC for locking down follow_pfn, per discussion with Christoph and
>   Jason.
> - Explain why pup_fast is safe in relevant patches, there was a bit a
>   confusion when discussing v5.
> - Fix up the resource patch, with CONFIG_IO_STRICT_DEVMEM it crashed on
>   boot due to an unintended change (reported by John)
> 
> Changes in v5:
> - Tomasz found some issues in the media patches
> - Polish suggested by Christoph for the unsafe_follow_pfn patch
> 
> Changes in v4:
> - Drop the s390 patch, that was very stand-alone and now queued up to land
>   through s390 trees.
> - Comment polish per Dan's review.
> 
> Changes in v3:
> - Bunch of polish all over, no functional changes aside from one barrier
>   in the resource code, for consistency.
> - A few more r-b tags.
> 
> Changes in v2:
> - tons of small polish all over, thanks to all the reviewers who
>   spotted issues
> - I managed to test at least the generic_access_phys and pci mmap revoke
>   stuff with a few gdb sessions using our i915 debug tools (hence now also
>   the drm/i915 patch to properly request all the pci bar regions)
> - reworked approach for the pci mmap revoke: Infrastructure moved into
>   kernel/resource.c, address_space mapping is now set up at open time for
>   everyone (which required some sysfs changes). Does indeed look a lot
>   cleaner and a lot less invasive than I feared at first.
> 
> Coments and review on the remaining bits very much welcome, especially
> from the kvm and vfio side.
> 
> Cheers, Daniel
> 
> Daniel Vetter (17):
>   drm/exynos: Stop using frame_vector helpers
>   drm/exynos: Use FOLL_LONGTERM for g2d cmdlists
>   misc/habana: Stop using frame_vector helpers
>   misc/habana: Use FOLL_LONGTERM for userptr
>   mm/frame-vector: Use FOLL_LONGTERM
>   media: videobuf2: Move frame_vector into media subsystem
>   mm: Close race in generic_access_phys
>   PCI: Obey iomem restrictions for procfs mmap
>   /dev/mem: Only set filp->f_mapping
>   resource: Move devmem revoke code to resource framework
>   sysfs: Support zapping of binary attr mmaps
>   PCI: Revoke mappings like devmem

As Jason suggested, I've pulled the first 1 patches into a topic branch.

Stephen, can you please add the below to linux-next for the 5.12 merge
window?

git://anongit.freedesktop.org/drm/drm topic/iomem-mmap-vs-gup

Once this part has landed I'll see what to do with the below part.

Thanks, Daniel

>   mm: Add unsafe_follow_pfn
>   media/videobuf1|2: Mark follow_pfn usage as unsafe
>   vfio/type1: Mark follow_pfn as unsafe
>   kvm: pass kvm argument to follow_pfn callsites
>   mm: add mmu_notifier argument to follow_pfn
> 
>  arch/powerpc/kvm/book3s_64_mmu_hv.c   |   2 +-
>  arch/powerpc/kvm/book3s_64_mmu_radix.c|   2 +-
>  arch/powerpc/kvm/e500_mmu_host.c  |   2 +-
>  arch/x86/kvm/mmu/mmu.c|   8 +-
>  drivers/char/mem.c|  86 +-
>  drivers/gpu/drm/exynos/Kconfig|   1 -
>  drivers/gpu/drm/exynos/exynos_drm_g2d.c   |  48 
>  drivers/media/common/videobuf2/Kconfig|   1 -
>  drivers/media/common/videobuf2/Makefile   |   1 +
>  .../media/common/videobuf2}/frame_vector.c|  57 -
>  .../media/common/videobuf2/videobuf2-memops.c |   3 +-
>  drivers/media/platform/omap/Kconfig   |   1 -
>  drivers/media/v4l2-core/videobuf-dma-contig.c |   2 +-
>  drivers/misc/habanalabs/Kconfig   |   1 -
>  drivers/misc/habanalabs/common/habanalabs.h   |   6 +-
>  

[PULL] drm-misc-fixes

2021-01-12 Thread Thomas Zimmermann
Hi Dave and Daniel,

here's this week's PR for drm-misc-fixes.

Best regards
Thomas

drm-misc-fixes-2021-01-12:
 * dma-buf: Fix a memory leak in CMAV heap
 * drm: Fix format check for legacy pageflips
 * ttm: Pass correct address to dma_mapping_error(); Use mutex in pool
   shrinker
The following changes since commit a73858ef4d5e1d425e171f0f6a52864176a6a979:

  drm/ttm: unexport ttm_pool_init/fini (2021-01-07 14:25:43 +0100)

are available in the Git repository at:

  git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2021-01-12

for you to fetch changes up to bb52cb0dec8d2fecdb22843a805131478a180728:

  drm/ttm: make the pool shrinker lock a mutex (2021-01-12 14:02:08 +0100)


Short summary of fixes pull:

 * dma-buf: Fix a memory leak in CMAV heap
 * drm: Fix format check for legacy pageflips
 * ttm: Pass correct address to dma_mapping_error(); Use mutex in pool
   shrinker


Bas Nieuwenhuizen (1):
  drm: Check actual format for legacy pageflip.

Christian König (1):
  drm/ttm: make the pool shrinker lock a mutex

Jeremy Cline (1):
  drm/ttm: Fix address passed to dma_mapping_error() in ttm_pool_map()

John Stultz (1):
  dma-buf: cma_heap: Fix memory leak in CMA heap

 drivers/dma-buf/heaps/cma_heap.c |  3 +++
 drivers/gpu/drm/drm_plane.c  |  9 -
 drivers/gpu/drm/ttm/ttm_pool.c   | 22 +++---
 3 files changed, 22 insertions(+), 12 deletions(-)

--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCHv1] video: omapfb2: Make standard and custom DSI command mode panel driver mutually exclusive

2021-01-12 Thread Tomi Valkeinen
Hi,

On 12/01/2021 14:02, Sebastian Reichel wrote:
> [replace Tomi's TI mail address with something working]
> 
> Hi,
> 
> On Fri, Jan 08, 2021 at 08:58:39PM +0100, Sam Ravnborg wrote:
>> Hi Sebastian,
>>
>> On Fri, Jan 08, 2021 at 12:24:41PM +0100, Sebastian Reichel wrote:
>>> Standard DRM panel driver for DSI command mode panel used by omapfb2 is also
>>> available now. Just like the other panels its module name clashes with the
>>> module from drivers/video/fbdev/omap2/omapfb/displays, part of the 
>>> deprecated
>>> omapfb2 fbdev driver. As omapfb2 can only be compiled when the omapdrm 
>>> driver
>>> is disabled, and the DRM panel drivers are useless in that case, make the
>>> omapfb2 panel depend on the standard DRM panels being disabled to fix
>>> the name clash.
>>>
>>> Fixes: cf64148abcfd ("drm/panel: Move OMAP's DSI command mode panel driver")
>>> Reported-by: Stephen Rothwell 
>>> Signed-off-by: Sebastian Reichel 
>>
>> For a backport this looks good:
>> Acked-by: Sam Ravnborg 
> 
> Thanks.

Thanks. I'll push to drm-misc-next, as that's where the commit that
breaks this is.

>> But why is it it we need omapfb at all when we have omapdrm?
> 
> I think there are two reasons omapfb has not been killed yet. One
> reason was missing support for manually updated DSI panels, which
> have been working since 1 or 2 kernel releases now. The other reason
> is some people using it in combination with an out-of-tree PowerVR
> kernel driver. There is currently work going on to use a more recent
> PowerVR driver based on omapdrm driven by Maemo Leste people.

omapfb also has a custom sysfw API, so applications that depend on it
would not work anymore. I don't know if there are such applications, though.

>> Can we sunset all or some parts of omap support in video/?
>> If not, what is missing to do so.
> 
> IDK the exact status of the PowerVR work and have not been using
> omapfb myself for years. I don't think there is a reason to rush
> this, so my suggestion is removing it in 3 steps giving people
> the chance to complain:
> 
> 1. Add 'depends on EXPERT' to 'FB_OMAP2' and add deprecation notice
>referencing omapdrm in help text in 5.12
> 2. Add 'depends on BROKEN' in 5.13
> 3. Drop drivers/video/fbdev/omap2 afterwards

I'd love to remove omapfb, but I also fear that there are still people
using it. We can try the above sequence, but it's probably better to go
slower, as people may not be using the latest kernels.

 Tomi
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v4 04/13] drm/shmem-helper: Provide a vmap function for short-term mappings

2021-01-12 Thread Thomas Zimmermann

Hi

Am 11.01.21 um 17:50 schrieb Daniel Vetter:

On Fri, Jan 08, 2021 at 10:43:31AM +0100, Thomas Zimmermann wrote:

Implementations of the vmap/vunmap GEM callbacks may perform pinning
of the BO and may acquire the associated reservation object's lock.
Callers that only require a mapping of the contained memory can thus
interfere with other tasks that require exact pinning, such as scanout.
This is less of an issue with private SHMEM buffers, but may happen
with imported ones.

Therefore provide the new interfaces drm_gem_shmem_vmap_local() and
drm_gem_shmem_vunmap_local(), which only perform the vmap/vunmap
operations. Callers have to hold the reservation lock while the mapping
persists.

This patch also connects GEM SHMEM helpers to GEM object functions with
equivalent functionality.

v4:
* call dma_buf_{vmap,vunmap}_local() where necessary (Daniel)
* move driver changes into separate patches (Daniel)

Signed-off-by: Thomas Zimmermann 
---
  drivers/gpu/drm/drm_gem_shmem_helper.c | 90 +++---
  include/drm/drm_gem_shmem_helper.h |  2 +
  2 files changed, 84 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c 
b/drivers/gpu/drm/drm_gem_shmem_helper.c
index 9825c378dfa6..298832b2b43b 100644
--- a/drivers/gpu/drm/drm_gem_shmem_helper.c
+++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
@@ -32,6 +32,8 @@ static const struct drm_gem_object_funcs drm_gem_shmem_funcs 
= {
.get_sg_table = drm_gem_shmem_get_sg_table,
.vmap = drm_gem_shmem_vmap,
.vunmap = drm_gem_shmem_vunmap,
+   .vmap_local = drm_gem_shmem_vmap_local,
+   .vunmap_local = drm_gem_shmem_vunmap_local,
.mmap = drm_gem_shmem_mmap,
  };
  
@@ -261,7 +263,8 @@ void drm_gem_shmem_unpin(struct drm_gem_object *obj)

  }
  EXPORT_SYMBOL(drm_gem_shmem_unpin);
  
-static int drm_gem_shmem_vmap_locked(struct drm_gem_shmem_object *shmem, struct dma_buf_map *map)

+static int drm_gem_shmem_vmap_locked(struct drm_gem_shmem_object *shmem, 
struct dma_buf_map *map,
+bool local)


This is a bit spaghetti and also has the problem that we're not changing
shmem->vmap_use_count under different locks, depending upon which path
we're taking.

I think the cleanest would be if we pull the if (import_attach) case out
of the _locked() version completely, for all cases, and also outside of
the shmem->vmap_lock. This means no caching of vmaps in the shmem layer
anymore for imported buffers, but this is no longer a problem: We cache
them in the exporters instead (I think at least, if not maybe need to fix
that where it's expensive).


If we do that, what protects shmem->vaddr from concurrent access near 
line 281? would it be kept NULL then?


Also, we have some stats in debugfs (see drm_gem_shmem_print_info) which 
would be incorrect (or misleading at least).


Given all that, would it be possible to remove vmap_lock in favor of 
taking the resv lock in vmap/vunmap?


Best regards
Thomas



Other option would be to unly pull it out for the _vmap_local case, but
that's a bit ugly because no longer symmetrical in the various paths.


  {
struct drm_gem_object *obj = >base;
int ret = 0;
@@ -272,7 +275,10 @@ static int drm_gem_shmem_vmap_locked(struct 
drm_gem_shmem_object *shmem, struct
}
  
  	if (obj->import_attach) {

-   ret = dma_buf_vmap(obj->import_attach->dmabuf, map);
+   if (local)
+   ret = dma_buf_vmap_local(obj->import_attach->dmabuf, 
map);
+   else
+   ret = dma_buf_vmap(obj->import_attach->dmabuf, map);
if (!ret) {
if (WARN_ON(map->is_iomem)) {
ret = -EIO;
@@ -313,7 +319,7 @@ static int drm_gem_shmem_vmap_locked(struct 
drm_gem_shmem_object *shmem, struct
return ret;
  }
  
-/*

+/**
   * drm_gem_shmem_vmap - Create a virtual mapping for a shmem GEM object
   * @shmem: shmem GEM object
   * @map: Returns the kernel virtual address of the SHMEM GEM object's backing
@@ -339,15 +345,53 @@ int drm_gem_shmem_vmap(struct drm_gem_object *obj, struct 
dma_buf_map *map)
ret = mutex_lock_interruptible(>vmap_lock);
if (ret)
return ret;
-   ret = drm_gem_shmem_vmap_locked(shmem, map);
+   ret = drm_gem_shmem_vmap_locked(shmem, map, false);
mutex_unlock(>vmap_lock);
  
  	return ret;

  }
  EXPORT_SYMBOL(drm_gem_shmem_vmap);
  
+/**

+ * drm_gem_shmem_vmap_local - Create a virtual mapping for a shmem GEM object
+ * @shmem: shmem GEM object
+ * @map: Returns the kernel virtual address of the SHMEM GEM object's backing
+ *   store.
+ *
+ * This function makes sure that a contiguous kernel virtual address mapping
+ * exists for the buffer backing the shmem GEM object.
+ *
+ * The function is called with the BO's reservation object locked. Callers must
+ * hold the lock until after unmapping the buffer.
+ *
+ * 

[PATCH AUTOSEL 4.19 15/16] drm/msm: Call msm_init_vram before binding the gpu

2021-01-12 Thread Sasha Levin
From: Craig Tatlor 

[ Upstream commit d863f0c7b536288e2bd40cbc01c10465dd226b11 ]

vram.size is needed when binding a gpu without an iommu and is defined
in msm_init_vram(), so run that before binding it.

Signed-off-by: Craig Tatlor 
Reviewed-by: Brian Masney 
Tested-by: Alexey Minnekhanov 
Signed-off-by: Rob Clark 
Signed-off-by: Sasha Levin 
---
 drivers/gpu/drm/msm/msm_drv.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 3ba3ae9749bec..81de5e1659551 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -483,14 +483,14 @@ static int msm_drm_init(struct device *dev, struct 
drm_driver *drv)
 
drm_mode_config_init(ddev);
 
-   /* Bind all our sub-components: */
-   ret = component_bind_all(dev, ddev);
+   ret = msm_init_vram(ddev);
if (ret)
goto err_destroy_mdss;
 
-   ret = msm_init_vram(ddev);
+   /* Bind all our sub-components: */
+   ret = component_bind_all(dev, ddev);
if (ret)
-   goto err_msm_uninit;
+   goto err_destroy_mdss;
 
if (!dev->dma_parms) {
dev->dma_parms = devm_kzalloc(dev, sizeof(*dev->dma_parms),
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH AUTOSEL 5.4 27/28] drm/msm: Call msm_init_vram before binding the gpu

2021-01-12 Thread Sasha Levin
From: Craig Tatlor 

[ Upstream commit d863f0c7b536288e2bd40cbc01c10465dd226b11 ]

vram.size is needed when binding a gpu without an iommu and is defined
in msm_init_vram(), so run that before binding it.

Signed-off-by: Craig Tatlor 
Reviewed-by: Brian Masney 
Tested-by: Alexey Minnekhanov 
Signed-off-by: Rob Clark 
Signed-off-by: Sasha Levin 
---
 drivers/gpu/drm/msm/msm_drv.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 108632a1f2438..8d9d86c76a4e9 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -432,14 +432,14 @@ static int msm_drm_init(struct device *dev, struct 
drm_driver *drv)
 
drm_mode_config_init(ddev);
 
-   /* Bind all our sub-components: */
-   ret = component_bind_all(dev, ddev);
+   ret = msm_init_vram(ddev);
if (ret)
goto err_destroy_mdss;
 
-   ret = msm_init_vram(ddev);
+   /* Bind all our sub-components: */
+   ret = component_bind_all(dev, ddev);
if (ret)
-   goto err_msm_uninit;
+   goto err_destroy_mdss;
 
if (!dev->dma_parms) {
dev->dma_parms = devm_kzalloc(dev, sizeof(*dev->dma_parms),
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH AUTOSEL 5.4 24/28] drm/amdgpu: fix a GPU hang issue when remove device

2021-01-12 Thread Sasha Levin
From: Dennis Li 

[ Upstream commit 88e21af1b3f887d217f2fb14fc7e7d3cd87ebf57 ]

When GFXOFF is enabled and GPU is idle, driver will fail to access some
registers. Therefore change to disable power gating before all access
registers with MMIO.

Dmesg log is as following:
amdgpu :03:00.0: amdgpu: amdgpu: finishing device.
amdgpu: cp queue pipe 4 queue 0 preemption failed
amdgpu :03:00.0: amdgpu: failed to write reg 2890 wait reg 28a2
amdgpu :03:00.0: amdgpu: failed to write reg 1a6f4 wait reg 1a706
amdgpu :03:00.0: amdgpu: failed to write reg 2890 wait reg 28a2
amdgpu :03:00.0: amdgpu: failed to write reg 1a6f4 wait reg 1a706

Signed-off-by: Dennis Li 
Reviewed-by: Hawking Zhang 
Signed-off-by: Alex Deucher 
Signed-off-by: Sasha Levin 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 29141bff4b572..3b3fc9a426e91 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2057,11 +2057,11 @@ static int amdgpu_device_ip_fini(struct amdgpu_device 
*adev)
if (adev->gmc.xgmi.num_physical_nodes > 1)
amdgpu_xgmi_remove_device(adev);
 
-   amdgpu_amdkfd_device_fini(adev);
-
amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
 
+   amdgpu_amdkfd_device_fini(adev);
+
/* need to disable SMC first */
for (i = 0; i < adev->num_ip_blocks; i++) {
if (!adev->ip_blocks[i].status.hw)
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH AUTOSEL 5.10 49/51] drm/msm: Call msm_init_vram before binding the gpu

2021-01-12 Thread Sasha Levin
From: Craig Tatlor 

[ Upstream commit d863f0c7b536288e2bd40cbc01c10465dd226b11 ]

vram.size is needed when binding a gpu without an iommu and is defined
in msm_init_vram(), so run that before binding it.

Signed-off-by: Craig Tatlor 
Reviewed-by: Brian Masney 
Tested-by: Alexey Minnekhanov 
Signed-off-by: Rob Clark 
Signed-off-by: Sasha Levin 
---
 drivers/gpu/drm/msm/msm_drv.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 49685571dc0ee..d556c353e5aea 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -444,14 +444,14 @@ static int msm_drm_init(struct device *dev, struct 
drm_driver *drv)
 
drm_mode_config_init(ddev);
 
-   /* Bind all our sub-components: */
-   ret = component_bind_all(dev, ddev);
+   ret = msm_init_vram(ddev);
if (ret)
goto err_destroy_mdss;
 
-   ret = msm_init_vram(ddev);
+   /* Bind all our sub-components: */
+   ret = component_bind_all(dev, ddev);
if (ret)
-   goto err_msm_uninit;
+   goto err_destroy_mdss;
 
dma_set_max_seg_size(dev, UINT_MAX);
 
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH AUTOSEL 5.10 43/51] drm/amd/pm: fix the failure when change power profile for renoir

2021-01-12 Thread Sasha Levin
From: Xiaojian Du 

[ Upstream commit 44cb39e19a05ca711bcb6e776e0a4399223204a0 ]

This patch is to fix the failure when change power profile to
"profile_peak" for renoir.

Signed-off-by: Xiaojian Du 
Reviewed-by: Huang Rui 
Signed-off-by: Alex Deucher 
Signed-off-by: Sasha Levin 
---
 drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 1 +
 drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c 
b/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c
index 66c1026489bee..425c48e100e4f 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c
@@ -188,6 +188,7 @@ static int renoir_get_dpm_clk_limited(struct smu_context 
*smu, enum smu_clk_type
return -EINVAL;
*freq = clk_table->SocClocks[dpm_level].Freq;
break;
+   case SMU_UCLK:
case SMU_MCLK:
if (dpm_level >= NUM_FCLK_DPM_LEVELS)
return -EINVAL;
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c 
b/drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c
index 660f403d5770c..7907c9e0b5dec 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c
@@ -222,6 +222,7 @@ int smu_v12_0_set_soft_freq_limited_range(struct 
smu_context *smu, enum smu_clk_
break;
case SMU_FCLK:
case SMU_MCLK:
+   case SMU_UCLK:
ret = smu_cmn_send_smc_msg_with_param(smu, 
SMU_MSG_SetHardMinFclkByFreq, min, NULL);
if (ret)
return ret;
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


  1   2   >