Re: [PATCH 5/8] drm/imx/ipuv3: do not return negative values from .get_modes()

2024-03-08 Thread Philipp Zabel
On Fr, 2024-03-08 at 18:03 +0200, Jani Nikula wrote:
> The .get_modes() hooks aren't supposed to return negative error
> codes. Return 0 for no modes, whatever the reason.
> 
> Cc: Philipp Zabel 
> Cc: sta...@vger.kernel.org
> Signed-off-by: Jani Nikula 

Acked-by: Philipp Zabel 

regards
Philipp


Re: [PATCH 4/6] drm/imx: prefer snprintf over sprintf

2024-01-12 Thread Philipp Zabel
Hi Jani,

On Mi, 2024-01-10 at 19:39 +0200, Jani Nikula wrote:
> This will trade the W=1 warning -Wformat-overflow to
> -Wformat-truncation. This lets us enable -Wformat-overflow subsystem
> wide.
>
> Cc: Philipp Zabel 
> Signed-off-by: Jani Nikula 

Reviewed-by: Philipp Zabel 

regards
Philipp


Re: [Intel-gfx] [PATCH v3 1/1] drm/i915: Move abs_diff() to math.h

2023-07-24 Thread Philipp Zabel
On Mo, 2023-07-24 at 11:25 +0300, Andy Shevchenko wrote:
> abs_diff() belongs to math.h. Move it there.
> This will allow others to use it.
> 
> Signed-off-by: Andy Shevchenko 
> Reviewed-by: Jiri Slaby  # tty/serial

Reviewed-by: Philipp Zabel  # gpu/ipu-v3

regards
Philipp


Re: [Intel-gfx] [PATCH i-g-t 8/8] gputop: Basic vendor agnostic GPU top tool

2022-11-16 Thread Philipp Zabel
On Fr, 2022-11-11 at 15:58 +, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin 
> 
> Rudimentary vendor agnostic example of how lib_igt_drm_clients can be used
> to display a sorted by card and usage list of processes using GPUs.
> 
> Borrows a bit of code from intel_gpu_top but for now omits the fancy
> features like interactive functionality, card selection, client
> aggregation, sort modes, JSON output  and pretty engine names. Also no
> support for global GPU or system metrics.
> 
> On the other hand it shows clients from all DRM cards which
> intel_gpu_top does not do.
> 
> Signed-off-by: Tvrtko Ursulin 
> Cc: Rob Clark 
> Cc: Christian König 
> Acked-by: Christian König 

Tested-by: Philipp Zabel 

on etnaviv with [1].

[1] 
https://lore.kernel.org/dri-devel/20220916151205.165687-3-l.st...@pengutronix.de/

regards
Philipp


Re: [Intel-gfx] [PATCH 09/22] drm/imx: Use drm_mode_duplicate()

2022-02-18 Thread Philipp Zabel
On Fri, 2022-02-18 at 12:03 +0200, Ville Syrjala wrote:
> From: Ville Syrjälä 
> 
> Replace the hand rolled drm_mode_duplicate() with the
> real thing.
> 
> @is_dup@
> @@
> drm_mode_duplicate(...)
> { ... }
> 
> @depends on !is_dup@
> expression dev, oldmode;
> identifier newmode;
> @@
> - newmode = drm_mode_create(dev);
> + newmode = drm_mode_duplicate(dev, oldmode);
>   ...
> - drm_mode_copy(newmode, oldmode);
> 
> Cc: Philipp Zabel 
> Signed-off-by: Ville Syrjälä 

Reviewed-by: Philipp Zabel 

regards
Philipp


Re: [Intel-gfx] [PATCH v3 11/27] drm/imx: Don't set struct drm_device.irq_enabled

