Re: [Intel-gfx] [RFC v4 00/25] drm: Add generic fbdev emulation

2018-04-13 Thread Noralf Trønnes
Argh, it didn't go through this time either. I'll just have to strip off recipients and just send to the lists when the cool off period is over. Sorry about the noise, I'll have to investigate this further. Noralf. Den 13.04.2018 18.53, skrev Noralf Trønnes: This patchset explores

[Intel-gfx] [RFC v4 20/25] drm/prime: Don't pin module on export for in-kernel clients

2018-04-13 Thread Noralf Trønnes
Avoid pinning the module when exporting a GEM object as a dmabuf. This makes it possible to unload drivers that has in-kernel clients using it. The client is removed on drm_dev_unregister() so no need to pin the driver. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/g

[Intel-gfx] [RFC v4 18/25] drm/client: Make the display modes available to clients

2018-04-13 Thread Noralf Trønnes
Give clients easy access to the display modes. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_client.c | 159 +-- include/drm/drm_client.h | 25 +++ 2 files changed, 148 insertions(+), 36 deletions(-) diff

[Intel-gfx] [RFC v4 17/25] drm/client: Bail out if there's a DRM master

2018-04-13 Thread Noralf Trønnes
If there's a DRM master, return -EBUSY. Block userspace from becoming master by taking the master lock while the client is setting the mode. Suggested-by: Daniel Vetter <daniel.vet...@ffwll.ch> Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_auth

[Intel-gfx] [RFC v4 16/25] drm: Make ioctls available for in-kernel clients

2018-04-13 Thread Noralf Trønnes
the debug name. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_crtc_internal.h | 18 ++--- drivers/gpu/drm/drm_dumb_buffers.c | 33 drivers/gpu/drm/drm_framebuffer.c | 50 - drivers/g

[Intel-gfx] [RFC v4 21/25] drm/fb-helper: Add drm_fb_helper_fb_open/release()

2018-04-13 Thread Noralf Trønnes
(fb_ops.owner) instead of the driver module. Fix that by ensuring that the driver module is pinned. The functions are not added to the DRM_FB_HELPER_DEFAULT_OPS() macro, because some of its users do set fb_open/release themselves. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drive

[Intel-gfx] [RFC v4 15/25] drm/fb-helper: Move modeset config code to drm_client

2018-04-13 Thread Noralf Trønnes
Call the function drm_client_find_display(). No functional change apart from making width/height arguments optional. Some function name/signature changes and whitespace adjustments. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_client.c

[Intel-gfx] [RFC v4 14/25] drm/fb-helper: Remove struct drm_fb_helper_connector

2018-04-13 Thread Noralf Trønnes
No need to maintain a list of registered connectors. Just use the connector iterator. TODO: Remove: - drm_fb_helper_add_one_connector() - drm_fb_helper_single_add_all_connectors() - drm_fb_helper_remove_one_connector() Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/g

[Intel-gfx] [RFC v4 13/25] drm/fb-helper: Remove struct drm_fb_helper_crtc

2018-04-13 Thread Noralf Trønnes
The stage is now set for a clean removal of drm_fb_helper_crtc. struct drm_client_display is doing its job now. Also remove the drm_fb_helper_funcs->initial_config which has been superseded by drm_driver->initial_client_display. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> ---

[Intel-gfx] [RFC v4 19/25] drm/client: Finish the in-kernel client API

2018-04-13 Thread Noralf Trønnes
The modesetting code is already present, this adds the rest of the API. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_client.c | 573 + drivers/gpu/drm/drm_debugfs.c | 7 + drivers/gpu/drm/drm_drv.c

[Intel-gfx] [RFC v4 12/25] drm/i915: Add drm_driver->initial_client_display callback

2018-04-13 Thread Noralf Trønnes
on out of intel_fbdev.c since it's not fbdev specific anymore. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_fb_helper.c| 19 +-- drivers/gpu/drm/i915/i915_drv.c| 1 + drivers/gpu/drm/i915/intel_drv.h | 11 drivers/gpu/drm/i915/intel_f

[Intel-gfx] [RFC v4 08/25] drm/fb-helper: Use struct drm_client_display

2018-04-13 Thread Noralf Trønnes
Prepare to move the modeset committing code to drm_client. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_fb_helper.c | 161 include/drm/drm_fb_helper.h | 8 ++ 2 files changed, 89 insertions(+), 80 deletions(-)

[Intel-gfx] [RFC v4 10/25] drm/connector: Add drm_connector_has_preferred_mode/pick_cmdline_mode()

2018-04-13 Thread Noralf Trønnes
Move them over from drm_fb_helper since they are connector functions. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_connector.c| 94 ++ drivers/gpu/drm/drm_fb_helper.c| 75 ++ drivers/g

[Intel-gfx] [RFC v4 11/25] drm/connector: Add connector array functions

