[Freedreno] [PATCH v2 4/7] drm/msm: Use drm_mode_copy()

2022-11-07 Thread Ville Syrjala
From: Ville Syrjälä struct drm_display_mode embeds a list head, so overwriting the full struct with another one will corrupt the list (if the destination mode is on a list). Use drm_mode_copy() instead which explicitly preserves the list head of the destination mode. Even if we know the

[Freedreno] [PATCH v2 3/7] drm/msm: Use drm_mode_init() for on-stack modes

2022-11-07 Thread Ville Syrjala
From: Ville Syrjälä Initialize on-stack modes with drm_mode_init() to guarantee no stack garbage in the list head, or that we aren't copying over another mode's list head. Based on the following cocci script, with manual fixups: @decl@ identifier M; expression E; @@ - struct drm_display_mode M

[Freedreno] [PATCH 12/22] drm/msm: Use drm_mode_copy()

2022-02-18 Thread Ville Syrjala
From: Ville Syrjälä struct drm_display_mode embeds a list head, so overwriting the full struct with another one will corrupt the list (if the destination mode is on a list). Use drm_mode_copy() instead which explicitly preserves the list head of the destination mode. Even if we know the

[Freedreno] [PATCH 11/22] drm/msm: Use drm_mode_init() for on-stack modes

2022-02-18 Thread Ville Syrjala
From: Ville Syrjälä Initialize on-stack modes with drm_mode_init() to guarantee no stack garbage in the list head, or that we aren't copying over another mode's list head. Based on the following cocci script, with manual fixups: @decl@ identifier M; expression E; @@ - struct drm_display_mode M

[Freedreno] [PATCH 10/22] drm/msm: Nuke weird on stack mode copy

2022-02-18 Thread Ville Syrjala
From: Ville Syrjälä This on stack middle man mode looks entirely pointless. Just duplicate the original mode directly. Cc: Rob Clark Cc: Sean Paul Cc: Abhinav Kumar Cc: linux-arm-...@vger.kernel.org Cc: freedreno@lists.freedesktop.org Signed-off-by: Ville Syrjälä ---

[Freedreno] [PATCH 00/22] drm: Review of mode copies

2022-02-18 Thread Ville Syrjala
From: Ville Syrjälä I might be taking this a bit too far, but the lack of consistency in our methods to copy drm_display_mode structs around is bugging me. The main worry is the embedded list head, which if clobbered could lead to list corruption. I'd also prefer to make sure even the valid

[Freedreno] [PATCH v3 04/16] drm/msm/dpu: Stop copying around mode->private_flags

2020-04-28 Thread Ville Syrjala
From: Ville Syrjälä The driver never sets mode->private_flags so copying it back and forth is entirely pointless. Stop doing it. Also drop private_flags from the tracepoint. Cc: Rob Clark Cc: Sean Paul Cc: linux-arm-...@vger.kernel.org Cc: freedreno@lists.freedesktop.org Reviewed-by: Emil

[Freedreno] [PATCH v2 04/17] drm/msm/dpu: Stop copying around mode->private_flags

2020-04-03 Thread Ville Syrjala
From: Ville Syrjälä The driver never sets mode->private_flags so copying it back and forth is entirely pointless. Stop doing it. Also drop private_flags from the tracepoint. Cc: Rob Clark Cc: Sean Paul Cc: linux-arm-...@vger.kernel.org Cc: freedreno@lists.freedesktop.org Reviewed-by: Emil

[Freedreno] [PATCH 05/12] drm/msm/dpu: Stop copying around mode->private_flags

2020-02-19 Thread Ville Syrjala
From: Ville Syrjälä The driver never sets mode->private_flags so copying it back and forth is entirely pointless. Stop doing it. Also drop private_flags from the tracepoint. Cc: Rob Clark Cc: Sean Paul Cc: linux-arm-...@vger.kernel.org Cc: freedreno@lists.freedesktop.org Signed-off-by: Ville

[Freedreno] [PATCH 1/2] drm: Pretty print mode flags

2019-06-20 Thread Ville Syrjala
From: Ville Syrjälä Decode the mode flags when printing the modeline so that I no longer have to decode the hex number myself. To do this neatly I made the caller provide a temporary on stack buffer where we can produce the results. I choce 64 bytes as a reasonable size for this. The worst case

[Freedreno] [PATCH 1/4] drm/edid: Pass connector to AVI inforframe functions

2018-11-20 Thread Ville Syrjala
From: Ville Syrjälä Make life easier for drivers by simply passing the connector to drm_hdmi_avi_infoframe_from_display_mode() and drm_hdmi_avi_infoframe_quant_range(). That way drivers don't need to worry about is_hdmi2_sink mess. Cc: Alex Deucher Cc: "Christian König" Cc: "David (ChunMing)

[Freedreno] [PATCH v2 8/9] drm/msm: Use drm_connector_has_possible_encoder()

