linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/5] gem/vram: pin to vram in vmap
       [not found] <20190627122348.5833-1-kraxel@redhat.com>
@ 2019-06-27 12:23 ` Gerd Hoffmann
  2019-06-27 14:37   ` Thomas Zimmermann
  2019-06-27 12:23 ` [PATCH v3 2/5] drm/bochs: pass framebuffer to bochs_hw_setbase Gerd Hoffmann
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Gerd Hoffmann @ 2019-06-27 12:23 UTC (permalink / raw)
  To: dri-devel
  Cc: tzimmermann, Gerd Hoffmann, Maarten Lankhorst, Maxime Ripard,
	Sean Paul, David Airlie, Daniel Vetter, open list

drm clients like the generic framebuffer emulation keep a permanent
vmap active, which in turn has a permanent pin.  This pin needs to
be in vram, otherwise we can't display the framebuffer.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 drivers/gpu/drm/drm_gem_vram_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c
index 4de782ca26b2..c724876c6f2a 100644
--- a/drivers/gpu/drm/drm_gem_vram_helper.c
+++ b/drivers/gpu/drm/drm_gem_vram_helper.c
@@ -592,7 +592,7 @@ void *drm_gem_vram_driver_gem_prime_vmap(struct drm_gem_object *gem)
 	int ret;
 	void *base;
 
-	ret = drm_gem_vram_pin(gbo, 0);
+	ret = drm_gem_vram_pin(gbo, DRM_GEM_VRAM_PL_FLAG_VRAM);
 	if (ret)
 		return NULL;
 	base = drm_gem_vram_kmap(gbo, true, NULL);
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v3 2/5] drm/bochs: pass framebuffer to bochs_hw_setbase
       [not found] <20190627122348.5833-1-kraxel@redhat.com>
  2019-06-27 12:23 ` [PATCH v3 1/5] gem/vram: pin to vram in vmap Gerd Hoffmann
@ 2019-06-27 12:23 ` Gerd Hoffmann
  2019-06-27 12:23 ` [PATCH v3 3/5] drm/bochs: drop yres_virtual from struct bochs_device Gerd Hoffmann
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Gerd Hoffmann @ 2019-06-27 12:23 UTC (permalink / raw)
  To: dri-devel
  Cc: tzimmermann, Gerd Hoffmann, David Airlie, Daniel Vetter,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU, open list

Also rename to bochs_hw_setfb, we have to set more
than just the base address.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 drivers/gpu/drm/bochs/bochs.h     |  5 +++--
 drivers/gpu/drm/bochs/bochs_hw.c  | 10 +++++-----
 drivers/gpu/drm/bochs/bochs_kms.c | 10 +++-------
 3 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/bochs/bochs.h b/drivers/gpu/drm/bochs/bochs.h
index cc35d492142c..246f05f4a711 100644
--- a/drivers/gpu/drm/bochs/bochs.h
+++ b/drivers/gpu/drm/bochs/bochs.h
@@ -85,8 +85,9 @@ void bochs_hw_setmode(struct bochs_device *bochs,
 		      struct drm_display_mode *mode);
 void bochs_hw_setformat(struct bochs_device *bochs,
 			const struct drm_format_info *format);
-void bochs_hw_setbase(struct bochs_device *bochs,
-		      int x, int y, u64 addr);
+void bochs_hw_setfb(struct bochs_device *bochs,
+		    struct drm_framebuffer *fb,
+		    int x, int y);
 int bochs_hw_load_edid(struct bochs_device *bochs);
 
 /* bochs_mm.c */
diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c
index 791ab2f79947..67101c85029c 100644
--- a/drivers/gpu/drm/bochs/bochs_hw.c
+++ b/drivers/gpu/drm/bochs/bochs_hw.c
@@ -254,17 +254,17 @@ void bochs_hw_setformat(struct bochs_device *bochs,
 	};
 }
 