2018-04-13 Thread Noralf Trønnes
Add functions to deal with the registred connectors as an array: - drm_connector_get_all() - drm_connector_put_all() And to get the enabled status of those connectors: drm_connector_get_enabled_status() This is prep work to remove struct drm_fb_helper_connector. Signed-off-by: Noralf Trønnes

[Intel-gfx] [RFC v4 07/25] drm: Begin an API for in-kernel clients

2018-04-13 Thread Noralf Trønnes
This the beginning of an API for in-kernel clients. First out is a display representation that will be used by drm_fb_helper in order to move out its mode setting code. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/drm_cl

[Intel-gfx] [RFC v4 05/25] drm/fb-helper: dpms_legacy(): Only set on connectors in use

2018-04-13 Thread Noralf Trønnes
For each enabled crtc the functions sets dpms on all registered connectors. Limit this to only doing it once and on the connectors actually in use. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_fb_helper.c | 11 +-- 1 file changed, 5 insertions

[Intel-gfx] [RFC v4 00/25] drm: Add generic fbdev emulation

2018-04-13 Thread Noralf Trønnes
buggy patch: (Chris Wilson) drm/prime: Clear drm_gem_object->dma_buf on release - Defer buffer creation until fb_open. David Herrmann (1): drm: provide management functions for drm_file Noralf Trønnes (24): drm/file: Don't set master on in-kernel clients drm/fb-helper: No need to ca

[Intel-gfx] [RFC v4 03/25] drm/fb-helper: No need to cache rotation and sw_rotations

2018-04-13 Thread Noralf Trønnes
Getting rotation info is cheap so we can do it on demand. This is done in preparation for the removal of struct drm_fb_helper_crtc. Cc: Hans de Goede <hdego...@redhat.com> Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_fb_he

[Intel-gfx] [RFC v4 04/25] drm/fb-helper: Remove drm_fb_helper_debug_enter/leave()

2018-04-13 Thread Noralf Trønnes
lper_funcs->mode_set_base_atomic - Documentation/dev-tools/kgdb.rst Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_fb_helper.c | 82 - 1 file changed, 82 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/dr

[Intel-gfx] [RFC v4 09/25] drm/fb-helper: Move modeset commit code to drm_client

2018-04-13 Thread Noralf Trønnes
This moves the committing part of the modesetting code to drm_client. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_client.c| 242 drivers/gpu/drm/drm_fb_helper.c | 216 +-- inclu

[Intel-gfx] [RFC v4 06/25] drm/atomic: Move __drm_atomic_helper_disable_plane/set_config()

2018-04-13 Thread Noralf Trønnes
Prepare for moving drm_fb_helper modesetting code to drm_client. drm_client will be linked to drm.ko, so move __drm_atomic_helper_disable_plane() and __drm_atomic_helper_set_config() out of drm_kms_helper.ko. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_at

[Intel-gfx] [RFC v4 01/25] drm: provide management functions for drm_file

2018-04-13 Thread Noralf Trønnes
e fops implementations and APIs (not that I am aware of any such plans), and more importantly from in-kernel use where no real file is available. Signed-off-by: David Herrmann <dh.herrm...@gmail.com> Signed-off-by: Noralf Trønnes <nor...@tronnes.org> Reviewed-by: Daniel Vetter <d

[Intel-gfx] [RFC v4 02/25] drm/file: Don't set master on in-kernel clients

2018-04-13 Thread Noralf Trønnes
It only makes sense for userspace clients. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> Reviewed-by: Daniel Vetter <daniel.vet...@ffwll.ch> --- drivers/gpu/drm/drm_file.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/

Re: [Intel-gfx] [RFC v4 00/25] drm: Add generic fbdev emulation

2018-04-12 Thread Noralf Trønnes
I hit a 'Sending rate exceeded' error with this patchset, so it didn't go out as it should. I will resend the patchset when I find out how to avoid this problem. Noralf. Den 12.04.2018 15.17, skrev Noralf Trønnes: This patchset explores the possibility of having generic fbdev emulation

[Intel-gfx] [RFC v4 24/25] drm/client: Hack: Add bootsplash

2018-04-12 Thread Noralf Trønnes
A hack to test the client API. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile| 1 + drivers/gpu/drm/client/Kconfig | 9 ++ drivers/gpu/drm/client/drm_bootsplash.c

[Intel-gfx] [RFC v4 22/25] drm/fb-helper: Add generic fbdev emulation

2018-04-12 Thread Noralf Trønnes
This adds generic fbdev emulation for drivers that supports dumb buffers which they can export. All the driver has to do is call drm_fbdev_generic_setup(). Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_fb_helper.c

[Intel-gfx] [RFC v4 23/25] drm: Add DRM device registered notifier

2018-04-12 Thread Noralf Trønnes
Add a notifier that fires when a new DRM device is registered. This can be used by the bootsplash client to connect to all devices. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_drv.c | 32 include/drm/drm_drv.h | 4 2