2018-06-28 Thread Ville Syrjala
From: Ville Syrjälä Use drm_connector_has_possible_encoder() for checking whether the encoder has an associated connector. v2: Replace the drm_for_each_connector_encoder_ids() loop with a simple drm_connector_has_possible_encoder() call Cc: Rob Clark Cc: linux-arm-...@vger.kernel.org Cc:

[Freedreno] [PATCH v2 0/9] drm: Third attempt at fixing the fb-helper .best_encoder() mess

2018-06-28 Thread Ville Syrjala
From: Ville Syrjälä Changes from the previous version mainly involve Danoie's suggestion of hiding the drm_encoder_find() in the iterator macro. I also polished the msm and tilcdc cases a bit more with another small helper. Cc: Alex Deucher Cc: amd-...@lists.freedesktop.org Cc: Ben Skeggs Cc:

[Freedreno] [PATCH 5/8] drm/msm: Use drm_for_each_connector_encoder_ids()

2018-06-26 Thread Ville Syrjala
From: Ville Syrjälä Use drm_for_each_connector_encoder_ids() for iterating connector->encoder_ids[]. A bit more convenient not having to deal with the implementation details. Cc: Rob Clark Cc: linux-arm-...@vger.kernel.org Cc: freedreno@lists.freedesktop.org Signed-off-by: Ville Syrjälä ---

[Freedreno] [PATCH v2 10/13] drm/msm: Stop updating plane->fb/crtc

2018-05-25 Thread Ville Syrjala
From: Ville Syrjälä We want to get rid of plane->fb/crtc on atomic drivers. Stop setting them. v2: Catch a few more cases Cc: Rob Clark Cc: linux-arm-...@vger.kernel.org Cc: freedreno@lists.freedesktop.org Signed-off-by: Ville Syrjälä

[Freedreno] [PATCH v2 00/13] drm: Eliminate plane->fb/crtc usage for atomic drivers

2018-05-25 Thread Ville Syrjala
From: Ville Syrjälä Here are again the last (?) bits of eliminating the plane->fb/crtc usage for atomic drivers. I've pushed everything else (thanks to everyone who reviewed them). Deepak said he'd tested the vmwgfx stuff, so I think it should be safe to land.

[Freedreno] [PATCH 07/13] drm/msm: Stop updating plane->fb/crtc

2018-04-05 Thread Ville Syrjala
From: Ville Syrjälä We want to get rid of plane->fb/crtc on atomic drivers. Stop setting them. v2: Catch a few more cases Cc: Rob Clark Cc: linux-arm-...@vger.kernel.org Cc: freedreno@lists.freedesktop.org Signed-off-by: Ville Syrjälä

[Freedreno] [PATCH 01/13] drm/msm: Stop consulting plane->fb/crtc

2018-04-05 Thread Ville Syrjala
From: Ville Syrjälä We want to get rid of plane->fb/crtc on atomic drivers. Stop looking at them. v2: Catch the plane->crtc case too Cc: Rob Clark Cc: linux-arm-...@vger.kernel.org Cc: freedreno@lists.freedesktop.org Signed-off-by: Ville

[Freedreno] [PATCH 19/23] drm/msm: Stop updating plane->fb/crtc

2018-03-22 Thread Ville Syrjala
From: Ville Syrjälä We want to get rid of plane->fb/crtc on atomic drivers. Stop setting them. Cc: Rob Clark Cc: linux-arm-...@vger.kernel.org Cc: freedreno@lists.freedesktop.org Signed-off-by: Ville Syrjälä

[Freedreno] [PATCH 10/23] drm/msm: Stop consulting plane->fb

2018-03-22 Thread Ville Syrjala
From: Ville Syrjälä We want to get rid of plane->fb on atomic drivers. Stop looking at it. Cc: Rob Clark Cc: linux-arm-...@vger.kernel.org Cc: freedreno@lists.freedesktop.org Signed-off-by: Ville Syrjälä ---

[Freedreno] [PATCH 00/23] drm: Eliminate plane->fb/crtc usage for atomic drivers

2018-03-22 Thread Ville Syrjala
From: Ville Syrjälä I really just wanted to fix i915 to re-enable its planes afer load detection (a two line patch). This is what I actually ended up with after I ran into a framebuffer refcount leak with said two line patch. I've tested this on a few i915 boxes

[Freedreno] [PATCH 09/15] drm/msm/mdp5: Use drm_mode_get_hv_timing() to populate plane clip rectangle

2017-11-23 Thread Ville Syrjala
From: Ville Syrjälä 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

[Freedreno] [PATCH 00/15] drm: More plane clipping polish

2017-11-23 Thread Ville Syrjala
From: Ville Syrjälä This series first unifies all users of drm_atomic_helper_check_plane_state() to populate the clip rectangle with drm_mode_get_hv_timing(), and once everything is unified the clip rectangle handling is sucked into