-void bochs_hw_setbase(struct bochs_device *bochs,
-		      int x, int y, u64 addr)
+void bochs_hw_setfb(struct bochs_device *bochs,
+		    struct drm_framebuffer *fb,
+		    int x, int y)
 {
-	unsigned long offset = (unsigned long)addr +
+	struct drm_gem_vram_object *bo = drm_gem_vram_of_gem(fb->obj[0]);
+	unsigned long offset = bo->bo.offset +
 		y * bochs->stride +
 		x * (bochs->bpp / 8);
 	int vy = offset / bochs->stride;
 	int vx = (offset % bochs->stride) * 8 / bochs->bpp;
 
-	DRM_DEBUG_DRIVER("x %d, y %d, addr %llx -> offset %lx, vx %d, vy %d\n",
-			 x, y, addr, offset, vx, vy);
 	bochs_dispi_write(bochs, VBE_DISPI_INDEX_X_OFFSET, vx);
 	bochs_dispi_write(bochs, VBE_DISPI_INDEX_Y_OFFSET, vy);
 }
diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c
index 5904eddc83a5..ddbf0802138d 100644
--- a/drivers/gpu/drm/bochs/bochs_kms.c
+++ b/drivers/gpu/drm/bochs/bochs_kms.c
@@ -27,16 +27,12 @@ static const uint32_t bochs_formats[] = {
 static void bochs_plane_update(struct bochs_device *bochs,
 			       struct drm_plane_state *state)
 {
-	struct drm_gem_vram_object *gbo;
-
 	if (!state->fb || !bochs->stride)
 		return;
 
-	gbo = drm_gem_vram_of_gem(state->fb->obj[0]);
-	bochs_hw_setbase(bochs,
-			 state->crtc_x,
-			 state->crtc_y,
-			 gbo->bo.offset);
+	bochs_hw_setfb(bochs, state->fb,
+		       state->crtc_x,
+		       state->crtc_y);
 	bochs_hw_setformat(bochs, state->fb->format);
 }
 
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v3 3/5] drm/bochs: drop yres_virtual from struct bochs_device
       [not found] <20190627122348.5833-1-kraxel@redhat.com>
  2019-06-27 12:23 ` [PATCH v3 1/5] gem/vram: pin to vram in vmap Gerd Hoffmann
  2019-06-27 12:23 ` [PATCH v3 2/5] drm/bochs: pass framebuffer to bochs_hw_setbase Gerd Hoffmann