[Intel-gfx] [RFC v4 13/25] drm/fb-helper: Remove struct drm_fb_helper_crtc

2018-04-12 Thread Noralf Trønnes
The stage is now set for a clean removal of drm_fb_helper_crtc. struct drm_client_display is doing its job now. Also remove the drm_fb_helper_funcs->initial_config which has been superseded by drm_driver->initial_client_display. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> ---

[Intel-gfx] [RFC v4 14/25] drm/fb-helper: Remove struct drm_fb_helper_connector

2018-04-12 Thread Noralf Trønnes
No need to maintain a list of registered connectors. Just use the connector iterator. TODO: Remove: - drm_fb_helper_add_one_connector() - drm_fb_helper_single_add_all_connectors() - drm_fb_helper_remove_one_connector() Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/g

[Intel-gfx] [RFC v4 19/25] drm/client: Finish the in-kernel client API

2018-04-12 Thread Noralf Trønnes
The modesetting code is already present, this adds the rest of the API. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_client.c | 573 + drivers/gpu/drm/drm_debugfs.c | 7 + drivers/gpu/drm/drm_drv.c

[Intel-gfx] [RFC v4 17/25] drm/client: Bail out if there's a DRM master

2018-04-12 Thread Noralf Trønnes
If there's a DRM master, return -EBUSY. Block userspace from becoming master by taking the master lock while the client is setting the mode. Suggested-by: Daniel Vetter <daniel.vet...@ffwll.ch> Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_auth

[Intel-gfx] [RFC v4 21/25] drm/fb-helper: Add drm_fb_helper_fb_open/release()

2018-04-12 Thread Noralf Trønnes
(fb_ops.owner) instead of the driver module. Fix that by ensuring that the driver module is pinned. The functions are not added to the DRM_FB_HELPER_DEFAULT_OPS() macro, because some of its users do set fb_open/release themselves. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drive

[Intel-gfx] [RFC v4 20/25] drm/prime: Don't pin module on export for in-kernel clients

2018-04-12 Thread Noralf Trønnes
Avoid pinning the module when exporting a GEM object as a dmabuf. This makes it possible to unload drivers that has in-kernel clients using it. The client is removed on drm_dev_unregister() so no need to pin the driver. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/g

[Intel-gfx] [RFC v4 16/25] drm: Make ioctls available for in-kernel clients

2018-04-12 Thread Noralf Trønnes
the debug name. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_crtc_internal.h | 18 ++--- drivers/gpu/drm/drm_dumb_buffers.c | 33 drivers/gpu/drm/drm_framebuffer.c | 50 - drivers/g

[Intel-gfx] [RFC v4 12/25] drm/i915: Add drm_driver->initial_client_display callback

2018-04-12 Thread Noralf Trønnes
on out of intel_fbdev.c since it's not fbdev specific anymore. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_fb_helper.c| 19 +-- drivers/gpu/drm/i915/i915_drv.c| 1 + drivers/gpu/drm/i915/intel_drv.h | 11 drivers/gpu/drm/i915/intel_f

[Intel-gfx] [RFC v4 18/25] drm/client: Make the display modes available to clients

2018-04-12 Thread Noralf Trønnes
Give clients easy access to the display modes. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_client.c | 159 +-- include/drm/drm_client.h | 25 +++ 2 files changed, 148 insertions(+), 36 deletions(-) diff

[Intel-gfx] [RFC v4 15/25] drm/fb-helper: Move modeset config code to drm_client

2018-04-12 Thread Noralf Trønnes
Call the function drm_client_find_display(). No functional change apart from making width/height arguments optional. Some function name/signature changes and whitespace adjustments. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_client.c

[Intel-gfx] [RFC v4 11/25] drm/connector: Add connector array functions

2018-04-12 Thread Noralf Trønnes
Add functions to deal with the registred connectors as an array: - drm_connector_get_all() - drm_connector_put_all() And to get the enabled status of those connectors: drm_connector_get_enabled_status() This is prep work to remove struct drm_fb_helper_connector. Signed-off-by: Noralf Trønnes

[Intel-gfx] [RFC v4 05/25] drm/fb-helper: dpms_legacy(): Only set on connectors in use

2018-04-12 Thread Noralf Trønnes
For each enabled crtc the functions sets dpms on all registered connectors. Limit this to only doing it once and on the connectors actually in use. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_fb_helper.c | 11 +-- 1 file changed, 5 insertions

[Intel-gfx] [RFC v4 10/25] drm/connector: Add drm_connector_has_preferred_mode/pick_cmdline_mode()

2018-04-12 Thread Noralf Trønnes
Move them over from drm_fb_helper since they are connector functions. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_connector.c| 94 ++ drivers/gpu/drm/drm_fb_helper.c| 75 ++ drivers/g

