[Bug 101739] An issue with alpha-to-coverage handling is causing Arma 3 64-bit Linux port to render trees incorrectly

2018-08-04 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101739

--- Comment #16 from Gregor Münch  ---
Tested today and the bug is still there with current git (also with nir). The
workaround also still works and at least on my Tahiti card I actually
experience no performance drop.

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


[Bug 99923] HITMAN (2016) having lighting and artefacting, and overly light room.

2018-08-04 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=99923

--- Comment #34 from Gregor Münch  ---
Can confirm this is still an issue with current Mesa / LLVM git on Radeon HD
7970. Also the game has huge fps drops in certain areas.

The bug is now almost two years old and makes the game unplayable. Its really a
pity that no dev found time to fix this.
I guess its time that AMD or Valve contracts a company to care for those bugs
and general driver quality.

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


Re: [Freedreno] [PATCH 08/13] drm/msm/gpu: Rearrange the code that collects the task during a hang

2018-08-04 Thread Rob Clark
On Thu, Jul 12, 2018 at 3:48 PM Chris Wilson  wrote:
>
> Quoting Jordan Crouse (2018-07-12 19:59:25)
> > Do a bit of cleanup to prepare for upcoming changes to pass the
> > hanging task comm and cmdline to the crash dump function.
> >
> > Signed-off-by: Jordan Crouse 
> > ---
> >  drivers/gpu/drm/msm/msm_gpu.c | 18 ++
> >  1 file changed, 10 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
> > index 1c09acfb4028..2ca354047250 100644
> > --- a/drivers/gpu/drm/msm/msm_gpu.c
> > +++ b/drivers/gpu/drm/msm/msm_gpu.c
> > @@ -314,6 +314,7 @@ static void recover_worker(struct work_struct *work)
> > struct msm_drm_private *priv = dev->dev_private;
> > struct msm_gem_submit *submit;
> > struct msm_ringbuffer *cur_ring = gpu->funcs->active_ring(gpu);
> > +   char *comm = NULL, *cmd = NULL;
> > int i;
> >
> > mutex_lock(>struct_mutex);
> > @@ -327,7 +328,7 @@ static void recover_worker(struct work_struct *work)
> > rcu_read_lock();
> > task = pid_task(submit->pid, PIDTYPE_PID);
> > if (task) {
> > -   char *cmd;
> > +   comm = kstrdup(task->comm, GFP_KERNEL);
>
> Under rcu_read_lock(), GFP_KERNEL is not allowed, you need GFP_NOWAIT or
> some such (or grab a reference to the pid and drop rcu then GFP_KERNEL).

I started looking at a similar issue w/ our use of
kstrdup_quotable_cmdline() under rcu_read_lock().. I *guess* I hadn't
noticed it before due to different RCU kconfig?

I can use GFP_ATOMIC, and I can fix kstrdup_quotable_cmdline() to
actually use gfp flags passed in for kmalloc() (and similar bug in
kstrdup_quotable_file()).. but get_cmdline() still grabs mmap_sem
which complains under rcu_read_lock()..

is there any way to ensure the tast_struct sticks around long enough
to get it's cmdline without holding rcu_read_lock()?  I couldn't find
any refcnt'ing on task_struct itself, which makes this seem a bit
unsolveable :-/

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


[PATCH v3 09/10] drm/vc4: Use __drm_atomic_helper_plane_reset instead of copying the logic

2018-08-04 Thread Alexandru Gheorghe
A new helper function(__drm_atomic_helper_plane_reset) has been added
for linking a plane with its state and resetting the core
properties(alpha, rotation, etc.) to their default values.
Use that instead of duplicating the logic.

__drm_atomic_helper_plane_reset initializes the alpha property to its
max value, which is defined by the drm core as DRM_BLEND_ALPHA_OPAQUE,
so nothing changes regarding the alpha value.

Signed-off-by: Alexandru Gheorghe 
---
 drivers/gpu/drm/vc4/vc4_plane.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
index 9d7a36f148cf..688ad9bb0f08 100644
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -200,9 +200,7 @@ static void vc4_plane_reset(struct drm_plane *plane)
if (!vc4_state)
return;
 
-   plane->state = _state->base;
-   plane->state->alpha = DRM_BLEND_ALPHA_OPAQUE;
-   vc4_state->base.plane = plane;
+   __drm_atomic_helper_plane_reset(plane, _state->base);
 }
 
 static void vc4_dlist_write(struct vc4_plane_state *vc4_state, u32 val)