@ 2019-06-27 12:23 ` Gerd Hoffmann
  2019-06-27 12:23 ` [PATCH v3 4/5] drm/bochs: drop stride and bpp " Gerd Hoffmann
  2019-06-27 12:23 ` [PATCH v3 5/5] drm/bochs: move bochs_hw_setformat() call Gerd Hoffmann
  4 siblings, 0 replies; 9+ messages in thread
From: Gerd Hoffmann @ 2019-06-27 12:23 UTC (permalink / raw)
  To: dri-devel
  Cc: tzimmermann, Gerd Hoffmann, David Airlie, Daniel Vetter,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU, open list

Not needed, writing to VBE_DISPI_INDEX_VIRT_HEIGHT has no effect anyway.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 drivers/gpu/drm/bochs/bochs.h    | 1 -
 drivers/gpu/drm/bochs/bochs_hw.c | 8 ++------
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/bochs/bochs.h b/drivers/gpu/drm/bochs/bochs.h
index 246f05f4a711..5c90b76708ef 100644
--- a/drivers/gpu/drm/bochs/bochs.h
+++ b/drivers/gpu/drm/bochs/bochs.h
@@ -64,7 +64,6 @@ struct bochs_device {
 	/* mode */
 	u16 xres;
 	u16 yres;
-	u16 yres_virtual;
 	u32 stride;
 	u32 bpp;
 	struct edid *edid;
diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c
index 67101c85029c..9ab6ec269ef9 100644
--- a/drivers/gpu/drm/bochs/bochs_hw.c
+++ b/drivers/gpu/drm/bochs/bochs_hw.c
@@ -207,11 +207,9 @@ void bochs_hw_setmode(struct bochs_device *bochs,
 	bochs->yres = mode->vdisplay;
 	bochs->bpp = 32;
 	bochs->stride = mode->hdisplay * (bochs->bpp / 8);
-	bochs->yres_virtual = bochs->fb_size / bochs->stride;
 
-	DRM_DEBUG_DRIVER("%dx%d @ %d bpp, vy %d\n",
-			 bochs->xres, bochs->yres, bochs->bpp,
-			 bochs->yres_virtual);
+	DRM_DEBUG_DRIVER("%dx%d @ %d bpp\n",
+			 bochs->xres, bochs->yres, bochs->bpp);
 
 	bochs_vga_writeb(bochs, 0x3c0, 0x20); /* unblank */
 
@@ -221,8 +219,6 @@ void bochs_hw_setmode(struct bochs_device *bochs,
 	bochs_dispi_write(bochs, VBE_DISPI_INDEX_YRES,        bochs->yres);
 	bochs_dispi_write(bochs, VBE_DISPI_INDEX_BANK,        0);
 	bochs_dispi_write(bochs, VBE_DISPI_INDEX_VIRT_WIDTH,  bochs->xres);
-	bochs_dispi_write(bochs, VBE_DISPI_INDEX_VIRT_HEIGHT,
-			  bochs->yres_virtual);
 	bochs_dispi_write(bochs, VBE_DISPI_INDEX_X_OFFSET,    0);
 	bochs_dispi_write(bochs, VBE_DISPI_INDEX_Y_OFFSET,    0);
 
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v3 4/5] drm/bochs: drop stride and bpp from struct bochs_device
       [not found] <20190627122348.5833-1-kraxel@redhat.com>
                   ` (2 preceding siblings ...)
  2019-06-27 12:23 ` [PATCH v3 3/5] drm/bochs: drop yres_virtual from struct bochs_device Gerd Hoffmann
@ 2019-06-27 12:23 ` Gerd Hoffmann
  2019-06-27 12:23 ` [PATCH v3 5/5] drm/bochs: move bochs_hw_setformat() call Gerd Hoffmann
  4 siblings, 0 replies; 9+ messages in thread
From: Gerd Hoffmann @ 2019-06-27 12:23 UTC (permalink / raw)
  To: dri-devel
  Cc: tzimmermann, Gerd Hoffmann, David Airlie, Daniel Vetter,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU, open list

No need to store that, struct drm_framebuffer has all we need.

Also update VBE_DISPI_INDEX_VIRT_WIDTH register, otherwise we'll
have a fixes broken display in case pitch != width * cpp.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 drivers/gpu/drm/bochs/bochs.h     |  2 --
 drivers/gpu/drm/bochs/bochs_hw.c  | 18 +++++++++---------
 drivers/gpu/drm/bochs/bochs_kms.c |  2 +-
 3 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/bochs/bochs.h b/drivers/gpu/drm/bochs/bochs.h
index 5c90b76708ef..4081b3aba28d 100644
--- a/drivers/gpu/drm/bochs/bochs.h
+++ b/drivers/gpu/drm/bochs/bochs.h
@@ -64,8 +64,6 @@ struct bochs_device {
 	/* mode */
 	u16 xres;
 	u16 yres;
-	u32 stride;
-	u32 bpp;
 	struct edid *edid;
 
 	/* drm */
diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c
index 9ab6ec269ef9..178715c6755d 100644
--- a/drivers/gpu/drm/bochs/bochs_hw.c
+++ b/drivers/gpu/drm/bochs/bochs_hw.c
@@ -205,16 +205,14 @@ void bochs_hw_setmode(struct bochs_device *bochs,
 {
 	bochs->xres = mode->hdisplay;
 	bochs->yres = mode->vdisplay;
-	bochs->bpp = 32;
-	bochs->stride = mode->hdisplay * (bochs->bpp / 8);
 
-	DRM_DEBUG_DRIVER("%dx%d @ %d bpp\n",
-			 bochs->xres, bochs->yres, bochs->bpp);
+	DRM_DEBUG_DRIVER("%dx%d\n",
+			 bochs->xres, bochs->yres);
 
 	bochs_vga_writeb(bochs, 0x3c0, 0x20); /* unblank */
 
 	bochs_dispi_write(bochs, VBE_DISPI_INDEX_ENABLE,      0);
-	bochs_dispi_write(bochs, VBE_DISPI_INDEX_BPP,         bochs->bpp);
+	bochs_dispi_write(bochs, VBE_DISPI_INDEX_BPP,         32);
 	bochs_dispi_write(bochs, VBE_DISPI_INDEX_XRES,        bochs->xres);
 	bochs_dispi_write(bochs, VBE_DISPI_INDEX_YRES,        bochs->yres);
 	bochs_dispi_write(bochs, VBE_DISPI_INDEX_BANK,        0);
@@ -256,11 +254,13 @@ void bochs_hw_setfb(struct bochs_device *bochs,
 {
 	struct drm_gem_vram_object *bo = drm_gem_vram_of_gem(fb->obj[0]);
 	unsigned long offset = bo->bo.offset +
-		y * bochs->stride +
-		x * (bochs->bpp / 8);
-	int vy = offset / bochs->stride;
-	int vx = (offset % bochs->stride) * 8 / bochs->bpp;
+		y * fb->pitches[0] +
+		x * fb->format->cpp[0];
+	int vy = offset / fb->pitches[0];
+	int vx = (offset % fb->pitches[0]) / fb->format->cpp[0];
+	int vw = fb->pitches[0] / fb->format->cpp[0];
 
+	bochs_dispi_write(bochs, VBE_DISPI_INDEX_VIRT_WIDTH, vw);
 	bochs_dispi_write(bochs, VBE_DISPI_INDEX_X_OFFSET, vx);
 	bochs_dispi_write(bochs, VBE_DISPI_INDEX_Y_OFFSET, vy);
 }
diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c
index ddbf0802138d..28edfb2772ff 100644
--- a/drivers/gpu/drm/bochs/bochs_kms.c
+++ b/drivers/gpu/drm/bochs/bochs_kms.c
@@ -27,7 +27,7 @@ static const uint32_t bochs_formats[] = {
 static void bochs_plane_update(struct bochs_device *bochs,
 			       struct drm_plane_state *state)
 {
-	if (!state->fb || !bochs->stride)
+	if (!state->fb)
 		return;
 
 	bochs_hw_setfb(bochs, state->fb,
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v3 5/5] drm/bochs: move bochs_hw_setformat() call
       [not found] <20190627122348.5833-1-kraxel@redhat.com>
                   ` (3 preceding siblings ...)
  2019-06-27 12:23 ` [PATCH v3 4/5] drm/bochs: drop stride and bpp " Gerd Hoffmann
@ 2019-06-27 12:23 ` Gerd Hoffmann
  4 siblings, 0 replies; 9+ messages in thread