[Intel-gfx] [RFC v4 04/25] drm/fb-helper: Remove drm_fb_helper_debug_enter/leave()

2018-04-12 Thread Noralf Trønnes
lper_funcs->mode_set_base_atomic - Documentation/dev-tools/kgdb.rst Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_fb_helper.c | 82 - 1 file changed, 82 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/dr

[Intel-gfx] [RFC v4 09/25] drm/fb-helper: Move modeset commit code to drm_client

2018-04-12 Thread Noralf Trønnes
This moves the committing part of the modesetting code to drm_client. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_client.c| 242 drivers/gpu/drm/drm_fb_helper.c | 216 +-- inclu

[Intel-gfx] [RFC v4 08/25] drm/fb-helper: Use struct drm_client_display

2018-04-12 Thread Noralf Trønnes
Prepare to move the modeset committing code to drm_client. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_fb_helper.c | 161 include/drm/drm_fb_helper.h | 8 ++ 2 files changed, 89 insertions(+), 80 deletions(-)

[Intel-gfx] [RFC v4 03/25] drm/fb-helper: No need to cache rotation and sw_rotations

2018-04-12 Thread Noralf Trønnes
Getting rotation info is cheap so we can do it on demand. This is done in preparation for the removal of struct drm_fb_helper_crtc. Cc: Hans de Goede <hdego...@redhat.com> Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_fb_he

[Intel-gfx] [RFC v4 07/25] drm: Begin an API for in-kernel clients

2018-04-12 Thread Noralf Trønnes
This the beginning of an API for in-kernel clients. First out is a display representation that will be used by drm_fb_helper in order to move out its mode setting code. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/drm_cl

[Intel-gfx] [RFC v4 06/25] drm/atomic: Move __drm_atomic_helper_disable_plane/set_config()

2018-04-12 Thread Noralf Trønnes
Prepare for moving drm_fb_helper modesetting code to drm_client. drm_client will be linked to drm.ko, so move __drm_atomic_helper_disable_plane() and __drm_atomic_helper_set_config() out of drm_kms_helper.ko. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_at

[Intel-gfx] [RFC v4 01/25] drm: provide management functions for drm_file

2018-04-12 Thread Noralf Trønnes
e fops implementations and APIs (not that I am aware of any such plans), and more importantly from in-kernel use where no real file is available. Signed-off-by: David Herrmann <dh.herrm...@gmail.com> Signed-off-by: Noralf Trønnes <nor...@tronnes.org> Reviewed-by: Daniel Vetter <d

[Intel-gfx] [RFC v4 00/25] drm: Add generic fbdev emulation

2018-04-12 Thread Noralf Trønnes
buggy patch: (Chris Wilson) drm/prime: Clear drm_gem_object->dma_buf on release - Defer buffer creation until fb_open. David Herrmann (1): drm: provide management functions for drm_file Noralf Trønnes (24): drm/file: Don't set master on in-kernel clients drm/fb-helper: No need to ca

[Intel-gfx] [RFC v4 02/25] drm/file: Don't set master on in-kernel clients

2018-04-12 Thread Noralf Trønnes
It only makes sense for userspace clients. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> Reviewed-by: Daniel Vetter <daniel.vet...@ffwll.ch> --- drivers/gpu/drm/drm_file.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/

Re: [Intel-gfx] [PATCH v2 2/2] drm/tinydrm: Make fb_dirty into a lower level hook

2018-03-23 Thread Noralf Trønnes
tinydrm_device directly for now. v2: Deal with the fb->dirty() in tinydrm_display_pipe_update() as weel (Noralf) Cc: "Noralf Trønnes" <nor...@tronnes.org> Cc: David Lechner <da...@lechnology.com> Signed-off-by: Ville Syrjälä <ville.syrj...@linux.intel.com> R

Re: [Intel-gfx] [PATCH 2/2] drm/tinydrm: Make fb_dirty into a lower level hook

2018-03-23 Thread Noralf Trønnes
Den 23.03.2018 12.31, skrev Ville Syrjälä: On Fri, Mar 23, 2018 at 12:43:58AM +0100, Noralf Trønnes wrote: Den 22.03.2018 21.27, skrev Ville Syrjala: From: Ville Syrjälä <ville.syrj...@linux.intel.com> mipi_dbi_enable_flush() wants to call the fb->dirty() hook from t

Re: [Intel-gfx] [PATCH 2/2] drm/tinydrm: Make fb_dirty into a lower level hook

2018-03-22 Thread Noralf Trønnes
->fb/crtc usage for atomic drivers' thread. If we do need a hook, I prefer that we add it to drm_simple_display_pipe_funcs. Noralf. Cc: "Noralf Trønnes" <nor...@tronnes.org> Cc: David Lechner <da...@lechnology.com> Signed-off-by: Ville Syrjälä <ville.syrj...@linux.in

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

