is specified the output is disabled.
  
  You can additionally specify which output the options matches to.
 -To force the VGA output to be enabled and drive a specific mode say:
 +To force the VGA output to be enabled and drive a specific mode say::
 +
      video=VGA-1:1280x1024@60me
  
 -Specifying the option multiple times for different ports is possible, e.g.:
 +Specifying the option multiple times for different ports is possible, e.g.::
 +
      video=LVDS-1:d video=HDMI-1:D
  
 -Valid options are:
+ Options can also be passed after the mode, using commas as separator.
+ 
+        Sample usage: 720x480,rotate=180 - 720x480 mode, rotated by 180 degrees
+ 
 -***** oOo ***** oOo ***** oOo ***** oOo ***** oOo ***** oOo ***** oOo *****
++Valid options are::
+ 
+   - margin_top, margin_bottom, margin_left, margin_right (integer):
+     Number of pixels in the margins, typically to deal with overscan on TVs
+   - reflect_x (boolean): Perform an axial symmetry on the X axis
+   - reflect_y (boolean): Perform an axial symmetry on the Y axis
+   - rotate (integer): Rotate the initial framebuffer by x
+     degrees. Valid values are 0, 90, 180 and 270.
+ 
+ 
 +-----------------------------------------------------------------------------
  
  What is the VESA(TM) Coordinated Video Timings (CVT)?
 +=====================================================
  
  From the VESA(TM) Website:
  
 
  config DRM_AMDGPU_USERPTR
        bool "Always enable userptr write support"
        depends on DRM_AMDGPU
-       select MMU_NOTIFIER
 -      depends on ARCH_HAS_HMM
 -      select HMM_MIRROR
++      depends on HMM_MIRROR
        help
-         This option selects CONFIG_MMU_NOTIFIER if it isn't already
-         selected to enabled full userptr support.
+         This option selects CONFIG_HMM and CONFIG_HMM_MIRROR if it
+         isn't already selected to enabled full userptr support.
  
  config DRM_AMDGPU_GART_DEBUGFS
        bool "Allow GART access through debugfs"
 
        if (!mm) /* Happens during process shutdown */
                return -ESRCH;
  
-       if (!(gtt->userflags & AMDGPU_GEM_USERPTR_READONLY))
-               flags |= FOLL_WRITE;
+       if (unlikely(!mirror)) {
+               DRM_DEBUG_DRIVER("Failed to get hmm_mirror\n");
+               r = -EFAULT;
+               goto out;
+       }
  
-       down_read(&mm->mmap_sem);
+       vma = find_vma(mm, start);
+       if (unlikely(!vma || start < vma->vm_start)) {
+               r = -EFAULT;
+               goto out;
+       }
+       if (unlikely((gtt->userflags & AMDGPU_GEM_USERPTR_ANONONLY) &&
+               vma->vm_file)) {
+               r = -EPERM;
+               goto out;
+       }
  