-- 
2.18.0

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


[PATCH v3 05/10] drm/exynos: Use __drm_atomic_helper_plane_reset instead of copying the logic

2018-08-04 Thread Alexandru Gheorghe
A new helper function(__drm_atomic_helper_plane_reset) has been added
for linking a plane with its state and resetting the core
properties(alpha, rotation, etc.) to their default values.
Use that instead of duplicating the logic.

Signed-off-by: Alexandru Gheorghe 
---
 drivers/gpu/drm/exynos/exynos_drm_plane.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c 
b/drivers/gpu/drm/exynos/exynos_drm_plane.c
index eb9915da7dec..681328fbe7de 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_plane.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c
@@ -139,8 +139,7 @@ static void exynos_drm_plane_reset(struct drm_plane *plane)
 
exynos_state = kzalloc(sizeof(*exynos_state), GFP_KERNEL);
if (exynos_state) {
-   plane->state = _state->base;
-   plane->state->plane = plane;
+   __drm_atomic_helper_plane_reset(plane, _state->base);
plane->state->zpos = exynos_plane->config->zpos;
}
 }
-- 
2.18.0

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


[PATCH v3 08/10] drm/sun4i: Use __drm_atomic_helper_plane_reset instead of copying the logic

2018-08-04 Thread Alexandru Gheorghe
A new helper function(__drm_atomic_helper_plane_reset) has been added
for linking a plane with its state and resetting the core
properties(alpha, rotation, etc.) to their default values.
Use that instead of duplicating the logic.

__drm_atomic_helper_plane_reset initializes the alpha property to its
max value, which is defined by the drm core as DRM_BLEND_ALPHA_OPAQUE,
so nothing changes regarding the alpha value.

Acked-by: Maxime Ripard 
Signed-off-by: Alexandru Gheorghe 
---
 drivers/gpu/drm/sun4i/sun4i_layer.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c 
b/drivers/gpu/drm/sun4i/sun4i_layer.c
index 750ad24de1d7..78f77af8805a 100644
--- a/drivers/gpu/drm/sun4i/sun4i_layer.c
+++ b/drivers/gpu/drm/sun4i/sun4i_layer.c
@@ -35,9 +35,7 @@ static void sun4i_backend_layer_reset(struct drm_plane *plane)
 
state = kzalloc(sizeof(*state), GFP_KERNEL);
if (state) {
-   plane->state = >state;
-   plane->state->plane = plane;
-   plane->state->alpha = DRM_BLEND_ALPHA_OPAQUE;
+   __drm_atomic_helper_plane_reset(plane, >state);
plane->state->zpos = layer->id;
}
 }
-- 
2.18.0

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


[PATCH v3 04/10] drm: atmel-hlcdc: Use __drm_atomic_helper_plane_reset instead of copying the logic

2018-08-04 Thread Alexandru Gheorghe
A new helper function(__drm_atomic_helper_plane_reset) has been added
for linking a plane with its state and resetting the core
properties(alpha, rotation, etc.) to their default values.
Use that instead of duplicating the logic.

__drm_atomic_helper_plane_reset initializes the alpha property to its
max value, which is defined by the drm core as DRM_BLEND_ALPHA_OPAQUE,
so nothing changes regarding the alpha value.

Acked-by: Boris Brezillon 
Signed-off-by: Alexandru Gheorghe 
---
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c 
b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
index 04440064b9b7..9330a076e15a 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
@@ -942,10 +942,7 @@ static void atmel_hlcdc_plane_reset(struct drm_plane *p)
"Failed to allocate initial plane state\n");
return;
}
-
-   p->state = >base;
-   p->state->alpha = DRM_BLEND_ALPHA_OPAQUE;
-   p->state->plane = p;
+   __drm_atomic_helper_plane_reset(p, >base);
}
 }
 
