/* Find the sequence block and size for the given panel. */
 static const u8 *
-find_panel_sequence_block(const struct bdb_mipi_sequence *sequence,
+find_panel_sequence_block(struct drm_i915_private *i915,
+                         const struct bdb_mipi_sequence *sequence,
                          u16 panel_id, u32 *seq_size)
 {
        u32 total = get_blocksize(sequence);
 
        for (i = 0; i < MAX_MIPI_CONFIGURATIONS && index < total; i++) {
                if (index + header_size > total) {
-                       DRM_ERROR("Invalid sequence block (header)\n");
+                       drm_err(&i915->drm, "Invalid sequence block (header)\n");
                        return NULL;
                }
 
                index += header_size;
 
                if (index + current_size > total) {
-                       DRM_ERROR("Invalid sequence block\n");
+                       drm_err(&i915->drm, "Invalid sequence block\n");
                        return NULL;
                }
 
                index += current_size;
        }
 
-       DRM_ERROR("Sequence block detected but no valid configuration\n");
+       drm_err(&i915->drm, "Sequence block detected but no valid configuration\n");
 
        return NULL;
 }
 
-static int goto_next_sequence(const u8 *data, int index, int total)
+static int goto_next_sequence(struct drm_i915_private *i915,
+                             const u8 *data, int index, int total)
 {
        u16 len;
 
                        len = *(data + index + 6) + 7;
                        break;
                default:
-                       DRM_ERROR("Unknown operation byte\n");
+                       drm_err(&i915->drm, "Unknown operation byte\n");
                        return 0;
                }
        }
        return 0;
 }
 
-static int goto_next_sequence_v3(const u8 *data, int index, int total)
+static int goto_next_sequence_v3(struct drm_i915_private *i915,
+                                const u8 *data, int index, int total)
 {
        int seq_end;
        u16 len;
         * checking on the structure.
         */
        if (total < 5) {
-               DRM_ERROR("Too small sequence size\n");
+               drm_err(&i915->drm, "Too small sequence size\n");
                return 0;
        }
 
 
        seq_end = index + size_of_sequence;
        if (seq_end > total) {
-               DRM_ERROR("Invalid sequence size\n");
+               drm_err(&i915->drm, "Invalid sequence size\n");
                return 0;
        }
 
 
                if (operation_byte == MIPI_SEQ_ELEM_END) {
                        if (index != seq_end) {
-                               DRM_ERROR("Invalid element structure\n");
+                               drm_err(&i915->drm, "Invalid element structure\n");
                                return 0;
                        }
                        return index;
                case MIPI_SEQ_ELEM_PMIC:
                        break;
                default:
-                       DRM_ERROR("Unknown operation byte %u\n",
-                                 operation_byte);
+                       drm_err(&i915->drm, "Unknown operation byte %u\n",
+                               operation_byte);
                        break;
                }
        }
        drm_dbg(&i915->drm, "Found MIPI sequence block v%u\n",
                sequence->version);
 
-       seq_data = find_panel_sequence_block(sequence, panel_type, &seq_size);
+       seq_data = find_panel_sequence_block(i915, sequence, panel_type, &seq_size);
        if (!seq_data)
                return;
 
                panel->vbt.dsi.sequence[seq_id] = data + index;
 
                if (sequence->version >= 3)
-                       index = goto_next_sequence_v3(data, index, seq_size);
+                       index = goto_next_sequence_v3(i915, data, index, seq_size);
                else
-                       index = goto_next_sequence(data, index, seq_size);
+                       index = goto_next_sequence(i915, data, index, seq_size);
                if (!index) {
                        drm_err(&i915->drm, "Invalid sequence %u\n",
                                seq_id);
        }
 }
 
