Re: fbdevdrm

2020-08-18 Thread Thomas Zimmermann
(cc'ing dri-devel. It's public information that others should be able to find.) Hi Mark, generally speaking, what you try to do should be possible with fbconv/fbdevdrm. Am 17.08.20 um 21:12 schrieb Nnext unnnext: > Hey Thomas! > > I am working on postmarketOS, mobile Alpine

Re: [PATCH 09/11] drm/fbdevdrm: Add primary plane

2019-04-02 Thread Mathieu Malaterre
On Wed, Mar 27, 2019 at 10:37 AM Thomas Zimmermann wrote: > > Hi > > Am 26.03.19 um 14:33 schrieb Mathieu Malaterre: > > > > ... > > ../drivers/gpu/drm/fbdevdrm/fbdevdrm_modes.c:174:2: note: in expansion > > of macro 'do_div' > > do_div(width,

Re: [PATCH 07/11] drm/fbdevdrm: Add DRM <-> fbdev pixel-format conversion

2019-03-27 Thread Ville Syrjälä
On Wed, Mar 27, 2019 at 09:28:49AM +0100, Thomas Zimmermann wrote: > Hi > > Am 26.03.19 um 17:29 schrieb Ville Syrjälä: > >> + > >> +static bool is_c8(const struct fb_info* fb_info) > >> +{ > >> + return fb_info->var.bits_per_pixel == 8; > >> +} > >> + > >> +static bool is_rgb565_be(const struct

Re: [PATCH 09/11] drm/fbdevdrm: Add primary plane

2019-03-27 Thread Thomas Zimmermann
Hi Am 26.03.19 um 14:33 schrieb Mathieu Malaterre: > > ... > ../drivers/gpu/drm/fbdevdrm/fbdevdrm_modes.c:174:2: note: in expansion > of macro 'do_div' > do_div(width, cpp); > ^~ > In file included from ./arch/powerpc/include/generated/asm/div64.h:1, >

Re: [PATCH 09/11] drm/fbdevdrm: Add primary plane

2019-03-27 Thread Mathieu Malaterre
On Tue, Mar 26, 2019 at 10:18 AM Thomas Zimmermann wrote: > > Signed-off-by: Thomas Zimmermann > --- > drivers/gpu/drm/fbdevdrm/Makefile | 1 + > drivers/gpu/drm/fbdevdrm/fbdevdrm_modes.c | 42 ++ > drivers/gpu/drm/fbdevdrm/fbdevdrm_modes.h | 7 + > dri

Re: [PATCH 11/11] drm/fbdevdrm: Detect and validate display modes

2019-03-27 Thread Thomas Zimmermann
Hi Am 26.03.19 um 17:47 schrieb Ville Syrjälä: >> +static int connector_helper_get_modes(struct drm_connector *connector) >> +{ >> +struct fbdevdrm_modeset *modeset; >> +struct list_head *pos; >> +int ret, num_modes = 0; >> + >> +modeset = fbdevdrm_modeset_of_connector(connector);

Re: [PATCH 07/11] drm/fbdevdrm: Add DRM <-> fbdev pixel-format conversion

2019-03-27 Thread Thomas Zimmermann
Hi Am 26.03.19 um 17:29 schrieb Ville Syrjälä: >> + >> +static bool is_c8(const struct fb_info* fb_info) >> +{ >> +return fb_info->var.bits_per_pixel == 8; >> +} >> + >> +static bool is_rgb565_be(const struct fb_info* fb_info) >> +{ >> +return (fb_info->var.bits_per_pixel == 16) && >> +

Re: [PATCH 02/11] drm/fbdevdrm: Add fbdevdrm device

2019-03-27 Thread Daniel Vetter
On Wed, Mar 27, 2019 at 8:55 AM Thomas Zimmermann wrote: > This all comes from using the event-reporting mechanism to hook into the > fbdev module. Daniel suggested to copy over some of the fbdev drivers > for porting, which would solve the problem. On the fbdev event reporting stuff: I have a pa

Re: [PATCH 02/11] drm/fbdevdrm: Add fbdevdrm device

2019-03-27 Thread Thomas Zimmermann
t;S3 Virge/DX"); >> +} > > This seems odd. s3fb sets fix.accel to NULL unconditionally AFAICT, not > sure why you're testing for that explicitly. If accel is 0, it might be a generic driver. Hence, fbdevdrm ignored s3fb, so I added the exception. > I do have a question thoug

Re: [PATCH 11/11] drm/fbdevdrm: Detect and validate display modes

2019-03-26 Thread Daniel Vetter
ften, a list of > > previously set modes. A later update to the mode detection could also > > take into account the modes in fb_monspecs::modedb or test pre-defined > > VESA modes. > > > > Signed-off-by: Thomas Zimmermann > > --- > > drivers/gpu/drm/fbdevdrm/fbdevdrm

Re: [PATCH 11/11] drm/fbdevdrm: Detect and validate display modes

2019-03-26 Thread Ville Syrjälä
so > take into account the modes in fb_monspecs::modedb or test pre-defined > VESA modes. > > Signed-off-by: Thomas Zimmermann > --- > drivers/gpu/drm/fbdevdrm/fbdevdrm_modeset.c | 163 +++- > 1 file changed, 162 insertions(+), 1 deletion(-) > > d

Re: [PATCH 07/11] drm/fbdevdrm: Add DRM <-> fbdev pixel-format conversion

2019-03-26 Thread Ville Syrjälä
On Tue, Mar 26, 2019 at 10:17:40AM +0100, Thomas Zimmermann wrote: > Signed-off-by: Thomas Zimmermann > --- > drivers/gpu/drm/fbdevdrm/Makefile | 1 + > drivers/gpu/drm/fbdevdrm/fbdevdrm_format.c | 441 + > drivers/gpu/drm/fbdevdrm/fbdevdrm_format.

Re: [PATCH 02/11] drm/fbdevdrm: Add fbdevdrm device

2019-03-26 Thread Adam Jackson
On Tue, 2019-03-26 at 10:17 +0100, Thomas Zimmermann wrote: > +static bool is_generic_driver(const struct fb_info *fb_info) > +{ > + /* DRM porting note: We don't want to bind to vga16fb, vesafb, or any > + * other generic fbdev driver. Usually, these drivers have limited > + * capab

Re: [PATCH 09/11] drm/fbdevdrm: Add primary plane

2019-03-26 Thread Thomas Zimmermann
Hi Am 26.03.19 um 14:33 schrieb Mathieu Malaterre: > A simple compile/test here leads to: > > ... > ../drivers/gpu/drm/fbdevdrm/fbdevdrm_modes.c:174:2: note: in expansion > of macro 'do_div' > do_div(width, cpp); > ^~ > In file included from ./arch/power

[PATCH 05/11] drm/fbdevdrm: Add GEM and dumb interfaces

2019-03-26 Thread Thomas Zimmermann
Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/fbdevdrm/fbdevdrm_drv.c | 77 + 1 file changed, 77 insertions(+) diff --git a/drivers/gpu/drm/fbdevdrm/fbdevdrm_drv.c b/drivers/gpu/drm/fbdevdrm/fbdevdrm_drv.c index 4a6ba6c85c5c..4724e3df6ace 100644 --- a/drivers/gpu

[PATCH 06/11] drm/fbdevdrm: Add modesetting infrastructure

2019-03-26 Thread Thomas Zimmermann
Modesetting for fbdevdrm supports a single display pipeline with CRTC, primary plane, encoder and connector. The fbdev device would have been an ideal candidate for using |struct drm_simple_display_pipe|. To better illustrate the conversion from fbdev to DRM drivers, fbdevdrm used the regular DRM

[PATCH 10/11] drm/fbdevdrm: Add CRTC

2019-03-26 Thread Thomas Zimmermann
Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/fbdevdrm/fbdevdrm_modeset.c | 150 +++- 1 file changed, 149 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/fbdevdrm/fbdevdrm_modeset.c b/drivers/gpu/drm/fbdevdrm/fbdevdrm_modeset.c index 3473b85acbf1..87f56ec76edf

[PATCH 02/11] drm/fbdevdrm: Add fbdevdrm device

2019-03-26 Thread Thomas Zimmermann
There's an fbdevdrm device for each supported fbdev device. The fbdevdrm driver listens for fb events, and creates and destroys fbdevdrm devices accordingly. Only hardware-specific fbdev drivers are supported. Generic drivers, such as vga16fb or vesafb are not handled. DRM-based fbdev driver

[PATCH 09/11] drm/fbdevdrm: Add primary plane

2019-03-26 Thread Thomas Zimmermann
Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/fbdevdrm/Makefile | 1 + drivers/gpu/drm/fbdevdrm/fbdevdrm_modes.c | 42 ++ drivers/gpu/drm/fbdevdrm/fbdevdrm_modes.h | 7 + drivers/gpu/drm/fbdevdrm/fbdevdrm_modeset.c | 9 +- drivers/gpu/drm/fbdevdrm/fbdevdrm_modeset.h

[PATCH 11/11] drm/fbdevdrm: Detect and validate display modes

2019-03-26 Thread Thomas Zimmermann
. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/fbdevdrm/fbdevdrm_modeset.c | 163 +++- 1 file changed, 162 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/fbdevdrm/fbdevdrm_modeset.c b/drivers/gpu/drm/fbdevdrm/fbdevdrm_modeset.c index 87f56ec76edf..e89eca4b58df

[PATCH 03/11] drm/fbdevdrm: Add memory management

2019-03-26 Thread Thomas Zimmermann
Memory management in fbdevdrm is provided by TTM. Fbdev implements page flipping via display pan operations, which require scanout buffers to be aligned at scanline boundaries. At the same time memory-mapping operations of individual buffers requires page alignment of each buffer. Fbdevdrm ensures

[PATCH 01/11] drm/fbdevdrm: Add driver skeleton

2019-03-26 Thread Thomas Zimmermann
The fbdevdrm driver runs DRM on top of fbdev framebuffer drivers. It allows for using legacy drivers with modern userspace and gives a template for converting fbdev drivers to DRM. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile

[PATCH 07/11] drm/fbdevdrm: Add DRM <-> fbdev pixel-format conversion

2019-03-26 Thread Thomas Zimmermann
Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/fbdevdrm/Makefile | 1 + drivers/gpu/drm/fbdevdrm/fbdevdrm_format.c | 441 + drivers/gpu/drm/fbdevdrm/fbdevdrm_format.h | 26 ++ 3 files changed, 468 insertions(+) create mode 100644 drivers/gpu/drm/fbdevdrm

[PATCH 04/11] drm/fbdevdrm: Add file operations

2019-03-26 Thread Thomas Zimmermann
Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/fbdevdrm/fbdevdrm_drv.c | 29 - 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/fbdevdrm/fbdevdrm_drv.c b/drivers/gpu/drm/fbdevdrm/fbdevdrm_drv.c index 5be902094dc6..4a6ba6c85c5c 100644

[PATCH 08/11] drm/fbdevdrm: Add mode conversion DRM <-> fbdev

2019-03-26 Thread Thomas Zimmermann
Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/fbdevdrm/Makefile | 1 + drivers/gpu/drm/fbdevdrm/fbdevdrm_modes.c | 153 ++ drivers/gpu/drm/fbdevdrm/fbdevdrm_modes.h | 46 +++ 3 files changed, 200 insertions(+) create mode 100644 drivers/gpu/drm/fbdevdrm