2018-03-22 Thread Noralf Trønnes
Den 22.03.2018 19.49, skrev Ville Syrjälä: On Thu, Mar 22, 2018 at 05:51:35PM +0100, Noralf Trønnes wrote: tinydrm is also using plane->fb: $ grep -r "plane\.fb" drivers/gpu/drm/tinydrm/ drivers/gpu/drm/tinydrm/repaper.c:  if (tdev->pipe.plane.fb != fb) drivers/gpu/drm/ti

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

2018-03-22 Thread Noralf Trønnes
Den 22.03.2018 16.22, skrev 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

Re: [Intel-gfx] [RFC v3 09/12] drm: Add API for in-kernel clients

2018-03-12 Thread Noralf Trønnes
Den 12.03.2018 17.51, skrev Daniel Vetter: On Thu, Mar 08, 2018 at 06:12:11PM +0100, Noralf Tr??nnes wrote: Den 06.03.2018 09.56, skrev Daniel Vetter: On Thu, Feb 22, 2018 at 09:06:50PM +0100, Noralf Tr??nnes wrote: This adds an API for writing in-kernel clients. TODO: - Flesh out and

Re: [Intel-gfx] [RFC v3 09/12] drm: Add API for in-kernel clients

2018-03-08 Thread Noralf Trønnes
Den 06.03.2018 09.56, skrev Daniel Vetter: On Thu, Feb 22, 2018 at 09:06:50PM +0100, Noralf Trønnes wrote: This adds an API for writing in-kernel clients. TODO: - Flesh out and complete documentation. - Cloned displays is not tested. - Complete tiled display support and test it. - Test plug

[Intel-gfx] [RFC v3 09/12] drm: Add API for in-kernel clients

2018-02-22 Thread Noralf Trønnes
a way to unbind individual client instances. - Maybe take the sysrq support in drm_fb_helper and move it here somehow. - Add suspend/resume callbacks. Does anyone know why fbdev requires suspend/resume? Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/K

[Intel-gfx] [RFC v3 05/12] drm: Add _ioctl suffix to some functions

2018-02-22 Thread Noralf Trønnes
Add _ioctl suffix to the remaining ioctl functions so they match up with the others: - drm_mode_addfb() - drm_mode_getfb() - drm_mode_getplane_res() - drm_mode_getplane() - drm_mode_setplane() Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_crtc_internal.

[Intel-gfx] [RFC v3 01/12] drm: provide management functions for drm_file

2018-02-22 Thread Noralf Trønnes
e fops implementations and APIs (not that I am aware of any such plans), and more importantly from in-kernel use where no real file is available. Signed-off-by: David Herrmann <dh.herrm...@gmail.com> Signed-off-by: Noralf Trønnes <nor...@tronnes.org> Reviewed-by: Daniel Vetter <d

[Intel-gfx] [RFC v3 04/12] drm: Make ioctls available for in-kernel clients part 2

2018-02-22 Thread Noralf Trønnes
side. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_crtc.c | 15 +++ drivers/gpu/drm/drm_crtc_internal.h | 37 +-- drivers/gpu/drm/drm_dumb_buffers.c | 33 drivers/gpu/drm/drm_encoder.c

[Intel-gfx] [RFC v3 02/12] drm/file: Don't set master on in-kernel clients

2018-02-22 Thread Noralf Trønnes
It only makes sense for userspace clients. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_file.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c index d4588d

[Intel-gfx] [RFC v3 03/12] drm: Make ioctls available for in-kernel clients part 1

2018-02-22 Thread Noralf Trønnes
() - drm_mode_dirtyfb_ioctl() There is no functional change from the userspace side. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_connector.c | 50 +++ drivers/gpu/drm/drm_crtc.c | 32 ++- drivers/gpu/drm/drm_crtc_internal.

[Intel-gfx] [RFC v3 00/12] drm: Add generic fbdev emulation

2018-02-22 Thread Noralf Trønnes
bot) ERROR: [drivers/gpu/drm/drm_kms_helper.ko] undefined! - Drop buggy patch: (Chris Wilson) drm/prime: Clear drm_gem_object->dma_buf on release - Defer buffer creation until fb_open. David Herrmann (1): drm: provide management functions for drm_file Noralf Trønnes (11): drm/file: Don

[Intel-gfx] [RFC v3 08/12] drm/framebuffer: Add drm_mode_can_dirtyfb()

2018-02-22 Thread Noralf Trønnes
Add a function so the generic fbdev client can check if the framebuffer does flushing. This is needed to set up deferred I/O. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_framebuffer.c | 31 +++ include/drm/drm_framebuffer.h

[Intel-gfx] [RFC v3 06/12] drm: Add DRM device iterator