2021-06-24 Thread Philipp Zabel
On Thu, 2021-06-24 at 09:29 +0200, Thomas Zimmermann wrote:
> The field drm_device.irq_enabled is only used by legacy drivers
> with userspace modesetting. Don't set it in imx.
> 
> v3:
>   * move dcss changes into separate patch (Laurentiu)
> 
> Signed-off-by: Thomas Zimmermann 
> Reviewed-by: Laurent Pinchart 
> Acked-by: Daniel Vetter 
> ---
>  drivers/gpu/drm/imx/imx-drm-core.c | 11 ---
>  1 file changed, 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/imx/imx-drm-core.c 
> b/drivers/gpu/drm/imx/imx-drm-core.c
> index 76819a8ac37f..9558e9e1b431 100644
> --- a/drivers/gpu/drm/imx/imx-drm-core.c
> +++ b/drivers/gpu/drm/imx/imx-drm-core.c
> @@ -207,17 +207,6 @@ static int imx_drm_bind(struct device *dev)
>   if (IS_ERR(drm))
>   return PTR_ERR(drm);
>  
> - /*
> -  * enable drm irq mode.
> -  * - with irq_enabled = true, we can use the vblank feature.
> -  *
> -  * P.S. note that we wouldn't use drm irq handler but
> -  *  just specific driver own one instead because
> -  *  drm framework supports only one irq handler and
> -  *  drivers can well take care of their interrupts
> -  */
> - drm->irq_enabled = true;
> -
>   /*
>* set max width and height as default value(4096x4096).
>* this value would be used to check framebuffer size limitation

Acked-by: Philipp Zabel 

regards
Philipp
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 08/15] drm/: drm_gem_plane_helper_prepare_fb is now the default

2021-06-24 Thread Philipp Zabel
On Tue, 2021-06-22 at 18:55 +0200, Daniel Vetter wrote:
> No need to set it explicitly.
> 
[...]
>  drivers/gpu/drm/imx/ipuv3-plane.c   | 1 -
>  14 files changed, 15 deletions(-)
> 
[...]
> diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c 
> b/drivers/gpu/drm/imx/ipuv3-plane.c
> index 8710f55d2579..ef114b6aa691 100644
> --- a/drivers/gpu/drm/imx/ipuv3-plane.c
> +++ b/drivers/gpu/drm/imx/ipuv3-plane.c
> @@ -772,7 +772,6 @@ static void ipu_plane_atomic_update(struct drm_plane 
> *plane,
>  }
>  
>  static const struct drm_plane_helper_funcs ipu_plane_helper_funcs = {
> - .prepare_fb = drm_gem_plane_helper_prepare_fb,
>   .atomic_check = ipu_plane_atomic_check,
>   .atomic_disable = ipu_plane_atomic_disable,
>   .atomic_update = ipu_plane_atomic_update,

Acked-by: Philipp Zabel 

regards
Philipp
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 3/8] drm/imx: Use __drm_atomic_helper_crtc_reset

2020-07-02 Thread Philipp Zabel
On Thu, 2020-07-02 at 11:41 +0200, Daniel Vetter wrote:
> On Wed, Jun 24, 2020 at 9:25 AM Daniel Vetter  wrote:
> > On Fri, Jun 12, 2020 at 06:00:51PM +0200, Daniel Vetter wrote:
> > > Now also comes with the added benefit of doing a drm_crtc_vblank_off(),
> > > which means vblank state isn't ill-defined and fail-y at driver load
> > > before the first modeset on each crtc.
> > > 
> > > Signed-off-by: Daniel Vetter 
> > > Cc: Philipp Zabel 
> > > Cc: Shawn Guo 
> > > Cc: Sascha Hauer 
> > > Cc: Pengutronix Kernel Team 
> > > Cc: Fabio Estevam 
> > > Cc: NXP Linux Team 
> > > Cc: linux-arm-ker...@lists.infradead.org
> > 
> > Ping for some ack/review on this pls.
> 
> Still looking for an ack here so I can land this entire pile.
> -Daniel

Acked-by: Philipp Zabel 

regards
Philipp
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 07/13] drm/mediatek: Provide ddc symlink in hdmi connector sysfs directory

2019-08-01 Thread Philipp Zabel
On Wed, 2019-07-31 at 18:58 +0200, Andrzej Pietrasiewicz wrote:
> Use the ddc pointer provided by the generic connector.
> 
> Signed-off-by: Andrzej Pietrasiewicz 
> Acked-by: Sam Ravnborg 
> Reviewed-by: Emil Velikov 

Reviewed-by: Philipp Zabel 

regards
Philipp

> ---
>  drivers/gpu/drm/mediatek/mtk_hdmi.c | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c 
> b/drivers/gpu/drm/mediatek/mtk_hdmi.c
> index ce91b61364eb..f419765b7cc0 100644
> --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
> @@ -1299,9 +1299,10 @@ static int mtk_hdmi_bridge_attach(struct drm_bridge 
> *bridge)
>   struct mtk_hdmi *hdmi = hdmi_ctx_from_bridge(bridge);
>   int ret;
>  
> - ret = drm_connector_init(bridge->encoder->dev, >conn,
> -  _hdmi_connector_funcs,
> -  DRM_MODE_CONNECTOR_HDMIA);
> + ret = drm_connector_init_with_ddc(bridge->encoder->dev, >conn,
> +   _hdmi_connector_funcs,
> +   DRM_MODE_CONNECTOR_HDMIA,
> +   hdmi->ddc_adpt);
>   if (ret) {
>   dev_err(hdmi->dev, "Failed to initialize connector: %d\n", ret);
>   return ret;
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Re: [Intel-gfx] [PATCH v6 11/24] drm/imx: imx-tve: Provide ddc symlink in connector's sysfs

2019-07-29 Thread Philipp Zabel
On Fri, 2019-07-26 at 19:23 +0200, Andrzej Pietrasiewicz wrote:
> Use the ddc pointer provided by the generic connector.
> 
> Signed-off-by: Andrzej Pietrasiewicz 

Acked-by: Philipp Zabel 

regards
Philipp

> ---
>  drivers/gpu/drm/imx/imx-tve.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/imx/imx-tve.c b/drivers/gpu/drm/imx/imx-tve.c
> index 649515868f86..5bbfaa2cd0f4 100644
> --- a/drivers/gpu/drm/imx/imx-tve.c
> +++ b/drivers/gpu/drm/imx/imx-tve.c
> @@ -484,8 +484,10 @@ static int imx_tve_register(struct drm_device *drm, 
> struct imx_tve *tve)
>  
>   drm_connector_helper_add(>connector,
>   _tve_connector_helper_funcs);
> - drm_connector_init(drm, >connector, _tve_connector_funcs,
> -DRM_MODE_CONNECTOR_VGA);
> + drm_connector_init_with_ddc(drm, >connector,
> + _tve_connector_funcs,
> + DRM_MODE_CONNECTOR_VGA,
> + tve->ddc);
>  
>   drm_connector_attach_encoder(>connector, >encoder);
>  
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Re: [Intel-gfx] [PATCH v6 10/24] drm/imx: imx-ldb: Provide ddc symlink in connector's sysfs

2019-07-29 Thread Philipp Zabel
On Fri, 2019-07-26 at 19:23 +0200, Andrzej Pietrasiewicz wrote:
> Use the ddc pointer provided by the generic connector.
> 
> Signed-off-by: Andrzej Pietrasiewicz 

Acked-by: Philipp Zabel 

Thanks!

regards
Philipp

> ---
>  drivers/gpu/drm/imx/imx-ldb.c | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c
> index de62a4cd4827..db461b6a257f 100644
> --- a/drivers/gpu/drm/imx/imx-ldb.c
> +++ b/drivers/gpu/drm/imx/imx-ldb.c
> @@ -462,9 +462,10 @@ static int imx_ldb_register(struct drm_device *drm,
>*/
>   drm_connector_helper_add(_ldb_ch->connector,
>   _ldb_connector_helper_funcs);
> - drm_connector_init(drm, _ldb_ch->connector,
> - _ldb_connector_funcs,
> - DRM_MODE_CONNECTOR_LVDS);
> + drm_connector_init_with_ddc(drm, _ldb_ch->connector,
> + _ldb_connector_funcs,
> + DRM_MODE_CONNECTOR_LVDS,
> + imx_ldb_ch->ddc);
>   drm_connector_attach_encoder(_ldb_ch->connector, encoder);
>   }
>  
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Re: [Intel-gfx] [PATCH 2/2] drm/atomic: Create and use __drm_atomic_helper_crtc_reset() everywhere