-- 
2.18.0

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


[PATCH v3 10/10] drm/vmwgfx: Use __drm_atomic_helper_plane_reset instead of copying the logic

2018-08-04 Thread Alexandru Gheorghe
A new helper function(__drm_atomic_helper_plane_reset) has been added
for linking a plane with its state and resetting the core
properties(alpha, rotation, etc.) to their default values.
Use that instead of duplicating the logic.

Reviewed-by: Sinclair Yeh 
Reviewed-by: Deepak Rawat 
Signed-off-by: Alexandru Gheorghe 
---
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c 
b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
index 4a0f0f41afa1..61824e360619 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
@@ -720,9 +720,7 @@ void vmw_du_plane_reset(struct drm_plane *plane)
return;
}
 
-   plane->state = >base;
-   plane->state->plane = plane;
-   plane->state->rotation = DRM_MODE_ROTATE_0;
+   __drm_atomic_helper_plane_reset(plane, >base);
 }
 
 
-- 
2.18.0

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


[PATCH v3 06/10] drm/imx: Use __drm_atomic_helper_plane_reset instead of copying the logic

2018-08-04 Thread Alexandru Gheorghe
A new helper function(__drm_atomic_helper_plane_reset) has been added
for linking a plane with its state and resetting the core
properties(alpha, rotation, etc.) to their default values.
Use that instead of duplicating the logic.

Signed-off-by: Alexandru Gheorghe 
---
 drivers/gpu/drm/imx/ipuv3-plane.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c 
b/drivers/gpu/drm/imx/ipuv3-plane.c
index 203f247d4854..1bd4de03ce9e 100644
--- a/drivers/gpu/drm/imx/ipuv3-plane.c
+++ b/drivers/gpu/drm/imx/ipuv3-plane.c
@@ -281,16 +281,14 @@ static void ipu_plane_state_reset(struct drm_plane *plane)
ipu_state = to_ipu_plane_state(plane->state);
__drm_atomic_helper_plane_destroy_state(plane->state);
kfree(ipu_state);
+   plane->state = NULL;
}
 
ipu_state = kzalloc(sizeof(*ipu_state), GFP_KERNEL);
 
-   if (ipu_state) {
-   ipu_state->base.plane = plane;
-   ipu_state->base.rotation = DRM_MODE_ROTATE_0;
-   }
+   if (ipu_state)
+   __drm_atomic_helper_plane_reset(plane, _state->base);
 
-   plane->state = _state->base;
 }
 
 static struct drm_plane_state *
-- 
2.18.0

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


[PATCH v3 02/10] drm/amd/display: Use __drm_atomic_helper_plane_reset instead of copying the logic

2018-08-04 Thread Alexandru Gheorghe
A new helper function(__drm_atomic_helper_plane_reset) has been added
for linking a plane with its state and resetting the core
properties(alpha, rotation, etc) to their default values.
Use that instead of duplicating the logic.

Reviewed-by: Harry Wentland 
Signed-off-by: Alexandru Gheorghe 
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 ++-
 1 file changed, 2 insertions(+), 5 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 ae09331eed00..8e4978d5b83f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -2965,11 +2965,8 @@ static void dm_drm_plane_reset(struct drm_plane *plane)
amdgpu_state = kzalloc(sizeof(*amdgpu_state), GFP_KERNEL);
WARN_ON(amdgpu_state == NULL);

-   if (amdgpu_state) {
-   plane->state = _state->base;
-   plane->state->plane = plane;
-   plane->state->rotation = DRM_MODE_ROTATE_0;
-   }
+   if (amdgpu_state)
+   __drm_atomic_helper_plane_reset(plane, _state->base);
 }
 
 static struct drm_plane_state *
-- 
2.18.0

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


[PATCH v3 00/10] Add helper for plane reset

2018-08-04 Thread Alexandru Gheorghe
No significant change since v2, fixed a spelling mistake and
added/removed some newlines in 01 and 07 patches.