From: Gerd Hoffmann @ 2019-06-27 12:23 UTC (permalink / raw)
  To: dri-devel
  Cc: tzimmermann, Gerd Hoffmann, David Airlie, Daniel Vetter,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU, open list

Call it from bochs_hw_setfb().
This also allows to make bochs_hw_setformat static.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 drivers/gpu/drm/bochs/bochs.h     | 2 --
 drivers/gpu/drm/bochs/bochs_hw.c  | 5 +++--
 drivers/gpu/drm/bochs/bochs_kms.c | 1 -
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/bochs/bochs.h b/drivers/gpu/drm/bochs/bochs.h
index 4081b3aba28d..528b8e8dde40 100644
--- a/drivers/gpu/drm/bochs/bochs.h
+++ b/drivers/gpu/drm/bochs/bochs.h
@@ -80,8 +80,6 @@ void bochs_hw_fini(struct drm_device *dev);
 
 void bochs_hw_setmode(struct bochs_device *bochs,
 		      struct drm_display_mode *mode);
-void bochs_hw_setformat(struct bochs_device *bochs,
-			const struct drm_format_info *format);
 void bochs_hw_setfb(struct bochs_device *bochs,
 		    struct drm_framebuffer *fb,
 		    int x, int y);
diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c
index 178715c6755d..daa4fda3d322 100644
--- a/drivers/gpu/drm/bochs/bochs_hw.c
+++ b/drivers/gpu/drm/bochs/bochs_hw.c
@@ -224,8 +224,8 @@ void bochs_hw_setmode(struct bochs_device *bochs,
 			  VBE_DISPI_ENABLED | VBE_DISPI_LFB_ENABLED);
 }
 