2018-02-22 Thread Noralf Trønnes
a separate drm_device list. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- Does anyone know how I can make checkpatch happy, I've tried parentheses around both dev and iter: -:129: ERROR: Macros with complex values should be enclosed in parentheses #129: FILE: include/drm/drm_drv.h:679: +#

[Intel-gfx] [RFC v3 12/12] drm/client: Add VT console client

2018-02-22 Thread Noralf Trønnes
Just a hack to test the client API. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/client/Kconfig | 5 + drivers/gpu/drm/client/Makefile| 1 + drivers/gpu/drm/client/drm_vtcon.c | 760 + 3 files changed, 766 inse

[Intel-gfx] [RFC v3 10/12] drm/client: Add fbdev emulation client

2018-02-22 Thread Noralf Trønnes
lts in a NULL deref in fbcon_init(). fbcon/vt is awful when it comes to error handling. It doesn't look to be easily fixed, so I guess a buffer has to be pre-allocated to ensure health and safety. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/client/Kconfig

[Intel-gfx] [RFC v3 07/12] drm/modes: Add drm_umode_equal()

2018-02-22 Thread Noralf Trønnes
Add a way to check if userspace modes are equal. Useful for in-kernel clients. Also export drm_mode_convert_umode(). Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_modes.c | 50 + include/drm/drm_modes.h | 2 ++ 2

[Intel-gfx] [RFC v3 11/12] drm/client: Add bootsplash client

2018-02-22 Thread Noralf Trønnes
Just a hack to test the client API. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/client/Kconfig | 5 + drivers/gpu/drm/client/Makefile | 1 + drivers/gpu/drm/client/drm_bootsplash.c | 205 3 files change

Re: [Intel-gfx] [RFC v2 6/8] drm: Handle fbdev emulation in core

2018-01-11 Thread Noralf Trønnes
Den 11.01.2018 08.45, skrev Daniel Vetter: On Wed, Jan 10, 2018 at 06:02:38PM +0100, Noralf Trønnes wrote: Den 09.01.2018 11.38, skrev Daniel Vetter: On Wed, Jan 03, 2018 at 11:21:08PM +0100, Noralf Trønnes wrote: Prepare for generic fbdev emulation by letting DRM core work directly

Re: [Intel-gfx] [RFC v2 6/8] drm: Handle fbdev emulation in core

2018-01-10 Thread Noralf Trønnes
Den 09.01.2018 11.38, skrev Daniel Vetter: On Wed, Jan 03, 2018 at 11:21:08PM +0100, Noralf Trønnes wrote: Prepare for generic fbdev emulation by letting DRM core work directly with the fbdev compatibility layer. This is done by adding new fbdev helper vtable callbacks for restore

[Intel-gfx] [RFC v2 2/8] drm/ioctl: Remove trailing whitespace

2018-01-03 Thread Noralf Trønnes
Remove a couple of trailing spaces. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_ioctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c index 4aafe4802099..b1e96fb68ea8

[Intel-gfx] [RFC v2 0/8] drm: Add generic fbdev emulation

2018-01-03 Thread Noralf Trønnes
ned! - Drop buggy patch: (Chris Wilson) drm/prime: Clear drm_gem_object->dma_buf on release - Defer buffer creation until fb_open. David Herrmann (1): drm: provide management functions for drm_file Noralf Trønnes (7): drm/ioctl: Remove trailing whitespace drm: Export some ioctl functions

[Intel-gfx] [RFC v2 6/8] drm: Handle fbdev emulation in core

2018-01-03 Thread Noralf Trønnes
Prepare for generic fbdev emulation by letting DRM core work directly with the fbdev compatibility layer. This is done by adding new fbdev helper vtable callbacks for restore, hotplug_event, unregister and release. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_

[Intel-gfx] [RFC v2 5/8] drm/fb-helper: Don't restore if fbdev is not in use

2018-01-03 Thread Noralf Trønnes
-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_fb_helper.c | 15 +++ include/drm/drm_fb_helper.h | 14 ++ 2 files changed, 29 insertions(+) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 2c6adf1d80c2..f9dcc7

[Intel-gfx] [RFC v2 8/8] drm/vc4: Test generic fbdev emulation

2018-01-03 Thread Noralf Trønnes
Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/vc4/vc4_drv.c | 3 --- drivers/gpu/drm/vc4/vc4_kms.c | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index ceb385fd69c5..ef8a2d3a6d1f

[Intel-gfx] [RFC v2 1/8] drm: provide management functions for drm_file

2018-01-03 Thread Noralf Trønnes
e fops implementations and APIs (not that I am aware of any such plans), and more importantly from in-kernel use where no real file is available. Signed-off-by: David Herrmann <dh.herrm...@gmail.com> [rebased] Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/dr

[Intel-gfx] [RFC v2 4/8] drm/fb-helper: Ensure driver module is pinned in fb_open()

