All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: dri-devel@lists.freedesktop.org, David Airlie <airlied@redhat.com>
Cc: andr2000@gmail.com, Gerd Hoffmann <kraxel@redhat.com>,
	David Airlie <airlied@linux.ie>,
	virtualization@lists.linux-foundation.org (open list:DRM DRIVER
	FOR BOCHS VIRTUAL GPU), linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v2 02/15] drm/bochs: split bochs_hw_setmode
Date: Tue,  8 Jan 2019 12:25:06 +0100	[thread overview]
Message-ID: <20190108112519.27473-3-kraxel@redhat.com> (raw)
In-Reply-To: <20190108112519.27473-1-kraxel@redhat.com>

Create a separate bochs_hw_setformat function to configure
the framebuffer format (actually just the byteorder).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
---
 drivers/gpu/drm/bochs/bochs.h     |  5 +++--
 drivers/gpu/drm/bochs/bochs_hw.c  | 19 ++++++++++++-------
 drivers/gpu/drm/bochs/bochs_kms.c |  3 ++-
 3 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/bochs/bochs.h b/drivers/gpu/drm/bochs/bochs.h
index fb38c8b857..4dc1b6384e 100644
--- a/drivers/gpu/drm/bochs/bochs.h
+++ b/drivers/gpu/drm/bochs/bochs.h
@@ -121,8 +121,9 @@ int bochs_hw_init(struct drm_device *dev);
 void bochs_hw_fini(struct drm_device *dev);
 
 void bochs_hw_setmode(struct bochs_device *bochs,
-		      struct drm_display_mode *mode,
-		      const struct drm_format_info *format);
+		      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);
 int bochs_hw_load_edid(struct bochs_device *bochs);
diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c
index d0b4e1cee8..3e04b2f0ec 100644
--- a/drivers/gpu/drm/bochs/bochs_hw.c
+++ b/drivers/gpu/drm/bochs/bochs_hw.c
@@ -204,8 +204,7 @@ void bochs_hw_fini(struct drm_device *dev)
 }
 
 void bochs_hw_setmode(struct bochs_device *bochs,
-		      struct drm_display_mode *mode,
-		      const struct drm_format_info *format)
+		      struct drm_display_mode *mode)
 {
 	bochs->xres = mode->hdisplay;
 	bochs->yres = mode->vdisplay;
@@ -213,12 +212,8 @@ void bochs_hw_setmode(struct bochs_device *bochs,
 	bochs->stride = mode->hdisplay * (bochs->bpp / 8);
 	bochs->yres_virtual = bochs->fb_size / bochs->stride;
 
-	DRM_DEBUG_DRIVER("%dx%d @ %d bpp, format %c%c%c%c, vy %d\n",
+	DRM_DEBUG_DRIVER("%dx%d @ %d bpp, vy %d\n",
 			 bochs->xres, bochs->yres, bochs->bpp,
-			 (format->format >>  0) & 0xff,
-			 (format->format >>  8) & 0xff,
-			 (format->format >> 16) & 0xff,
-			 (format->format >> 24) & 0xff,
 			 bochs->yres_virtual);
 
 	bochs_vga_writeb(bochs, 0x3c0, 0x20); /* unblank */
@@ -236,6 +231,16 @@ void bochs_hw_setmode(struct bochs_device *bochs,
 
 	bochs_dispi_write(bochs, VBE_DISPI_INDEX_ENABLE,
 			  VBE_DISPI_ENABLED | VBE_DISPI_LFB_ENABLED);
+}
+
+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,
+			 (format->format >>  8) & 0xff,
+			 (format->format >> 16) & 0xff,
+			 (format->format >> 24) & 0xff);
 
 	switch (format->format) {
 	case DRM_FORMAT_XRGB8888:
diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c
index c8ce54498d..f7e6d1a9b3 100644
--- a/drivers/gpu/drm/bochs/bochs_kms.c
+++ b/drivers/gpu/drm/bochs/bochs_kms.c
@@ -80,7 +80,8 @@ static int bochs_crtc_mode_set(struct drm_crtc *crtc,
 	if (WARN_ON(crtc->primary->fb == NULL))
 		return -EINVAL;
 
-	bochs_hw_setmode(bochs, mode, crtc->primary->fb->format);
+	bochs_hw_setmode(bochs, mode);
+	bochs_hw_setformat(bochs, crtc->primary->fb->format);
 	bochs_crtc_mode_set_base(crtc, x, y, old_fb);
 	return 0;
 }
-- 
2.9.3


WARNING: multiple messages have this Message-ID (diff)
From: Gerd Hoffmann <kraxel@redhat.com>
To: dri-devel@lists.freedesktop.org, David Airlie <airlied@redhat.com>
Cc: andr2000@gmail.com, David Airlie <airlied@linux.ie>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:DRM DRIVER FOR BOCHS VIRTUAL GPU"
	<virtualization@lists.linux-foundation.org>
Subject: [PATCH v2 02/15] drm/bochs: split bochs_hw_setmode
Date: Tue,  8 Jan 2019 12:25:06 +0100	[thread overview]
Message-ID: <20190108112519.27473-3-kraxel@redhat.com> (raw)
In-Reply-To: <20190108112519.27473-1-kraxel@redhat.com>

Create a separate bochs_hw_setformat function to configure
the framebuffer format (actually just the byteorder).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
---
 drivers/gpu/drm/bochs/bochs.h     |  5 +++--
 drivers/gpu/drm/bochs/bochs_hw.c  | 19 ++++++++++++-------
 drivers/gpu/drm/bochs/bochs_kms.c |  3 ++-
 3 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/bochs/bochs.h b/drivers/gpu/drm/bochs/bochs.h
index fb38c8b857..4dc1b6384e 100644
--- a/drivers/gpu/drm/bochs/bochs.h
+++ b/drivers/gpu/drm/bochs/bochs.h
@@ -121,8 +121,9 @@ int bochs_hw_init(struct drm_device *dev);
 void bochs_hw_fini(struct drm_device *dev);
 
 void bochs_hw_setmode(struct bochs_device *bochs,
-		      struct drm_display_mode *mode,
-		      const struct drm_format_info *format);
+		      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);
 int bochs_hw_load_edid(struct bochs_device *bochs);
diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c
index d0b4e1cee8..3e04b2f0ec 100644
--- a/drivers/gpu/drm/bochs/bochs_hw.c
+++ b/drivers/gpu/drm/bochs/bochs_hw.c
@@ -204,8 +204,7 @@ void bochs_hw_fini(struct drm_device *dev)
 }
 
 void bochs_hw_setmode(struct bochs_device *bochs,
-		      struct drm_display_mode *mode,
-		      const struct drm_format_info *format)
+		      struct drm_display_mode *mode)
 {
 	bochs->xres = mode->hdisplay;
 	bochs->yres = mode->vdisplay;
@@ -213,12 +212,8 @@ void bochs_hw_setmode(struct bochs_device *bochs,
 	bochs->stride = mode->hdisplay * (bochs->bpp / 8);
 	bochs->yres_virtual = bochs->fb_size / bochs->stride;
 
-	DRM_DEBUG_DRIVER("%dx%d @ %d bpp, format %c%c%c%c, vy %d\n",
+	DRM_DEBUG_DRIVER("%dx%d @ %d bpp, vy %d\n",
 			 bochs->xres, bochs->yres, bochs->bpp,
-			 (format->format >>  0) & 0xff,
-			 (format->format >>  8) & 0xff,
-			 (format->format >> 16) & 0xff,
-			 (format->format >> 24) & 0xff,
 			 bochs->yres_virtual);
 
 	bochs_vga_writeb(bochs, 0x3c0, 0x20); /* unblank */
@@ -236,6 +231,16 @@ void bochs_hw_setmode(struct bochs_device *bochs,
 
 	bochs_dispi_write(bochs, VBE_DISPI_INDEX_ENABLE,
 			  VBE_DISPI_ENABLED | VBE_DISPI_LFB_ENABLED);
+}
+
+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,
+			 (format->format >>  8) & 0xff,
+			 (format->format >> 16) & 0xff,
+			 (format->format >> 24) & 0xff);
 
 	switch (format->format) {
 	case DRM_FORMAT_XRGB8888:
diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c
index c8ce54498d..f7e6d1a9b3 100644
--- a/drivers/gpu/drm/bochs/bochs_kms.c
+++ b/drivers/gpu/drm/bochs/bochs_kms.c
@@ -80,7 +80,8 @@ static int bochs_crtc_mode_set(struct drm_crtc *crtc,
 	if (WARN_ON(crtc->primary->fb == NULL))
 		return -EINVAL;
 
-	bochs_hw_setmode(bochs, mode, crtc->primary->fb->format);
+	bochs_hw_setmode(bochs, mode);
+	bochs_hw_setformat(bochs, crtc->primary->fb->format);
 	bochs_crtc_mode_set_base(crtc, x, y, old_fb);
 	return 0;
 }
-- 
2.9.3

  parent reply	other threads:[~2019-01-08 11:26 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-08 11:25 [PATCH v2 00/15] drm/bochs: cleanups, atomic modesetting, generic fbdev Gerd Hoffmann
2019-01-08 11:25 ` [PATCH v2 01/15] drm/bochs: encoder cleanup Gerd Hoffmann
2019-01-08 11:25 ` Gerd Hoffmann
2019-01-08 11:25   ` Gerd Hoffmann
2019-01-08 11:25 ` Gerd Hoffmann [this message]
2019-01-08 11:25   ` [PATCH v2 02/15] drm/bochs: split bochs_hw_setmode Gerd Hoffmann
2019-01-08 11:25 ` [PATCH v2 03/15] drm/bochs: atomic: add atomic_flush+atomic_enable callbacks Gerd Hoffmann
2019-01-08 11:25 ` Gerd Hoffmann
2019-01-08 11:25   ` Gerd Hoffmann
2019-01-09 10:06   ` Daniel Vetter
2019-01-09 10:06     ` Daniel Vetter
2019-01-09 10:06   ` Daniel Vetter
2019-01-08 11:25 ` [PATCH v2 04/15] drm/bochs: atomic: add mode_set_nofb callback Gerd Hoffmann
2019-01-08 11:25   ` Gerd Hoffmann
2019-01-08 11:25 ` Gerd Hoffmann
2019-01-08 11:25 ` [PATCH v2 05/15] drm/bochs: atomic: switch planes to atomic, wire up helpers Gerd Hoffmann
2019-01-08 11:25   ` Gerd Hoffmann
2019-01-08 11:25 ` Gerd Hoffmann
2019-01-08 11:25 ` [PATCH v2 06/15] drm/bochs: atomic: use atomic set_config helper Gerd Hoffmann
2019-01-08 11:25   ` Gerd Hoffmann
2019-01-08 11:25 ` [PATCH v2 07/15] drm/bochs: atomic: use atomic page_flip helper Gerd Hoffmann
2019-01-08 11:25   ` Gerd Hoffmann
2019-01-08 11:25 ` Gerd Hoffmann
2019-01-08 11:25 ` [PATCH v2 08/15] drm/bochs: atomic: set DRIVER_ATOMIC Gerd Hoffmann
2019-01-08 11:25   ` Gerd Hoffmann
2019-01-08 11:25 ` Gerd Hoffmann
2019-01-08 11:25 ` [PATCH v2 09/15] drm/bochs: remove old bochs_crtc_* functions Gerd Hoffmann
2019-01-08 11:25 ` Gerd Hoffmann
2019-01-08 11:25   ` Gerd Hoffmann
2019-01-08 11:25 ` [PATCH v2 10/15] drm/bochs: drop unused gpu_addr arg from bochs_bo_pin() Gerd Hoffmann
2019-01-08 11:25 ` Gerd Hoffmann
2019-01-08 11:25   ` Gerd Hoffmann
2019-01-08 11:25 ` [PATCH v2 11/15] drm/bochs: add basic prime support Gerd Hoffmann
2019-01-08 11:25   ` Gerd Hoffmann
2019-01-08 11:25 ` Gerd Hoffmann
2019-01-08 11:25 ` [PATCH v2 12/15] drm/bochs: switch to generic drm fbdev emulation Gerd Hoffmann
2019-01-08 11:25   ` Gerd Hoffmann
2019-01-08 11:25 ` Gerd Hoffmann
2019-01-08 11:25 ` [PATCH v2 13/15] drm/bochs: drop old fbdev emulation code Gerd Hoffmann
2019-01-08 11:25 ` Gerd Hoffmann
2019-01-08 11:25   ` Gerd Hoffmann
2019-01-08 11:25 ` [PATCH v2 14/15] drm/bochs: move remaining fb bits to kms Gerd Hoffmann
2019-01-08 11:25 ` Gerd Hoffmann
2019-01-08 11:25   ` Gerd Hoffmann
2019-01-08 11:25 ` [PATCH v2 15/15] drm/bochs: reserve bo for pin/unpin Gerd Hoffmann
2019-01-08 11:25 ` Gerd Hoffmann
2019-01-08 11:25   ` Gerd Hoffmann
2019-01-09 10:10   ` Daniel Vetter
2019-01-09 10:10     ` Daniel Vetter
2019-01-09 14:54     ` Gerd Hoffmann
2019-01-09 14:54     ` Gerd Hoffmann
2019-01-09 14:54       ` Gerd Hoffmann
2019-01-09 17:35       ` Daniel Vetter
2019-01-09 17:35       ` Daniel Vetter
2019-01-09 17:35         ` Daniel Vetter
2019-01-09 18:45         ` Alex Deucher
2019-01-09 18:45         ` Alex Deucher
2019-01-09 18:45           ` Alex Deucher
2019-01-09 20:51         ` Gerd Hoffmann
2019-01-09 20:51         ` Gerd Hoffmann
2019-01-09 20:51           ` Gerd Hoffmann
2019-01-09 21:45           ` Daniel Vetter
2019-01-09 21:45             ` Daniel Vetter
2019-01-09 21:45           ` Daniel Vetter
2019-01-09 10:10   ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190108112519.27473-3-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=airlied@linux.ie \
    --cc=airlied@redhat.com \
    --cc=andr2000@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.