-static u8 translate_iboost(u8 val)
+static u8 translate_iboost(struct drm_i915_private *i915, u8 val)
 {
        static const u8 mapping[] = { 1, 3, 7 }; /* See VBT spec */
 
        if (val >= ARRAY_SIZE(mapping)) {
-               DRM_DEBUG_KMS("Unsupported I_boost value found in VBT (%d), display may not work properly\n", val);
+               drm_dbg_kms(&i915->drm,
+                           "Unsupported I_boost value found in VBT (%d), display may not work properly\n", val);
                return 0;
        }
        return mapping[val];
 
 /**
  * intel_bios_is_valid_vbt - does the given buffer contain a valid VBT
+ * @i915:      the device
  * @buf:       pointer to a buffer to validate
  * @size:      size of the buffer
  *
  * Returns true on valid VBT.
  */
-bool intel_bios_is_valid_vbt(const void *buf, size_t size)
+bool intel_bios_is_valid_vbt(struct drm_i915_private *i915,
+                            const void *buf, size_t size)
 {
        const struct vbt_header *vbt = buf;
        const struct bdb_header *bdb;
                return false;
 
        if (sizeof(struct vbt_header) > size) {
-               DRM_DEBUG_KMS("VBT header incomplete\n");
+               drm_dbg_kms(&i915->drm, "VBT header incomplete\n");
                return false;
        }
 
        if (memcmp(vbt->signature, "$VBT", 4)) {
-               DRM_DEBUG_KMS("VBT invalid signature\n");
+               drm_dbg_kms(&i915->drm, "VBT invalid signature\n");
                return false;
        }
 
        if (vbt->vbt_size > size) {
-               DRM_DEBUG_KMS("VBT incomplete (vbt_size overflows)\n");
+               drm_dbg_kms(&i915->drm, "VBT incomplete (vbt_size overflows)\n");
                return false;
        }
 
                              vbt->bdb_offset,
                              sizeof(struct bdb_header),
                              size)) {
-               DRM_DEBUG_KMS("BDB header incomplete\n");
+               drm_dbg_kms(&i915->drm, "BDB header incomplete\n");
                return false;
        }
 
        bdb = get_bdb_header(vbt);
        if (range_overflows_t(size_t, vbt->bdb_offset, bdb->bdb_size, size)) {
-               DRM_DEBUG_KMS("BDB incomplete\n");
+               drm_dbg_kms(&i915->drm, "BDB incomplete\n");
                return false;
        }
 
        for (count = 0; count < vbt_size; count += 4)
                *(vbt + store++) = intel_spi_read(&i915->uncore, found + count);
 
-       if (!intel_bios_is_valid_vbt(vbt, vbt_size))
+       if (!intel_bios_is_valid_vbt(i915, vbt, vbt_size))
                goto err_free_vbt;
 
        drm_dbg_kms(&i915->drm, "Found valid VBT in SPI flash\n");
 
        memcpy_fromio(vbt, p, vbt_size);
 
-       if (!intel_bios_is_valid_vbt(vbt, vbt_size))
+       if (!intel_bios_is_valid_vbt(i915, vbt, vbt_size))
                goto err_free_vbt;
 
        pci_unmap_rom(pdev, oprom);
                     struct dsc_compression_parameters_entry *dsc,
                     int dsc_max_bpc)
 {
+       struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev);
        struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config;
        int bpc = 8;
 
        else if (dsc->support_8bpc && dsc_max_bpc >= 8)
                bpc = 8;
        else
-               DRM_DEBUG_KMS("VBT: Unsupported BPC %d for DCS\n",
-                             dsc_max_bpc);
+               drm_dbg_kms(&i915->drm, "VBT: Unsupported BPC %d for DCS\n",
+                           dsc_max_bpc);
 
        crtc_state->pipe_bpp = bpc * 3;
 
        } else {
                /* FIXME */
                if (!(dsc->slices_per_line & BIT(0)))
-                       DRM_DEBUG_KMS("VBT: Unsupported DSC slice count for DSI\n");
+                       drm_dbg_kms(&i915->drm, "VBT: Unsupported DSC slice count for DSI\n");
 
                crtc_state->dsc.slice_count = 1;
        }
 
        if (crtc_state->hw.adjusted_mode.crtc_hdisplay %
            crtc_state->dsc.slice_count != 0)
-               DRM_DEBUG_KMS("VBT: DSC hdisplay %d not divisible by slice count %d\n",
-                             crtc_state->hw.adjusted_mode.crtc_hdisplay,
-                             crtc_state->dsc.slice_count);
+               drm_dbg_kms(&i915->drm, "VBT: DSC hdisplay %d not divisible by slice count %d\n",
+                           crtc_state->hw.adjusted_mode.crtc_hdisplay,
+                           crtc_state->dsc.slice_count);
 
        /*
         * The VBT rc_buffer_block_size and rc_buffer_size definitions
        if (!devdata || devdata->i915->display.vbt.version < 196 || !devdata->child.iboost)
                return 0;
 
-       return translate_iboost(devdata->child.dp_iboost_level);
+       return translate_iboost(devdata->i915, devdata->child.dp_iboost_level);
 }
 
 int intel_bios_hdmi_boost_level(const struct intel_bios_encoder_data *devdata)
        if (!devdata || devdata->i915->display.vbt.version < 196 || !devdata->child.iboost)
                return 0;
 
-       return translate_iboost(devdata->child.hdmi_iboost_level);
+       return translate_iboost(devdata->i915, devdata->child.hdmi_iboost_level);
 }
 
 int intel_bios_hdmi_ddc_pin(const struct intel_bios_encoder_data *devdata)