2018-01-03 Thread Noralf Trønnes
If struct fb_ops is defined in a library like cma, fb_open() and fbcon takes a ref on the library instead of the driver module. Use fb_ops.fb_open/fb_release to ensure that the driver module is pinned. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_fb_helper.

[Intel-gfx] [RFC v2 3/8] drm: Export some ioctl functions

2018-01-03 Thread Noralf Trønnes
Export the following functions so in-kernel users can allocate dumb buffers: - drm_file_alloc - drm_file_free - drm_prime_handle_to_fd_ioctl - drm_mode_addfb2 - drm_mode_create_dumb_ioctl - drm_dropmaster_ioctl Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_

[Intel-gfx] [RFC v2 7/8] drm/fb-helper: Add generic fbdev emulation

2018-01-03 Thread Noralf Trønnes
Add generic fbdev emulation which uses a drm_file to get a dumb_buffer and drm_framebuffer. The buffer is exported and vmap/mmap called on the dma-buf. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_fb_helper.c | 301 +++- i

Re: [Intel-gfx] [RFC 4/7] drm/prime: Clear drm_gem_object->dma_buf on release

2018-01-01 Thread Noralf Trønnes
Den 31.12.2017 16.41, skrev Chris Wilson: Quoting Noralf Trønnes (2017-12-31 13:58:40) Clear the pointer so the buffer can be re-exported. Otherwise use after free happens in the next call to drm_gem_prime_handle_to_fd(). Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drive

[Intel-gfx] [RFC 5/7] drm: Handle fbdev emulation in core

2017-12-31 Thread Noralf Trønnes
Prepare for generic fbdev emulation by letting DRM core work directly with the fbdev compatibility layer. This is done by adding new fbdev helper vtable callbacks for restore, hotplug_event, unregister and release. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_

[Intel-gfx] [RFC 7/7] drm/vc4: Test generic fbdev emulation

2017-12-31 Thread Noralf Trønnes
Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/vc4/vc4_drv.c | 3 --- drivers/gpu/drm/vc4/vc4_kms.c | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index ceb385fd69c5..ef8a2d3a6d1f

[Intel-gfx] [RFC 3/7] drm/fb-helper: Don't restore if fbdev is not in use

2017-12-31 Thread Noralf Trønnes
-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_fb_helper.c | 15 +++ include/drm/drm_fb_helper.h | 14 ++ 2 files changed, 29 insertions(+) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 2c6adf1d80c2..f9dcc7

[Intel-gfx] [RFC 4/7] drm/prime: Clear drm_gem_object->dma_buf on release

2017-12-31 Thread Noralf Trønnes
Clear the pointer so the buffer can be re-exported. Otherwise use after free happens in the next call to drm_gem_prime_handle_to_fd(). Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_prime.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/g

[Intel-gfx] [RFC 2/7] drm/fb-helper: Ensure driver module is pinned in fb_open()

2017-12-31 Thread Noralf Trønnes
(). Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_fb_helper.c | 40 include/drm/drm_fb_helper.h | 15 +++ 2 files changed, 55 insertions(+) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_he

[Intel-gfx] [RFC 0/7] drm: Add generic fbdev emulation

2017-12-31 Thread Noralf Trønnes
/152612.html David Herrmann (1): drm: provide management functions for drm_file Noralf Trønnes (6): drm/fb-helper: Ensure driver module is pinned in fb_open() drm/fb-helper: Don't restore if fbdev is not in use drm/prime: Clear drm_gem_object->dma_buf on release drm: Handle fb

[Intel-gfx] [RFC 6/7] drm/fb-helper: Add generic fbdev emulation

2017-12-31 Thread Noralf Trønnes
Add generic fbdev emulation which uses a drm_file to get a dumb_buffer and drm_framebuffer. The buffer is exported and vmap/mmap called on the dma-buf. Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/drm_fb_helper.c | 289 i

[Intel-gfx] [RFC 1/7] drm: provide management functions for drm_file

2017-12-31 Thread Noralf Trønnes
e fops implementations and APIs (not that I am aware of any such plans), and more importantly from in-kernel use where no real file is available. Signed-off-by: David Herrmann <dh.herrm...@gmail.com> [rebased] Signed-off-by: Noralf Trønnes <nor...@tronnes.org> --- drivers/gpu/drm/dr