-       if (gtt->userflags & AMDGPU_GEM_USERPTR_ANONONLY) {
-               /*
-                * check that we only use anonymous memory to prevent problems
-                * with writeback
-                */
-               unsigned long end = gtt->userptr + ttm->num_pages * PAGE_SIZE;
-               struct vm_area_struct *vma;
+       range = kzalloc(sizeof(*range), GFP_KERNEL);
+       if (unlikely(!range)) {
+               r = -ENOMEM;
+               goto out;
+       }
  
-               vma = find_vma(mm, gtt->userptr);
-               if (!vma || vma->vm_file || vma->vm_end < end) {
-                       up_read(&mm->mmap_sem);
-                       return -EPERM;
-               }
+       pfns = kvmalloc_array(ttm->num_pages, sizeof(*pfns), GFP_KERNEL);
+       if (unlikely(!pfns)) {
+               r = -ENOMEM;
+               goto out_free_ranges;
        }
  
-       /* loop enough times using contiguous pages of memory */
-       do {
-               unsigned num_pages = ttm->num_pages - pinned;
-               uint64_t userptr = gtt->userptr + pinned * PAGE_SIZE;
-               struct page **p = pages + pinned;
-               struct amdgpu_ttm_gup_task_list guptask;
+       amdgpu_hmm_init_range(range);
+       range->default_flags = range->flags[HMM_PFN_VALID];
+       range->default_flags |= amdgpu_ttm_tt_is_readonly(ttm) ?
+                               0 : range->flags[HMM_PFN_WRITE];
+       range->pfn_flags_mask = 0;
+       range->pfns = pfns;
 -      hmm_range_register(range, mm, start,
++      hmm_range_register(range, mirror, start,
+                          start + ttm->num_pages * PAGE_SIZE, PAGE_SHIFT);
  
-               guptask.task = current;
-               spin_lock(>t->guptasklock);
-               list_add(&guptask.list, >t->guptasks);
-               spin_unlock(>t->guptasklock);
+ retry:
+       /*
+        * Just wait for range to be valid, safe to ignore return value as we
+        * will use the return value of hmm_range_fault() below under the
+        * mmap_sem to ascertain the validity of the range.
+        */
+       hmm_range_wait_until_valid(range, HMM_RANGE_DEFAULT_TIMEOUT);
  
-               if (mm == current->mm)
-                       r = get_user_pages(userptr, num_pages, flags, p, NULL);
-               else
-                       r = get_user_pages_remote(gtt->usertask,
-                                       mm, userptr, num_pages,
-                                       flags, p, NULL, NULL);
+       down_read(&mm->mmap_sem);
  
-               spin_lock(>t->guptasklock);
-               list_del(&guptask.list);
-               spin_unlock(>t->guptasklock);
+       r = hmm_range_fault(range, true);
+       if (unlikely(r < 0)) {
+               if (likely(r == -EAGAIN)) {
+                       /*
+                        * return -EAGAIN, mmap_sem is dropped
+                        */
+                       if (retry++ < MAX_RETRY_HMM_RANGE_FAULT)
+                               goto retry;
+                       else
+                               pr_err("Retry hmm fault too many times\n");
+               }
  
-               if (r < 0)
-                       goto release_pages;
+               goto out_up_read;
+       }
  
-               pinned += r;
+       up_read(&mm->mmap_sem);
  
-       } while (pinned < ttm->num_pages);
+       for (i = 0; i < ttm->num_pages; i++) {
+               pages[i] = hmm_device_entry_to_page(range, pfns[i]);
+               if (unlikely(!pages[i])) {
+                       pr_err("Page fault failed for pfn[%lu] = 0x%llx\n",
+                              i, pfns[i]);
+                       r = -ENOMEM;
+ 
+                       goto out_free_pfns;
+               }
+       }
+ 
+       gtt->range = range;
  
-       up_read(&mm->mmap_sem);
        return 0;
  
- release_pages:
-       release_pages(pages, pinned);
-       up_read(&mm->mmap_sem);
+ out_up_read:
+       if (likely(r != -EAGAIN))
+               up_read(&mm->mmap_sem);
+ out_free_pfns:
+       hmm_range_unregister(range);
+       kvfree(pfns);
+ out_free_ranges:
+       kfree(range);
+ out:
        return r;
  }
  
 
   * Copyright (c) 2014 Samsung Electronics Co., Ltd
   *
   * Contacts: Andrzej Hajda <a.hajda@samsung.com>
 - *
 - * This program is free software; you can redistribute it and/or modify
 - * it under the terms of the GNU General Public License version 2 as
 - * published by the Free Software Foundation.
  */
  
- #include <drm/drmP.h>
+ #include <linux/of_graph.h>
+ #include <linux/regulator/consumer.h>
+ 
  #include <drm/drm_atomic_helper.h>
  #include <drm/drm_panel.h>
+ #include <drm/drm_print.h>
  #include <drm/drm_probe_helper.h>
  
- #include <linux/of_graph.h>
- #include <linux/regulator/consumer.h>
- 
  #include <video/of_videomode.h>
  #include <video/videomode.h>
  
 
   * Copyright (c) 2014 Samsung Electronics Co., Ltd
   *
   * Contacts: Tomasz Figa <t.figa@samsung.com>
 - *
 - * This program is free software; you can redistribute it and/or modify
 - * it under the terms of the GNU General Public License version 2 as
 - * published by the Free Software Foundation.
  */
  
- #include <asm/unaligned.h>
- 
- #include <drm/drmP.h>
- #include <drm/drm_atomic_helper.h>
- #include <drm/drm_fb_helper.h>
- #include <drm/drm_mipi_dsi.h>
- #include <drm/drm_panel.h>
- #include <drm/drm_probe_helper.h>
- 
  #include <linux/clk.h>
+ #include <linux/delay.h>
+ #include <linux/component.h>
  #include <linux/gpio/consumer.h>
  #include <linux/irq.h>
  #include <linux/of_device.h>
 
  # Copyright Â© 2019 Intel Corporation
  
  # Test the headers are compilable as standalone units
 -header_test := \
 +header-test-$(CONFIG_DRM_I915_WERROR) := \
        i915_active_types.h \
-       i915_gem_context_types.h \
+       i915_debugfs.h \
+       i915_drv.h \
+       i915_irq.h \
+       i915_params.h \
        i915_priolist_types.h \
+       i915_reg.h \
        i915_scheduler_types.h \
        i915_timeline_types.h \
-       intel_atomic_plane.h \
-       intel_audio.h \
-       intel_cdclk.h \
-       intel_color.h \
-       intel_connector.h \
-       intel_context_types.h \
-       intel_crt.h \
+       i915_utils.h \
        intel_csr.h \
-       intel_ddi.h \
-       intel_dp.h \
-       intel_dvo.h \
-       intel_engine_types.h \
-       intel_fbc.h \
-       intel_fbdev.h \
-       intel_frontbuffer.h \
-       intel_hdcp.h \
-       intel_hdmi.h \
-       intel_lspcon.h \
-       intel_lvds.h \
-       intel_panel.h \
-       intel_pipe_crc.h \
+       intel_drv.h \
        intel_pm.h \
-       intel_psr.h \
-       intel_sdvo.h \
-       intel_sprite.h \
-       intel_tv.h \
-       intel_workarounds_types.h
+       intel_runtime_pm.h \
+       intel_sideband.h \
+       intel_uncore.h \
+       intel_wakeref.h
 -
 -quiet_cmd_header_test = HDRTEST $@
 -      cmd_header_test = echo "\#include \"$(<F)\"" > $@
 -
 -header_test_%.c: %.h
 -      $(call cmd,header_test)
 -
 -i915-$(CONFIG_DRM_I915_WERROR) += $(foreach h,$(header_test),$(patsubst %.h,header_test_%.o,$(h)))
 -
 -clean-files += $(foreach h,$(header_test),$(patsubst %.h,header_test_%.c,$(h)))
 
  /*
   * Copyright (C) 2013 Red Hat
   * Author: Rob Clark <robdclark@gmail.com>
 - *
 - * This program is free software; you can redistribute it and/or modify it
 - * under the terms of the GNU General Public License version 2 as published by
 - * the Free Software Foundation.
 - *
 - * This program is distributed in the hope that it will be useful, but WITHOUT
 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 - * more details.
 - *
 - * You should have received a copy of the GNU General Public License along with
 - * this program.  If not, see <http://www.gnu.org/licenses/>.
   */
  
+ #include <drm/drm_damage_helper.h>
  #include "mdp4_kms.h"
  
  #define DOWN_SCALE_MAX        8
 
   * Copyright (c) 2014, The Linux Foundation. All rights reserved.
   * Copyright (C) 2013 Red Hat
   * Author: Rob Clark <robdclark@gmail.com>
 - *
 - * This program is free software; you can redistribute it and/or modify it
 - * under the terms of the GNU General Public License version 2 as published by
 - * the Free Software Foundation.
 - *
 - * This program is distributed in the hope that it will be useful, but WITHOUT
 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 - * more details.
 - *
 - * You should have received a copy of the GNU General Public License along with
 - * this program.  If not, see <http://www.gnu.org/licenses/>.
   */
  
+ #include <linux/interconnect.h>
  #include <linux/of_irq.h>
  
  #include "msm_drv.h"
 
   * Copyright (C) 2014-2015 The Linux Foundation. All rights reserved.
   * Copyright (C) 2013 Red Hat
   * Author: Rob Clark <robdclark@gmail.com>
 - *
 - * This program is free software; you can redistribute it and/or modify it
 - * under the terms of the GNU General Public License version 2 as published by
 - * the Free Software Foundation.
 - *
 - * This program is distributed in the hope that it will be useful, but WITHOUT
 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 - * more details.
 - *
 - * You should have received a copy of the GNU General Public License along with
 - * this program.  If not, see <http://www.gnu.org/licenses/>.
   */
  
+ #include <drm/drm_damage_helper.h>
  #include <drm/drm_print.h>
  #include "mdp5_kms.h"
  
 
   *
   * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org>
   * Derived from drivers/drm/gpu/panel/panel-samsung-ld9040.c
 - *
 - * This program is free software; you can redistribute it and/or modify
 - * it under the terms of the GNU General Public License version 2 as
 - * published by the Free Software Foundation.
   */
  
- #include <drm/drmP.h>
- #include <drm/drm_panel.h>
- 
- #include <linux/of_device.h>
  #include <linux/bitops.h>
  #include <linux/gpio/consumer.h>
  #include <linux/module.h>
 
   * From internet archives, the panel for Nexus 7 2nd Gen, 2013 model is a
   * JDI model LT070ME05000, and its data sheet is at:
   * http://panelone.net/en/7-0-inch/JDI_LT070ME05000_7.0_inch-datasheet
 - *
 - * This program is free software; you can redistribute it and/or modify it
 - * under the terms of the GNU General Public License version 2 as published by
 - * the Free Software Foundation.
 - *
 - * This program is distributed in the hope that it will be useful, but WITHOUT
 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 - * more details.
 - *
 - * You should have received a copy of the GNU General Public License along with
 - * this program.  If not, see <http://www.gnu.org/licenses/>.
   */
+ 
  #include <linux/backlight.h>
+ #include <linux/delay.h>
  #include <linux/gpio/consumer.h>
  #include <linux/module.h>
  #include <linux/of.h>
 
   * Derived from drivers/video/backlight/ld9040.c
   *
   * Andrzej Hajda <a.hajda@samsung.com>
 - *
 - * This program is free software; you can redistribute it and/or modify
 - * it under the terms of the GNU General Public License version 2 as
 - * published by the Free Software Foundation.
  */
  
- #include <drm/drmP.h>
- #include <drm/drm_panel.h>
- 
+ #include <linux/delay.h>
  #include <linux/gpio/consumer.h>
+ #include <linux/module.h>
  #include <linux/regulator/consumer.h>
  #include <linux/spi/spi.h>
  
 
   * Derived from drivers/video/backlight/ld9040.c
   *
   * Andrzej Hajda <a.hajda@samsung.com>
 - *
 - * This program is free software; you can redistribute it and/or modify
 - * it under the terms of the GNU General Public License version 2 as
 - * published by the Free Software Foundation.
  */
  
- #include <drm/drmP.h>
- #include <drm/drm_panel.h>
- 
+ #include <linux/delay.h>
  #include <linux/gpio/consumer.h>
+ #include <linux/module.h>
+ #include <linux/of.h>
  #include <linux/regulator/consumer.h>
  #include <linux/spi/spi.h>
  
 
   * Donghwa Lee <dh09.lee@samsung.com>
   * Hyungwon Hwang <human.hwang@samsung.com>
   * Hoegeun Kwon <hoegeun.kwon@samsung.com>
 - *
 - * This program is free software; you can redistribute it and/or modify
 - * it under the terms of the GNU General Public License version 2 as
 - * published by the Free Software Foundation.
   */
  
- #include <drm/drmP.h>
- #include <drm/drm_mipi_dsi.h>
- #include <drm/drm_panel.h>
  #include <linux/backlight.h>
+ #include <linux/delay.h>
  #include <linux/gpio/consumer.h>
+ #include <linux/module.h>
  #include <linux/of_device.h>
  #include <linux/regulator/consumer.h>
  
 
   *
   * Inki Dae <inki.dae@samsung.com>
   * Hoegeun Kwon <hoegeun.kwon@samsung.com>
 - *
 - * This program is free software; you can redistribute it and/or modify
 - * it under the terms of the GNU General Public License version 2 as
 - * published by the Free Software Foundation.
   */
  
- #include <drm/drmP.h>
- #include <drm/drm_mipi_dsi.h>
- #include <drm/drm_panel.h>
  #include <linux/backlight.h>
+ #include <linux/delay.h>
  #include <linux/gpio/consumer.h>
+ #include <linux/module.h>
  #include <linux/regulator/consumer.h>
+ 
  #include <video/mipi_display.h>
  
+ #include <drm/drm_mipi_dsi.h>
+ #include <drm/drm_modes.h>
+ #include <drm/drm_panel.h>
+ #include <drm/drm_print.h>
+ 
  #define MCS_LEVEL2_KEY                0xf0
  #define MCS_MTP_KEY           0xf1
  #define MCS_MTP_SET3          0xd4
 
   * Eunchul Kim <chulspro.kim@samsung.com>
   * Tomasz Figa <t.figa@samsung.com>
   * Andrzej Hajda <a.hajda@samsung.com>
 - *
 - * This program is free software; you can redistribute it and/or modify
 - * it under the terms of the GNU General Public License version 2 as
 - * published by the Free Software Foundation.
  */
  
- #include <drm/drmP.h>
- #include <drm/drm_mipi_dsi.h>
- #include <drm/drm_panel.h>
- 
+ #include <linux/delay.h>
  #include <linux/gpio/consumer.h>
+ #include <linux/module.h>
+ #include <linux/of.h>
  #include <linux/regulator/consumer.h>
  
  #include <video/mipi_display.h>
 
 +// SPDX-License-Identifier: GPL-2.0-only
  /*
   * Copyright (C) 2017 Free Electrons
 - *
 - * This program is free software; you can redistribute it and/or
 - * modify it under the terms of the GNU General Public License version
 - * 2 as published by the Free Software Foundation.
   */
  
+ #include <linux/backlight.h>
+ #include <linux/delay.h>
  #include <linux/gpio/consumer.h>
+ #include <linux/module.h>
  #include <linux/regulator/consumer.h>
  #include <linux/spi/spi.h>
  
 
        incc = priv->cc[PRPENCVF_SINK_PAD];
        outcc = vdev->cc;
  
 -      ret = imx_media_alloc_dma_buf(priv->md, &priv->rot_buf[0],
+       ret = ipu_ic_calc_csc(&csc,
+                             infmt->ycbcr_enc, infmt->quantization,
+                             incc->cs,
+                             outfmt->ycbcr_enc, outfmt->quantization,
+                             outcc->cs);
+       if (ret) {
+               v4l2_err(&ic_priv->sd, "ipu_ic_calc_csc failed, %d\n",
+                        ret);
+               return ret;
+       }
+ 
 +      ret = imx_media_alloc_dma_buf(ic_priv->ipu_dev, &priv->rot_buf[0],
                                      outfmt->sizeimage);
        if (ret) {
                v4l2_err(&ic_priv->sd, "failed to alloc rot_buf[0], %d\n", ret);
 
                        tryfmt->ycbcr_enc =
                                V4L2_MAP_YCBCR_ENC_DEFAULT(tryfmt->colorspace);
                }
-               if (tryfmt->quantization == V4L2_QUANTIZATION_DEFAULT) {
-                       tryfmt->quantization =
-                               V4L2_MAP_QUANTIZATION_DEFAULT(
-                                       is_rgb, tryfmt->colorspace,
-                                       tryfmt->ycbcr_enc);
-               }
        }
  
-       if (ic_route) {
-               tryfmt->quantization = is_rgb ?
-                       V4L2_QUANTIZATION_FULL_RANGE :
-                       V4L2_QUANTIZATION_LIM_RANGE;
-               tryfmt->ycbcr_enc = V4L2_YCBCR_ENC_601;
-       }
+       if (tryfmt->quantization == V4L2_QUANTIZATION_DEFAULT)
+               tryfmt->quantization =
+                       V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb,
+                                                     tryfmt->colorspace,
+                                                     tryfmt->ycbcr_enc);
  }