I plan to apply the first patch of the series and the patches for
the drivers maintained through drm-misc(that go Reviewed/Ack) in
drm-misc-next on Monday.

For the other drivers please let me know if you want me to push them
in drm-misc-next as well.

Changes since v1: 
 - Make __drm_atomic_helper_plane_reset consistent with the other
   helpers and require that both plane and state not be NULL,
   suggested by Boris Brezillon and Philipp Zabel. Drivers already
   check for that.
 - Add a proper commit message for driver changes.

Drivers that subclass drm_plane need to copy the logic for linking the
drm_plane with its state and to initialize core properties to their
default values. E.g (alpha and rotation)

Having a helper to reset the plane_state makes sense because of multiple
reasons:
1. Eliminate code duplication.
2. Add a single place for initializing core properties to their
default values, no need for driver to do it if what the helper sets
makes sense for them.
3. No need to debug the driver when you enable a core property and
observe it doesn't have a proper default value.

Tested with mali-dp the other drivers are just built-tested.


Alexandru Gheorghe (10):
  drm/atomic: Add  __drm_atomic_helper_plane_reset
  drm/amd/display: Use __drm_atomic_helper_plane_reset instead of
copying the logic
  drm: mali-dp: Use __drm_atomic_helper_plane_reset instead of copying
the logic
  drm: atmel-hlcdc: Use __drm_atomic_helper_plane_reset instead of
copying the logic
  drm/exynos: Use __drm_atomic_helper_plane_reset instead of copying the
logic
  drm/imx: Use __drm_atomic_helper_plane_reset instead of copying the
logic
  drm: rcar-du: Use __drm_atomic_helper_plane_reset instead of copying
the logic
  drm/sun4i: Use __drm_atomic_helper_plane_reset instead of copying the
logic
  drm/vc4: Use __drm_atomic_helper_plane_reset instead of copying the
logic
  drm/vmwgfx: Use __drm_atomic_helper_plane_reset instead of copying the
logic

 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  7 ++--
 drivers/gpu/drm/arm/malidp_planes.c   |  7 ++--
 .../gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c   |  5 +--
 drivers/gpu/drm/drm_atomic_helper.c   | 33 ++-
 drivers/gpu/drm/exynos/exynos_drm_plane.c |  3 +-
 drivers/gpu/drm/imx/ipuv3-plane.c |  8 ++---
 drivers/gpu/drm/rcar-du/rcar_du_plane.c   |  6 ++--
 drivers/gpu/drm/rcar-du/rcar_du_vsp.c |  5 +--
 drivers/gpu/drm/sun4i/sun4i_layer.c   |  4 +--
 drivers/gpu/drm/vc4/vc4_plane.c   |  4 +--
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c   |  4 +--
 include/drm/drm_atomic_helper.h   |  2 ++
 12 files changed, 41 insertions(+), 47 deletions(-)

-- 
2.18.0

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


[PATCH v3 03/10] drm: mali-dp: Use __drm_atomic_helper_plane_reset instead of copying the logic

2018-08-04 Thread Alexandru Gheorghe
A new helper function(__drm_atomic_helper_plane_reset) has been added
for linking a plane with its state and resetting the core
properties(alpha, rotation, etc.) to their default values.
Use that instead of duplicating the logic.

Reviewed-by: Ayan Kumar halder 
Acked-by: Liviu Dudau 
Signed-off-by: Alexandru Gheorghe 
---
 drivers/gpu/drm/arm/malidp_planes.c | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/arm/malidp_planes.c 
b/drivers/gpu/drm/arm/malidp_planes.c
index 29409a65d864..49c37f6dd63e 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -78,11 +78,8 @@ static void malidp_plane_reset(struct drm_plane *plane)
kfree(state);
plane->state = NULL;
state = kzalloc(sizeof(*state), GFP_KERNEL);
-   if (state) {
-   state->base.plane = plane;
-   state->base.rotation = DRM_MODE_ROTATE_0;
-   plane->state = >base;
-   }
+   if (state)
+   __drm_atomic_helper_plane_reset(plane, >base);
 }
 
 static struct