Re: [Intel-gfx] [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers

2017-12-08 Thread Noralf Trønnes
Den 06.12.2017 10.14, skrev Daniel Vetter: On Tue, Dec 05, 2017 at 04:11:26PM -0500, Alex Deucher wrote: On Tue, Dec 5, 2017 at 1:24 PM, Noralf Trønnes <nor...@tronnes.org> wrote: The helpers are applied and have reached airlied/drm-next. amd has gained another .poll_changed user sinc

Re: [Intel-gfx] [PATCH] drm: More debug info for fb leaks in mode_config_cleanup

2017-12-07 Thread Noralf Trønnes
Acked-by: Noralf Trønnes <nor...@tronnes.org> drivers/gpu/drm/drm_mode_config.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c index cc78b3d9e5e4..6ffe952142e6 100644 --- a/drivers/gpu/drm/drm_mode_config.c +++ b/dri

Re: [Intel-gfx] [PATCH v3 04/11] drm/exynos: Use drm_fb_helper_lastclose() and _poll_changed()

2017-12-07 Thread Noralf Trønnes
Den 07.12.2017 01.50, skrev Inki Dae: 2017년 12월 06일 03:24에 Noralf Trønnes 이(가) 쓴 글: This driver can use drm_fb_helper_lastclose() as its .lastclose callback. It can also use drm_fb_helper_output_poll_changed() as its .output_poll_changed callback. Cc: Inki Dae <inki@samsung.com&

[Intel-gfx] [PATCH v3 11/11] drm/tegra: Use drm_fb_helper_lastclose() and _poll_changed()

2017-12-05 Thread Noralf Trønnes
This driver can use drm_fb_helper_lastclose() as its .lastclose callback. It can also use drm_fb_helper_output_poll_changed() as its .output_poll_changed callback. Cc: Thierry Reding <thierry.red...@gmail.com> Signed-off-by: Noralf Trønnes <nor...@tronnes.org> Acked-by: Daniel Vetter

[Intel-gfx] [PATCH v3 10/11] drm/rockchip: Use drm_fb_helper_lastclose() and _poll_changed()

2017-12-05 Thread Noralf Trønnes
This driver can use drm_fb_helper_lastclose() as its .lastclose callback. It can also use drm_fb_helper_output_poll_changed() as its .output_poll_changed callback. Cc: Mark Yao <mark@rock-chips.com> Signed-off-by: Noralf Trønnes <nor...@tronnes.org> Acked-by: Daniel Vetter

[Intel-gfx] [PATCH v3 03/11] drm/armada: Use drm_fb_helper_lastclose() and _poll_changed()

2017-12-05 Thread Noralf Trønnes
This driver can use drm_fb_helper_lastclose() as its .lastclose callback. It can also use drm_fb_helper_output_poll_changed() as its .output_poll_changed callback. Cc: Russell King <li...@armlinux.org.uk> Signed-off-by: Noralf Trønnes <nor...@tronnes.org> Acked-by: Russell K

[Intel-gfx] [PATCH v3 08/11] drm/omap: Use drm_fb_helper_lastclose() and _poll_changed()

2017-12-05 Thread Noralf Trønnes
This driver can use drm_fb_helper_lastclose() as its .lastclose callback. It can also use drm_fb_helper_output_poll_changed() as its .output_poll_changed callback. Cc: Tomi Valkeinen <tomi.valkei...@ti.com> Signed-off-by: Noralf Trønnes <nor...@tronnes.org> Acked-by: Daniel Vetter

[Intel-gfx] [PATCH v3 05/11] drm/gma500: Use drm_fb_helper_lastclose() and _poll_changed()

2017-12-05 Thread Noralf Trønnes
This driver can use drm_fb_helper_lastclose() as its .lastclose callback. It can also use drm_fb_helper_output_poll_changed() as its .output_poll_changed callback. Cc: Patrik Jakobsson <patrik.r.jakobs...@gmail.com> Signed-off-by: Noralf Trønnes <nor...@tronnes.org> Acked-by: D

[Intel-gfx] [PATCH v3 09/11] drm/radeon: Use drm_fb_helper_lastclose() and _poll_changed()

2017-12-05 Thread Noralf Trønnes
This driver can use drm_fb_helper_lastclose() in its .lastclose function. It can also use drm_fb_helper_output_poll_changed() as its .output_poll_changed callback. Cc: Alex Deucher <alexander.deuc...@amd.com> Cc: "Christian König" <christian.koe...@amd.com> Signed-off-b

[Intel-gfx] [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers

2017-12-05 Thread Noralf Trønnes
: drm/i915/fbdev: Serialise early hotplug events with async fbdev config - Drop vboxvideo patch, it will be re-sent when the helper functions have reached Greg's staging tree. Changes since version 1: - drm_device.drm_fb_helper_private -> drm_device.fb_helper (Ville) Noralf Trønnes (11):

[Intel-gfx] [PATCH v3 07/11] drm/nouveau: Use drm_fb_helper_output_poll_changed()

2017-12-05 Thread Noralf Trønnes
This driver can use drm_fb_helper_output_poll_changed() instead of its own nouveau_fbcon_output_poll_changed(). Cc: Ben Skeggs <bske...@redhat.com> Signed-off-by: Noralf Trønnes <nor...@tronnes.org> Acked-by: Daniel Vetter <daniel.vet...@ffwll.ch> --- drivers/gpu/drm/nouveau

<    1   2   3   4   5   6   >