- EXPORT_SYMBOL_GPL(imx_media_fill_default_mbus_fields);
+ EXPORT_SYMBOL_GPL(imx_media_try_colorimetry);
  
  int imx_media_mbus_fmt_to_pix_fmt(struct v4l2_pix_format *pix,
 -                                struct v4l2_rect *compose,
 -                                const struct v4l2_mbus_framefmt *mbus,
 +                                struct v4l2_mbus_framefmt *mbus,
                                  const struct imx_media_pixfmt *cc)
  {
        u32 width;
 
                            const struct imx_media_pixfmt **cc);
  int imx_media_init_cfg(struct v4l2_subdev *sd,
                       struct v4l2_subdev_pad_config *cfg);
- void imx_media_fill_default_mbus_fields(struct v4l2_mbus_framefmt *tryfmt,
-                                       struct v4l2_mbus_framefmt *fmt,
-                                       bool ic_route);
+ void imx_media_try_colorimetry(struct v4l2_mbus_framefmt *tryfmt,
+                              bool ic_route);
  int imx_media_mbus_fmt_to_pix_fmt(struct v4l2_pix_format *pix,
 -                                struct v4l2_rect *compose,
 -                                const struct v4l2_mbus_framefmt *mbus,
 +                                struct v4l2_mbus_framefmt *mbus,
                                  const struct imx_media_pixfmt *cc);
  int imx_media_mbus_fmt_to_ipu_image(struct ipu_image *image,
                                    struct v4l2_mbus_framefmt *mbus);
 
                break;
        default:
                return -EINVAL;
 -              break;
        }
+ 
+       imx_media_try_colorimetry(&sdformat->format, false);
+ 
        return 0;
  }