-void bochs_hw_setformat(struct bochs_device *bochs,
-			const struct drm_format_info *format)
+static void bochs_hw_setformat(struct bochs_device *bochs,
+			       const struct drm_format_info *format)
 {
 	DRM_DEBUG_DRIVER("format %c%c%c%c\n",
 			 (format->format >>  0) & 0xff,
@@ -263,4 +263,5 @@ void bochs_hw_setfb(struct bochs_device *bochs,
 	bochs_dispi_write(bochs, VBE_DISPI_INDEX_VIRT_WIDTH, vw);
 	bochs_dispi_write(bochs, VBE_DISPI_INDEX_X_OFFSET, vx);
 	bochs_dispi_write(bochs, VBE_DISPI_INDEX_Y_OFFSET, vy);
+	bochs_hw_setformat(bochs, fb->format);
 }
diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c
index 28edfb2772ff..368803bd12e5 100644
--- a/drivers/gpu/drm/bochs/bochs_kms.c
+++ b/drivers/gpu/drm/bochs/bochs_kms.c
@@ -33,7 +33,6 @@ static void bochs_plane_update(struct bochs_device *bochs,
 	bochs_hw_setfb(bochs, state->fb,
 		       state->crtc_x,
 		       state->crtc_y);
-	bochs_hw_setformat(bochs, state->fb->format);
 }
 
 static void bochs_pipe_enable(struct drm_simple_display_pipe *pipe,
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 1/5] gem/vram: pin to vram in vmap
  2019-06-27 12:23 ` [PATCH v3 1/5] gem/vram: pin to vram in vmap Gerd Hoffmann
@ 2019-06-27 14:37   ` Thomas Zimmermann
  2019-06-27 15:16     ` Gerd Hoffmann
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Zimmermann @ 2019-06-27 14:37 UTC (permalink / raw)
  To: Gerd Hoffmann, dri-devel
  Cc: Maxime Ripard, open list, David Airlie, Sean Paul


[-- Attachment #1.1: Type: text/plain, Size: 1941 bytes --]

Hi

Am 27.06.19 um 14:23 schrieb Gerd Hoffmann:
> drm clients like the generic framebuffer emulation keep a permanent
> vmap active, which in turn has a permanent pin.  This pin needs to
> be in vram, otherwise we can't display the framebuffer.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  drivers/gpu/drm/drm_gem_vram_helper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c
> index 4de782ca26b2..c724876c6f2a 100644
> --- a/drivers/gpu/drm/drm_gem_vram_helper.c
> +++ b/drivers/gpu/drm/drm_gem_vram_helper.c
> @@ -592,7 +592,7 @@ void *drm_gem_vram_driver_gem_prime_vmap(struct drm_gem_object *gem)
>  	int ret;
>  	void *base;
>  
> -	ret = drm_gem_vram_pin(gbo, 0);
> +	ret = drm_gem_vram_pin(gbo, DRM_GEM_VRAM_PL_FLAG_VRAM);

I have a patch set that converts ast and mgag200 to generic framebuffer
emulation with a shadow FB. The actual BO is mapped by the fbdev code on
demand to update its content. Permanently mapping the fb console's BO
would consume too much display memory. This requires the pin function's
placement flag to be 0, so the BO is mapped in system memory by default.
The proposed patch breaks this.

Some ideas for solving this:

 1) Introduce a default_placement field in struct drm_gem_vram_helper
where this flag can be configured. I'd favor this option.

 2) Introduce a separate callback function for pinning to vram. The
driver would have to set the correct function pointers.

 3) Pin the fb console buffer manually from within the bochs driver.

Best regards
Thomas

>  	if (ret)
>  		return NULL;
>  	base = drm_gem_vram_kmap(gbo, true, NULL);
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 1/5] gem/vram: pin to vram in vmap
  2019-06-27 14:37   ` Thomas Zimmermann
@ 2019-06-27 15:16     ` Gerd Hoffmann
  2019-06-27 15:54       ` Thomas Zimmermann
  0 siblings, 1 reply; 9+ messages in thread
From: Gerd Hoffmann @ 2019-06-27 15:16 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: dri-devel, Maxime Ripard, open list, David Airlie, Sean Paul

  Hi,

>  1) Introduce a default_placement field in struct drm_gem_vram_helper
> where this flag can be configured. I'd favor this option.

>  2) Introduce a separate callback function for pinning to vram. The
> driver would have to set the correct function pointers.