2018-11-20 Thread Philipp Zabel
On Mon, 2018-11-12 at 16:01 +0100, Maarten Lankhorst wrote:
> We already have __drm_atomic_helper_connector_reset() and
> __drm_atomic_helper_plane_reset(), extend this to crtc as well.
> 
> Most drivers already have a gpu reset hook, correct it.
> Nouveau already implemented its own __drm_atomic_helper_crtc_reset(),
> convert it to the common one.
> 
> Signed-off-by: Maarten Lankhorst 
[...]
> diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c 
> b/drivers/gpu/drm/imx/ipuv3-crtc.c
> index 7d4b710b837a..8bc36f0d2b6b 100644
> --- a/drivers/gpu/drm/imx/ipuv3-crtc.c
> +++ b/drivers/gpu/drm/imx/ipuv3-crtc.c
> @@ -120,12 +120,9 @@ static void imx_drm_crtc_reset(struct drm_crtc *crtc)
>   memset(state, 0, sizeof(*state));
>   } else {
>   state = kzalloc(sizeof(*state), GFP_KERNEL);
> - if (!state)
> - return;
> - crtc->state = >base;
>   }
>  
> - state->base.crtc = crtc;
> + __drm_atomic_helper_crtc_reset(crtc, >base);
>  }
>  
>  static struct drm_crtc_state *imx_drm_crtc_duplicate_state(struct drm_crtc 
> *crtc)
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c 
> b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> index 92ecb9bf982c..a743e5ed1177 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> @@ -119,12 +119,9 @@ static void mtk_drm_crtc_reset(struct drm_crtc *crtc)
>   memset(state, 0, sizeof(*state));
>   } else {
>   state = kzalloc(sizeof(*state), GFP_KERNEL);
> - if (!state)
> - return;
> - crtc->state = >base;
>   }
>  
> - state->base.crtc = crtc;
> + __drm_atomic_helper_crtc_reset(crtc, >base);
>  }
>  
>  static struct drm_crtc_state *mtk_drm_crtc_duplicate_state(struct drm_crtc 
> *crtc)