-- 
2.18.0

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


[PATCH v3 07/10] drm: rcar-du: Use __drm_atomic_helper_plane_reset instead of copying the logic

2018-08-04 Thread Alexandru Gheorghe
A new helper function(__drm_atomic_helper_plane_reset) has been added
for linking a plane with its state and resetting the core
properties(alpha, rotation, etc.) to their default values.
Use that instead of duplicating the logic.

__drm_atomic_helper_plane_reset initializes the alpha property to its
max value, which is defined by the drm core as DRM_BLEND_ALPHA_OPAQUE,
so nothing changes regarding the alpha value.

Reviewed-by: Laurent Pinchart 
Signed-off-by: Alexandru Gheorghe 
---
 drivers/gpu/drm/rcar-du/rcar_du_plane.c | 6 ++
 drivers/gpu/drm/rcar-du/rcar_du_vsp.c   | 5 +
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.c 
b/drivers/gpu/drm/rcar-du/rcar_du_plane.c
index c20f7ed48c8d..8861e715c248 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c
@@ -690,14 +690,12 @@ static void rcar_du_plane_reset(struct drm_plane *plane)
if (state == NULL)
return;
 
+   __drm_atomic_helper_plane_reset(plane, >state);
+
state->hwindex = -1;
state->source = RCAR_DU_PLANE_MEMORY;
state->colorkey = RCAR_DU_COLORKEY_NONE;
state->state.zpos = plane->type == DRM_PLANE_TYPE_PRIMARY ? 0 : 1;
-
-   plane->state = >state;
-   plane->state->alpha = DRM_BLEND_ALPHA_OPAQUE;
-   plane->state->plane = plane;
 }
 
 static int rcar_du_plane_atomic_set_property(struct drm_plane *plane,
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c 
b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
index 72eebeda518e..45eb777a16a4 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
@@ -346,11 +346,8 @@ static void rcar_du_vsp_plane_reset(struct drm_plane 
*plane)
if (state == NULL)
return;
 
-   state->state.alpha = DRM_BLEND_ALPHA_OPAQUE;
+   __drm_atomic_helper_plane_reset(plane, >state);
state->state.zpos = plane->type == DRM_PLANE_TYPE_PRIMARY ? 0 : 1;
-
-   plane->state = >state;
-   plane->state->plane = plane;
 }
 
 static const struct drm_plane_funcs rcar_du_vsp_plane_funcs = {
-- 
2.18.0

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


[PATCH v3 01/10] drm/atomic: Add __drm_atomic_helper_plane_reset

2018-08-04 Thread Alexandru Gheorghe
There are a lot of drivers that subclass drm_plane_state, all of them
duplicate the code that links together the plane with plane_state.

On top of that, drivers that enable core properties also have to
duplicate the code for initializing the properties to their default
values, which in all cases are the same as the defaults from core.

Change since v1:
- Make it consistent with the other helpers and require that both
  plane and state not be NULL, suggested by Boris Brezillon and
  Philipp Zabel.

Reviewed-by: Laurent Pinchart 
Signed-off-by: Alexandru Gheorghe 
---
 drivers/gpu/drm/drm_atomic_helper.c | 33 +
 include/drm/drm_atomic_helper.h |  2 ++
 2 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c 
b/drivers/gpu/drm/drm_atomic_helper.c
index 866a2cc72ef6..6dd5036545ec 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -3552,6 +3552,28 @@ void drm_atomic_helper_crtc_destroy_state(struct 
drm_crtc *crtc,
 }
 EXPORT_SYMBOL(drm_atomic_helper_crtc_destroy_state);
 
+/**
+ * __drm_atomic_helper_plane_reset - resets planes state to default values
+ * @plane: plane object, must not be NULL
+ * @state: atomic plane state, must not be NULL
+ *
+ * Initializes plane state to default. This is useful for drivers that subclass
+ * the plane state.
+ */
+void __drm_atomic_helper_plane_reset(struct drm_plane *plane,
+struct drm_plane_state *state)
+{
+   state->plane = plane;
+   state->rotation = DRM_MODE_ROTATE_0;
+
+   /* Reset the alpha value to fully opaque if it matters */
+   if (plane->alpha_property)
+   state->alpha = plane->alpha_property->values[1];
+
+   plane->state = state;
+}
+EXPORT_SYMBOL(__drm_atomic_helper_plane_reset);
+
 /**
  * drm_atomic_helper_plane_reset - default _plane_funcs.reset hook for 
planes
  * @plane: drm plane
@@ -3566,15 +3588,8 @@ void drm_atomic_helper_plane_reset(struct drm_plane 
*plane)
 
kfree(plane->state);
plane->state = kzalloc(sizeof(*plane->state), GFP_KERNEL);
-
-   if (plane->state) {
-   plane->state->plane = plane;
-   plane->state->rotation = DRM_MODE_ROTATE_0;
-
-   /* Reset the alpha value to fully opaque if it matters */
-   if (plane->alpha_property)
-   plane->state->alpha = plane->alpha_property->values[1];
-   }
+   if (plane->state)
+   __drm_atomic_helper_plane_reset(plane, plane->state);
 }
 EXPORT_SYMBOL(drm_atomic_helper_plane_reset);
 
diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h
index 99e2a5297c69..f4c7ed876c97 100644
--- a/include/drm/drm_atomic_helper.h
+++ b/include/drm/drm_atomic_helper.h
@@ -156,6 +156,8 @@ void __drm_atomic_helper_crtc_destroy_state(struct 
drm_crtc_state *state);
 void drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc,
  struct drm_crtc_state *state);
 
+void __drm_atomic_helper_plane_reset(struct drm_plane *plane,
+struct drm_plane_state *state);
 void drm_atomic_helper_plane_reset(struct drm_plane *plane);
 void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,
   struct drm_plane_state *state);
-- 
2.18.0

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


[Bug 107229] Metro 2033 Redux hangs

2018-08-04 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107229

--- Comment #7 from Alexander Tsoy  ---
Created attachment 140964
  --> https://bugs.freedesktop.org/attachment.cgi?id=140964=edit
dmesg

Same problem with the latest amd-staging-drm-next (commit
bf1fd52b0632cd17ac875432a36d3e92be96d8cb). Now the kernel gives me the
following errors:

[  324.552371] [drm:amdgpu_cs_ioctl [amdgpu]] *ERROR*
amdgpu_cs_list_validate(validated) failed.
[  324.561030] [drm:amdgpu_cs_ioctl [amdgpu]] *ERROR* Not enough memory for
command submission!

And with CONFIG_TRANSPARENT_HUGEPAGE=y the same kernel works fine.

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


[Bug 107482] Images gamma rendering issue

2018-08-04 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107482

Bug ID: 107482
   Summary: Images gamma rendering issue
   Product: DRI
   Version: unspecified
  Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
  Severity: normal
  Priority: medium
 Component: DRM/AMDgpu
  Assignee: dri-devel@lists.freedesktop.org
  Reporter: eseb...@gmail.com

Created attachment 140962
  --> https://bugs.freedesktop.org/attachment.cgi?id=140962=edit
images gamma

I have a PC with:
MB: Asrock AM1B-ITX
CPU: AMD Kabini Athlon 5350 APU
iGPU: Radeon HD 8400 / R3 Series
Displays: DVI Asus, HDMI Samsung

kernel-4.15/4.16/4.17
xorg-server-1.19.5
xorg-drivers-1.19
xf86-video-amdgpu-18.0.1
xf86-video-ati-18.0.1
libdrm-2.4.92

When I increase the gamma to check the quality of images (xgamma -gamma 3),
some pixels are darker/colorful, it seems like gamma is not applied uniformly
for all pixels. This happens on all kernels with any video driver: radeon,
amdgpu, amdgpu-dc.

I thought there's something wrong with the images so I've edited them on Gimp
by  increasing brightness or change hue/saturation. This was fine until the
kernel 4.17 and the amdgpu-dc driver upgrade, images have again the issue. They
are fine with amdgpu.

Is there something I can do about this?
Thanks.

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