>  3) Pin the fb console buffer manually from within the bochs driver.

Hmm.  Before calling drm_fbdev_generic_setup() the bo doesn't exist yet
and when the function returns it is already vmapped and pinned I think.

So (3) isn't easily doable.  (1) looks best to me.

cheers,
  Gerd


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 1/5] gem/vram: pin to vram in vmap
  2019-06-27 15:16     ` Gerd Hoffmann
@ 2019-06-27 15:54       ` Thomas Zimmermann
  2019-06-27 15:59         ` Thomas Zimmermann
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Zimmermann @ 2019-06-27 15:54 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: dri-devel, Maxime Ripard, open list, David Airlie, Sean Paul


[-- Attachment #1.1: Type: text/plain, Size: 1018 bytes --]

Hi

Am 27.06.19 um 17:16 schrieb Gerd Hoffmann:
>   Hi,
> 
>>  1) Introduce a default_placement field in struct drm_gem_vram_helper
>> where this flag can be configured. I'd favor this option.
> 
>>  2) Introduce a separate callback function for pinning to vram. The
>> driver would have to set the correct function pointers.
> 
>>  3) Pin the fb console buffer manually from within the bochs driver.
> 
> Hmm.  Before calling drm_fbdev_generic_setup() the bo doesn't exist yet
> and when the function returns it is already vmapped and pinned I think.
> 
> So (3) isn't easily doable.  (1) looks best to me.

For my patches, it's OK to have to BO pinned to VRAM by default. As the
BO will be unmapped most of the time, I can change this flag at any time.

Best regards
Thomas

> cheers,
>   Gerd
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 1/5] gem/vram: pin to vram in vmap
  2019-06-27 15:54       ` Thomas Zimmermann
@ 2019-06-27 15:59         ` Thomas Zimmermann
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Zimmermann @ 2019-06-27 15:59 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Maxime Ripard, David Airlie, Sean Paul, open list, dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 1310 bytes --]



Am 27.06.19 um 17:54 schrieb Thomas Zimmermann:
> Hi
> 
> Am 27.06.19 um 17:16 schrieb Gerd Hoffmann:
>>   Hi,
>>
>>>  1) Introduce a default_placement field in struct drm_gem_vram_helper
>>> where this flag can be configured. I'd favor this option.
>>
>>>  2) Introduce a separate callback function for pinning to vram. The
>>> driver would have to set the correct function pointers.
>>
>>>  3) Pin the fb console buffer manually from within the bochs driver.
>>
>> Hmm.  Before calling drm_fbdev_generic_setup() the bo doesn't exist yet
>> and when the function returns it is already vmapped and pinned I think.
>>
>> So (3) isn't easily doable.  (1) looks best to me.
> 
> For my patches, it's OK to have to BO pinned to VRAM by default. As the
> BO will be unmapped most of the time, I can change this flag at any time.

So, yeah, option 1 ...

> Best regards
> Thomas
> 
>> cheers,
>>   Gerd
>>
> 
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-06-27 15:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20190627122348.5833-1-kraxel@redhat.com>
2019-06-27 12:23 ` [PATCH v3 1/5] gem/vram: pin to vram in vmap Gerd Hoffmann
2019-06-27 14:37   ` Thomas Zimmermann
2019-06-27 15:16     ` Gerd Hoffmann
2019-06-27 15:54       ` Thomas Zimmermann
2019-06-27 15:59         ` Thomas Zimmermann
2019-06-27 12:23 ` [PATCH v3 2/5] drm/bochs: pass framebuffer to bochs_hw_setbase Gerd Hoffmann
2019-06-27 12:23 ` [PATCH v3 3/5] drm/bochs: drop yres_virtual from struct bochs_device Gerd Hoffmann
2019-06-27 12:23 ` [PATCH v3 4/5] drm/bochs: drop stride and bpp " Gerd Hoffmann
2019-06-27 12:23 ` [PATCH v3 5/5] drm/bochs: move bochs_hw_setformat() call Gerd Hoffmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).