For the imx-drm and mediatek drivers,

Acked-by: Philipp Zabel 

regards
Philipp
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 06/10] drm/imx: Use drm_plane_mask()

2018-06-27 Thread Philipp Zabel
On Tue, 2018-06-26 at 22:47 +0300, Ville Syrjala wrote:
> From: Ville Syrjälä 
> 
> Use drm_plane_mask() where appropriate.
> 
> Cc: Philipp Zabel 
> Signed-off-by: Ville Syrjälä 
> ---
>  drivers/gpu/drm/imx/ipuv3-crtc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c 
> b/drivers/gpu/drm/imx/ipuv3-crtc.c
> index e83af0f2be86..21d002859ae0 100644
> --- a/drivers/gpu/drm/imx/ipuv3-crtc.c
> +++ b/drivers/gpu/drm/imx/ipuv3-crtc.c
> @@ -213,7 +213,7 @@ static bool ipu_crtc_mode_fixup(struct drm_crtc *crtc,
>  static int ipu_crtc_atomic_check(struct drm_crtc *crtc,
>struct drm_crtc_state *state)
>  {
> - u32 primary_plane_mask = 1 << drm_plane_index(crtc->primary);
> + u32 primary_plane_mask = drm_plane_mask(crtc->primary);
>  
>   if (state->active && (primary_plane_mask & state->plane_mask) == 0)
>   return -EINVAL;

Acked-by: Philipp Zabel 

regards
Philipp
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts

2018-02-27 Thread Philipp Zabel
On Tue, 2018-02-27 at 14:56 +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrj...@linux.intel.com>
> 
> Currently we have a mix of static and dynamic information stored in
> the display info structure. That makes it rather difficult to repopulate
> the dynamic parts when a new EDID appears. Let's make life easier by
> splitting the structure up into static and dynamic parts.
> 
> The static part will consist of subpixel_order, panel_orientation,
> and bus_formats.
> 
> Actually I'm not sure where bus_formats & co. fit in all this. For some
> drivers those seem to be static, even though they might fill them out
> from .get_modes().
>
> For other drivers this stuff even gets frobbed at
> runtime, making it more some kind of a bastard encoder/connector state.
> I'll just stick it into the static side so that the behaviour doesn't
> change when I start clear out the entire dynamic state with memset().

[...]
>  drivers/gpu/drm/imx/imx-ldb.c  |   4 +-
>  drivers/gpu/drm/imx/parallel-display.c |   2 +-

For imx-drm,
Acked-by: Philipp Zabel <p.za...@pengutronix.de>

regards
Philipp
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 07/15] drm/mediatek: Use drm_mode_get_hv_timing() to populate plane clip rectangle

2017-11-24 Thread Philipp Zabel
On Thu, 2017-11-23 at 21:04 +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrj...@linux.intel.com>
> 
> Use drm_mode_get_hv_timing() to fill out the plane clip rectangle.
> 
> No functional changes as the code already uses crtc_state->mode
> to populate the clip, which is also what drm_mode_get_hv_timing()
> uses.

I don't understand this explanation, drm_mode_get_hv_timing uses
whichever mode is passed to it?

> Once everyone agrees on this we can move the clip handling into
> drm_atomic_helper_check_plane_state().

I can see that there are no functional changes though,

Acked-by: Philipp Zabel <p.za...@pengutronix.de>

regards
Philipp
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 06/15] drm/imx: Use drm_mode_get_hv_timing() to populate plane clip rectangle

2017-11-24 Thread Philipp Zabel
On Thu, 2017-11-23 at 21:04 +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrj...@linux.intel.com>
> 
> Use drm_mode_get_hv_timing() to fill out the plane clip rectangle.
> 
> Note that this replaces crtc_state->adjusted_mode usage with
> crtc_state->mode. The latter is the correct choice since that's the
> mode the user provided and it matches the plane crtc coordinates
> the user also provided.

I am not aware of any adjustments that change hdisplay/vdisplay anyway,

Acked-by: Philipp Zabel <p.za...@pengutronix.de>

regards
Philipp
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 7/8] drm: Nuke drm_atomic_helper_connector_dpms

