[Openchrome-devel] drm-openchrome: Branch 'drm-next-4.13' - 2 commits - drivers/gpu/drm

Kevin Brace kevinbrace at kemper.freedesktop.org
Sat Aug 5 00:28:28 UTC 2017


 drivers/gpu/drm/openchrome/via_crtc.c |   28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

New commits:
commit 071193383bca5c606ca65017e257f78c0f8edd6d
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Aug 4 17:27:56 2017 -0700

    Code change to handle depth member elimination
    
    depth member was eliminated from drm_framebuffer struct.
    Commit b00c600e91531df00aaa551049382416c4db745d made this change,
    so our side needs to change as well.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/drivers/gpu/drm/openchrome/via_crtc.c b/drivers/gpu/drm/openchrome/via_crtc.c
index 800131fe3a33..0dec4bb564f5 100644
--- a/drivers/gpu/drm/openchrome/via_crtc.c
+++ b/drivers/gpu/drm/openchrome/via_crtc.c
@@ -1290,9 +1290,9 @@ via_iga1_mode_set_base_atomic(struct drm_crtc *crtc,
     struct drm_gem_object *obj = fb->helper_private;
     struct ttm_buffer_object *bo = ttm_gem_mapping(obj);
 
-    if ((fb->depth != 8) && (fb->depth != 16) && (fb->depth != 24)
-            && (fb->depth != 32)) {
-        DRM_ERROR("Unsupported IGA1 Color Depth: %d bit\n", fb->depth);
+    if ((fb->format->depth != 8) && (fb->format->depth != 16) &&
+		(fb->format->depth != 24) && (fb->format->depth != 32)) {
+        DRM_ERROR("Unsupported IGA1 Color Depth: %d bit\n", fb->format->depth);
         return -EINVAL;
     }
 
@@ -1301,7 +1301,7 @@ via_iga1_mode_set_base_atomic(struct drm_crtc *crtc,
     /* Set palette LUT to 8-bit mode. */
     via_iga1_set_palette_lut_resolution(VGABASE, true);
 
-    via_iga1_set_color_depth(dev_priv, fb->depth);
+    via_iga1_set_color_depth(dev_priv, fb->format->depth);
 
     /* Set the framebuffer offset */
     addr = round_up(bo->offset + pitch, 16) >> 1;
@@ -1603,9 +1603,9 @@ via_iga2_mode_set_base_atomic(struct drm_crtc *crtc,
     struct drm_gem_object *obj = fb->helper_private;
     struct ttm_buffer_object *bo = ttm_gem_mapping(obj);
 
-    if ((fb->depth != 8) && (fb->depth != 16)
-            && (fb->depth != 24) && (fb->depth != 32)) {
-        DRM_ERROR("Unsupported IGA2 Color Depth: %d bit\n", fb->depth);
+    if ((fb->format->depth != 8) && (fb->format->depth != 16) &&
+		(fb->format->depth != 24) && (fb->format->depth != 32)) {
+        DRM_ERROR("Unsupported IGA2 Color Depth: %d bit\n", fb->format->depth);
         return -EINVAL;
     }
 
@@ -1614,7 +1614,7 @@ via_iga2_mode_set_base_atomic(struct drm_crtc *crtc,
     /* Set palette LUT to 8-bit mode. */
     via_iga2_set_palette_lut_resolution(VGABASE, true);
 
-    via_iga2_set_color_depth(dev_priv, fb->depth);
+    via_iga2_set_color_depth(dev_priv, fb->format->depth);
 
     /* Set the framebuffer offset */
     addr = round_up(bo->offset + pitch, 16);
commit 60d7d137fad75b72818a5f03456a767e8c67517d
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Aug 4 17:19:11 2017 -0700

    Code change to handle bits_per_pixel member elimination
    
    bits_per_pixel member was eliminated from drm_framebuffer struct.
    Commit 272725c7db4da1fd3229d944fc76d2e98e3a144e made this change,
    so our side needs to change as well.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/drivers/gpu/drm/openchrome/via_crtc.c b/drivers/gpu/drm/openchrome/via_crtc.c
index 1fb5c7bd9d35..800131fe3a33 100644
--- a/drivers/gpu/drm/openchrome/via_crtc.c
+++ b/drivers/gpu/drm/openchrome/via_crtc.c
@@ -317,7 +317,7 @@ via_iga1_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
     if (!crtc->enabled || !crtc->primary->fb)
         return;
 
-    if (crtc->primary->fb->bits_per_pixel == 8) {
+    if (crtc->primary->fb->format->cpp[0] * 8 == 8) {
         /* Prepare for initialize IGA1's LUT: */
         vga_wseq(VGABASE, 0x1A, sr1a & 0xFE);
         /* Change to Primary Display's LUT */
@@ -370,7 +370,7 @@ via_iga2_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
     if (!crtc->enabled || !crtc->primary->fb)
         return;
 
-    if (crtc->primary->fb->bits_per_pixel == 8) {
+    if (crtc->primary->fb->format->cpp[0] * 8 == 8) {
         /* Change Shadow to Secondary Display's LUT */
         svga_wseq_mask(VGABASE, 0x1A, BIT(0), BIT(0));
         /* Enable Secondary Display Engine */
@@ -1284,7 +1284,7 @@ via_iga1_mode_set_base_atomic(struct drm_crtc *crtc,
                                 struct drm_framebuffer *fb, int x, int y,
                                 enum mode_set_atomic state)
 {
-    u32 pitch = y * fb->pitches[0] + ((x * fb->bits_per_pixel) >> 3), addr;
+    u32 pitch = y * fb->pitches[0] + ((x * fb->format->cpp[0] * 8) >> 3), addr;
     struct via_crtc *iga = container_of(crtc, struct via_crtc, base);
     struct via_device *dev_priv = crtc->dev->dev_private;
     struct drm_gem_object *obj = fb->helper_private;
@@ -1312,7 +1312,7 @@ via_iga1_mode_set_base_atomic(struct drm_crtc *crtc,
     vga_wcrt(VGABASE, 0x34, (addr >> 16) & 0xFF);
 
     /* Load fetch count registers */
-    pitch = ALIGN(crtc->mode.hdisplay * fb->bits_per_pixel >> 3, 16);
+    pitch = ALIGN(crtc->mode.hdisplay * (fb->format->cpp[0] * 8) >> 3, 16);
     load_value_to_registers(VGABASE, &iga->fetch, (pitch >> 4) + 1);
 
     /* Set the primary pitch */
@@ -1597,7 +1597,7 @@ via_iga2_mode_set_base_atomic(struct drm_crtc *crtc,
                                 struct drm_framebuffer *fb,
                                 int x, int y, enum mode_set_atomic state)
 {
-    u32 pitch = y * fb->pitches[0] + ((x * fb->bits_per_pixel) >> 3), addr;
+    u32 pitch = y * fb->pitches[0] + ((x * fb->format->cpp[0] * 8) >> 3), addr;
     struct via_crtc *iga = container_of(crtc, struct via_crtc, base);
     struct via_device *dev_priv = crtc->dev->dev_private;
     struct drm_gem_object *obj = fb->helper_private;
@@ -1627,7 +1627,7 @@ via_iga2_mode_set_base_atomic(struct drm_crtc *crtc,
     svga_wcrt_mask(VGABASE, 0xA3, ((addr >> 26) & 0x07), 0x07);
 
     /* Load fetch count registers */
-    pitch = ALIGN(crtc->mode.hdisplay * fb->bits_per_pixel >> 3, 16);
+    pitch = ALIGN(crtc->mode.hdisplay * (fb->format->cpp[0] * 8) >> 3, 16);
     load_value_to_registers(VGABASE, &iga->fetch, (pitch >> 4) + 1);
 
     /* Set secondary pitch */


More information about the Openchrome-devel mailing list