2017-07-25 Thread Philipp Zabel
On Tue, 2017-07-25 at 10:01 +0200, Daniel Vetter wrote:
> It's dead code, the core handles all this directly now.
> 
> The only special case is nouveau and tda988x which used one function
> for both legacy modeset code and -nv50 atomic world instead of 2
> vtables. But amounts to exactly the same.
> 
> v2: Rebase over the panel/brideg refactorings in stm/ltdc.
> 
> Signed-off-by: Daniel Vetter <daniel.vet...@intel.com>
[...]
>  drivers/gpu/drm/imx/imx-ldb.c  |  1 -
>  drivers/gpu/drm/imx/imx-tve.c  |  1 -
>  drivers/gpu/drm/imx/parallel-display.c |  1 -
>  drivers/gpu/drm/mediatek/mtk_dsi.c |  1 -
>  drivers/gpu/drm/mediatek/mtk_hdmi.c|  1 -

Acked-by: Philipp Zabel <p.za...@pengutronix.de>

regards
Philipp

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 13/16] drm/mediatek: Convert to new iterator macros

2017-07-12 Thread Philipp Zabel
On Wed, 2017-07-12 at 10:13 +0200, Maarten Lankhorst wrote:
> for_each_obj_in_state is about to be removed, so use the new atomic
> iterator macros.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankho...@linux.intel.com>
> Cc: CK Hu <ck...@mediatek.com>
> Cc: Philipp Zabel <p.za...@pengutronix.de>
> Cc: Matthias Brugger <matthias@gmail.com>
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linux-media...@lists.infradead.org
> ---
>  drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c 
> b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> index 56f802d0a51c..be0741638f94 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> @@ -48,11 +48,11 @@ static void mtk_atomic_schedule(struct mtk_drm_private 
> *private,
>  static void mtk_atomic_wait_for_fences(struct drm_atomic_state *state)
>  {
>   struct drm_plane *plane;
> - struct drm_plane_state *plane_state;
> + struct drm_plane_state *new_plane_state;
>   int i;
>  
> - for_each_plane_in_state(state, plane, plane_state, i)
> - mtk_fb_wait(plane->state->fb);
> + for_each_new_plane_in_state(state, plane, new_plane_state, i)
> + mtk_fb_wait(new_plane_state->fb);
>  }
>  
>  static void mtk_atomic_complete(struct mtk_drm_private *private,

Acked-by: Philipp Zabel <p.za...@pengutronix.de>

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH v2 06/12] drm/mediatek: Handle drm_atomic_helper_swap_state failure

2017-07-12 Thread Philipp Zabel
On Tue, 2017-07-11 at 16:33 +0200, Maarten Lankhorst wrote:
> drm_atomic_helper_swap_state() will be changed to interruptible waiting
> in the next few commits, so all drivers have to be changed to handling
> failure.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankho...@linux.intel.com>
> Cc: CK Hu <ck...@mediatek.com>
> Cc: Philipp Zabel <p.za...@pengutronix.de>
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linux-media...@lists.infradead.org
> ---
>  drivers/gpu/drm/mediatek/mtk_drm_drv.c | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c 
> b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> index 56f802d0a51c..9a130c84c861 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> @@ -109,7 +109,12 @@ static int mtk_atomic_commit(struct drm_device *drm,
>   mutex_lock(>commit.lock);
>   flush_work(>commit.work);
>  
> - drm_atomic_helper_swap_state(state, true);
> + ret = drm_atomic_helper_swap_state(state, true);
> + if (ret) {
> + mutex_unlock(>commit.lock);
> + drm_atomic_helper_cleanup_planes(drm, state);
> +     return ret;
> + }
>  
>   drm_atomic_state_get(state);
>   if (async)

Reviewed-by: Philipp Zabel <p.za...@pengutronix.de>

regards
Philipp

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 12/16] drm/imx: Use atomic iterator macros

2017-07-12 Thread Philipp Zabel
On Wed, 2017-07-12 at 10:13 +0200, Maarten Lankhorst wrote:
> for_each_obj_in_state is about to be removed, so use the new atomic
> iterator macros.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankho...@linux.intel.com>
> Cc: Philipp Zabel <p.za...@pengutronix.de>
> ---
>  drivers/gpu/drm/imx/imx-drm-core.c | 8 
>  drivers/gpu/drm/imx/ipuv3-plane.c  | 2 +-
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/imx/imx-drm-core.c 
> b/drivers/gpu/drm/imx/imx-drm-core.c
> index 95e2181963d9..f5c621219113 100644
> --- a/drivers/gpu/drm/imx/imx-drm-core.c
> +++ b/drivers/gpu/drm/imx/imx-drm-core.c
> @@ -115,7 +115,7 @@ static void imx_drm_atomic_commit_tail(struct 
> drm_atomic_state *state)
>  {
>   struct drm_device *dev = state->dev;
>   struct drm_plane *plane;
> - struct drm_plane_state *old_plane_state;
> + struct drm_plane_state *old_plane_state, *new_plane_state;
>   bool plane_disabling = false;
>   int i;
>  
> @@ -127,15 +127,15 @@ static void imx_drm_atomic_commit_tail(struct 
> drm_atomic_state *state)
>  
>   drm_atomic_helper_commit_modeset_enables(dev, state);
>  
> - for_each_plane_in_state(state, plane, old_plane_state, i) {
> - if (drm_atomic_plane_disabling(old_plane_state, plane->state))
> + for_each_oldnew_plane_in_state(state, plane, old_plane_state, 
> new_plane_state, i) {
> + if (drm_atomic_plane_disabling(old_plane_state, 
> new_plane_state))
>   plane_disabling = true;
>   }
>  
>   if (plane_disabling) {
>   drm_atomic_helper_wait_for_vblanks(dev, state);
>  
> - for_each_plane_in_state(state, plane, old_plane_state, i)
> + for_each_old_plane_in_state(state, plane, old_plane_state, i)
>   ipu_plane_disable_deferred(plane);
>  
>   }
> diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c 
> b/drivers/gpu/drm/imx/ipuv3-plane.c
> index 49546222c6d3..ff53c8dec633 100644
> --- a/drivers/gpu/drm/imx/ipuv3-plane.c
> +++ b/drivers/gpu/drm/imx/ipuv3-plane.c
> @@ -675,7 +675,7 @@ int ipu_planes_assign_pre(struct drm_device *dev,
>   int available_pres = ipu_prg_max_active_channels();
>   int i;
>  
> - for_each_plane_in_state(state, plane, plane_state, i) {
> + for_each_new_plane_in_state(state, plane, plane_state, i) {
>       struct ipu_plane_state *ipu_state =
>   to_ipu_plane_state(plane_state);
>   struct ipu_plane *ipu_plane = to_ipu_plane(plane);

Reviewed-by: Philipp Zabel <p.za...@pengutronix.de>
Tested-by: Philipp Zabel <p.za...@pengutronix.de>

regards
Philipp

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 23/37] drm/imx: Drop drm_vblank_cleanup

2017-05-29 Thread Philipp Zabel
Hi Daniel,

On Wed, 2017-05-24 at 16:51 +0200, Daniel Vetter wrote:
> It's only done in the driver load error path, where vblanks don't need
> to be quiescent anyway. And that's all drm_vblank_cleanup does, since
> the core will release the vblank allocations on its own already. So
> drop it.

Thank you for cleaning this up and improving the docs.
From the function name and kerneldoc comment, it was really not clear
that this function is already called in the drm_device release path.

I think the comment is slightly misleading though, as drm_vblank_cleanup
does call kfree(dev->vblank).

> Cc: Philipp Zabel <p.za...@pengutronix.de>
> Signed-off-by: Daniel Vetter <daniel.vet...@intel.com>
>
> ---
>  drivers/gpu/drm/imx/imx-drm-core.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/imx/imx-drm-core.c 
> b/drivers/gpu/drm/imx/imx-drm-core.c
> index 50add2f9e250..95e2181963d9 100644
> --- a/drivers/gpu/drm/imx/imx-drm-core.c
> +++ b/drivers/gpu/drm/imx/imx-drm-core.c
> @@ -278,7 +278,7 @@ static int imx_drm_bind(struct device *dev)
>   /* Now try and bind all our sub-components */
>   ret = component_bind_all(dev, drm);
>   if (ret)
> - goto err_vblank;
> + goto err_kms;
>  
>   drm_mode_config_reset(drm);
>  
> @@ -316,8 +316,6 @@ static int imx_drm_bind(struct device *dev)
>  err_unbind:
>  #endif
>   component_unbind_all(drm->dev, drm);
> -err_vblank:
> - drm_vblank_cleanup(drm);
>  err_kms:
>   drm_mode_config_cleanup(drm);
>  err_unref:

As I understand, the drm_dev_unref(drm) that follows this causes
drm_dev_release -> drm_dev_fini -> drm_vblank_cleanup to be called, so

Acked-by: Philipp Zabel <p.za...@pengutronix.de>

regards
Philipp

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 10/16] drm: Don't call drm_dev_set_unique from platform drivers

2016-06-20 Thread Philipp Zabel
Am Freitag, den 17.06.2016, 09:33 +0200 schrieb Daniel Vetter:
> Since
> 
> commit e112e593b215c394c0303dbf0534db0928e87967
> Author: Nicolas Iooss <nicolas.iooss_li...@m4x.org>
> Date:   Fri Dec 11 11:20:28 2015 +0100
> 
> drm: use dev_name as default unique name in drm_dev_alloc()
> 
> we're using a reasonable default which should work for everyone. Only
> mtk, rcar-du and sun4i are affected, and as kms-only drivers without
> any rendering support no one should ever care about the unique name
> 
> v2: Rebase on top of mediatek.
> 
> Cc: Philipp Zabel <p.za...@pengutronix.de>

Acked-by: Philipp Zabel <p.za...@pengutronix.de>

regards
Philipp

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 19/35] drm/imx: Use lockless gem BO free callback

2016-05-04 Thread Philipp Zabel
Am Mittwoch, den 04.05.2016, 12:28 +0200 schrieb Daniel Vetter:
> On Wed, Apr 27, 2016 at 02:01:35PM +0200, Philipp Zabel wrote:
> > Am Mittwoch, den 27.04.2016, 13:21 +0200 schrieb Daniel Vetter:
> > > On Wed, Apr 27, 2016 at 12:29:34PM +0200, Philipp Zabel wrote:
> > > > Am Dienstag, den 26.04.2016, 19:29 +0200 schrieb Daniel Vetter:
> > > > > No dev->struct_mutex anywhere to be seen.
> > > > > 
> > > > > Cc: Sascha Hauer <s.ha...@pengutronix.de>
> > > > > Cc: Philipp Zabel <p.za...@pengutronix.de>
> > > > > Signed-off-by: Daniel Vetter <daniel.vet...@intel.com>
> > > > > ---
> > > > >  drivers/gpu/drm/imx/imx-drm-core.c | 2 +-
> > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > 
> > > > > diff --git a/drivers/gpu/drm/imx/imx-drm-core.c 
> > > > > b/drivers/gpu/drm/imx/imx-drm-core.c
> > > > > index e26dcdec2aba..2453fb1c68a7 100644
> > > > > --- a/drivers/gpu/drm/imx/imx-drm-core.c
> > > > > +++ b/drivers/gpu/drm/imx/imx-drm-core.c
> > > > > @@ -411,7 +411,7 @@ static struct drm_driver imx_drm_driver = {
> > > > >   .unload = imx_drm_driver_unload,
> > > > >   .lastclose  = imx_drm_driver_lastclose,
> > > > >   .set_busid  = drm_platform_set_busid,
> > > > > - .gem_free_object= drm_gem_cma_free_object,
> > > > > + .gem_free_object_unlocked = drm_gem_cma_free_object,
> > > > >   .gem_vm_ops = _gem_cma_vm_ops,
> > > > >   .dumb_create= drm_gem_cma_dumb_create,
> > > > >   .dumb_map_offset= drm_gem_cma_dumb_map_offset,
> > > > 
> > > > Applied to imx-drm/fixes, thank you.
> > > 
> > > And that compiles for you? Might want to drop the patch again before
> > > someone notices ;-)
> > 
> > Nope, dropped. Nobody will have to.
> 
> I presume you having tried to apply it is as good as an ack, so added to
> drm-misc.

Yes, thank you.

regards
Philipp

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 19/35] drm/imx: Use lockless gem BO free callback

2016-04-27 Thread Philipp Zabel
Am Mittwoch, den 27.04.2016, 13:21 +0200 schrieb Daniel Vetter:
> On Wed, Apr 27, 2016 at 12:29:34PM +0200, Philipp Zabel wrote:
> > Am Dienstag, den 26.04.2016, 19:29 +0200 schrieb Daniel Vetter:
> > > No dev->struct_mutex anywhere to be seen.
> > > 
> > > Cc: Sascha Hauer <s.ha...@pengutronix.de>
> > > Cc: Philipp Zabel <p.za...@pengutronix.de>
> > > Signed-off-by: Daniel Vetter <daniel.vet...@intel.com>
> > > ---
> > >  drivers/gpu/drm/imx/imx-drm-core.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/gpu/drm/imx/imx-drm-core.c 
> > > b/drivers/gpu/drm/imx/imx-drm-core.c
> > > index e26dcdec2aba..2453fb1c68a7 100644
> > > --- a/drivers/gpu/drm/imx/imx-drm-core.c
> > > +++ b/drivers/gpu/drm/imx/imx-drm-core.c
> > > @@ -411,7 +411,7 @@ static struct drm_driver imx_drm_driver = {
> > >   .unload = imx_drm_driver_unload,
> > >   .lastclose  = imx_drm_driver_lastclose,
> > >   .set_busid  = drm_platform_set_busid,
> > > - .gem_free_object= drm_gem_cma_free_object,
> > > + .gem_free_object_unlocked = drm_gem_cma_free_object,
> > >   .gem_vm_ops = _gem_cma_vm_ops,
> > >   .dumb_create= drm_gem_cma_dumb_create,
> > >   .dumb_map_offset= drm_gem_cma_dumb_map_offset,
> > 
> > Applied to imx-drm/fixes, thank you.
> 
> And that compiles for you? Might want to drop the patch again before
> someone notices ;-)

Nope, dropped. Nobody will have to.

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 19/35] drm/imx: Use lockless gem BO free callback

2016-04-27 Thread Philipp Zabel
Am Dienstag, den 26.04.2016, 19:29 +0200 schrieb Daniel Vetter:
> No dev->struct_mutex anywhere to be seen.
> 
> Cc: Sascha Hauer <s.ha...@pengutronix.de>
> Cc: Philipp Zabel <p.za...@pengutronix.de>
> Signed-off-by: Daniel Vetter <daniel.vet...@intel.com>
> ---
>  drivers/gpu/drm/imx/imx-drm-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/imx/imx-drm-core.c 
> b/drivers/gpu/drm/imx/imx-drm-core.c
> index e26dcdec2aba..2453fb1c68a7 100644
> --- a/drivers/gpu/drm/imx/imx-drm-core.c
> +++ b/drivers/gpu/drm/imx/imx-drm-core.c
> @@ -411,7 +411,7 @@ static struct drm_driver imx_drm_driver = {
>   .unload = imx_drm_driver_unload,
>   .lastclose  = imx_drm_driver_lastclose,
>   .set_busid  = drm_platform_set_busid,
> - .gem_free_object= drm_gem_cma_free_object,
> + .gem_free_object_unlocked = drm_gem_cma_free_object,
>   .gem_vm_ops = _gem_cma_vm_ops,
>   .dumb_create= drm_gem_cma_dumb_create,
>   .dumb_map_offset= drm_gem_cma_dumb_map_offset,

Applied to imx-drm/fixes, thank you.

regards
Philipp

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 08/10] drm/imx: Don't set a gamma table size

2016-03-30 Thread Philipp Zabel
Hi Daniel,

Am Mittwoch, den 30.03.2016, 11:51 +0200 schrieb Daniel Vetter:
> imx doesn't have any functions for setting the gamma table, so this is
> completely defunct.
> 
> Not nice to lie to userspace, so let's stop!

Thank you for the patch. Now the ret variable and the err_register label
are both unused, so I have applied it with the following fixup:

diff --git a/drivers/gpu/drm/imx/imx-drm-core.c 
b/drivers/gpu/drm/imx/imx-drm-core.c
index 21a5293..e26dcde 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -326,7 +326,6 @@ int imx_drm_add_crtc(struct drm_device *drm, struct 
drm_crtc *crtc,
 {
struct imx_drm_device *imxdrm = drm->dev_private;
struct imx_drm_crtc *imx_drm_crtc;
-   int ret;
 
/*
 * The vblank arrays are dimensioned by MAX_CRTC - we can't
@@ -358,11 +357,6 @@ int imx_drm_add_crtc(struct drm_device *drm, struct 
drm_crtc *crtc,
imx_drm_crtc->imx_drm_helper_funcs.crtc_funcs, NULL);
 
return 0;
-
-err_register:
-   imxdrm->crtc[--imxdrm->pipes] = NULL;
-   kfree(imx_drm_crtc);
-   return ret;
 }
 EXPORT_SYMBOL_GPL(imx_drm_add_crtc);

regards
Philipp

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 14/22] drm/imx: Unconfuse preclose logic

2016-01-13 Thread Philipp Zabel
Am Montag, den 11.01.2016, 22:41 +0100 schrieb Daniel Vetter:
> So this one is special, since it tries to prevent races when userspace
> crashes simply by disabling the vblank machinery. Well except that imx
> always has vblanks enabled, and the disable_vblank hook actually just
> tries to cancel a pending pageflip. Without any locking whatsoever. Of
> course this is wrong, since it'll result in the hw not actually
> displaying what drm thinks is the current frontbuffer.
> 
> Well since the core takes care of the disappearing DRM fd now. So we
> can nuke all this confused code without ill side-effects.
> 
> Someone else needs to audit the locking for ->newfb and
> ->page_flip_event and fix it up. Common approach is to reuse
> dev->event_lock for this.
> 
> Cc: Sascha Hauer <s.ha...@pengutronix.de>
> Cc: Philipp Zabel <p.za...@pengutronix.de>
> Acked-by: Daniel Stone <dani...@collabora.com>
> Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>
> Signed-off-by: Daniel Vetter <daniel.vet...@intel.com>

Acked-by: Philipp Zabel <p.za...@pengutronix.de>

regards
Philipp

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx