]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
Merge tag 'drm/panel/for-4.6-rc1' of http://anongit.freedesktop.org/git/tegra/linux...
authorDave Airlie <airlied@redhat.com>
Wed, 16 Mar 2016 22:09:44 +0000 (08:09 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 16 Mar 2016 22:09:44 +0000 (08:09 +1000)
drm/panel: Changes for v4.6-rc1

This contains a refactoring of parts of the DSI core to allow creating
DSI devices from non-DSI control busses (i.e. I2C, SPI, ...).

Other than that there's support for a couple of new panels as well as
a few cleanup patches.

* tag 'drm/panel/for-4.6-rc1' of http://anongit.freedesktop.org/git/tegra/linux:
  drm/bridge: Make (pre/post) enable/disable callbacks optional
  drm/panel: simple: Add URT UMSH-8596MD-xT panels support
  dt-bindings: Add URT UMSH-8596MD-xT panel bindings
  of: Add United Radiant Technology Corporation vendor prefix
  drm/panel: simple: Support for LG lp120up1 panel
  dt-bindings: Add LG lp120up1 panel bindings
  drm/panel: simple: Fix g121x1_l03 hsync/vsync polarity
  drm/dsi: Get DSI host by DT device node
  drm/dsi: Add routine to unregister a DSI device
  drm/dsi: Try to match non-DT DSI devices
  drm/dsi: Use mipi_dsi_device_register_full() for DSI device creation
  drm/dsi: Check for CONFIG_OF when defining of_mipi_dsi_device_add()

1  2 
drivers/gpu/drm/panel/panel-simple.c
include/drm/drm_crtc.h

index 2164c999052cd58f78c040c8aa79ca252c2d4083,1d194c8581dc72f7889e308684f00c1b2fc458af..ceb20486dacf4edb314f16adc241140dba8164c5
@@@ -847,6 -847,7 +847,7 @@@ static const struct drm_display_mode in
        .vsync_end = 768 + 38 + 1,
        .vtotal = 768 + 38 + 1 + 0,
        .vrefresh = 60,
+       .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
  };
  
  static const struct panel_desc innolux_g121x1_l03 = {
@@@ -982,6 -983,29 +983,29 @@@ static const struct panel_desc lg_lb070
        .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
  };
  
+ static const struct drm_display_mode lg_lp120up1_mode = {
+       .clock = 162300,
+       .hdisplay = 1920,
+       .hsync_start = 1920 + 40,
+       .hsync_end = 1920 + 40 + 40,
+       .htotal = 1920 + 40 + 40+ 80,
+       .vdisplay = 1280,
+       .vsync_start = 1280 + 4,
+       .vsync_end = 1280 + 4 + 4,
+       .vtotal = 1280 + 4 + 4 + 12,
+       .vrefresh = 60,
+ };
+ static const struct panel_desc lg_lp120up1 = {
+       .modes = &lg_lp120up1_mode,
+       .num_modes = 1,
+       .bpc = 8,
+       .size = {
+               .width = 267,
+               .height = 183,
+       },
+ };
  static const struct drm_display_mode lg_lp129qe_mode = {
        .clock = 285250,
        .hdisplay = 2560,
@@@ -1016,7 -1040,6 +1040,7 @@@ static const struct drm_display_mode ne
        .vsync_end = 272 + 2 + 4,
        .vtotal = 272 + 2 + 4 + 2,
        .vrefresh = 74,
 +      .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
  };
  
  static const struct panel_desc nec_nl4827hc19_05b = {
@@@ -1177,6 -1200,42 +1201,42 @@@ static const struct panel_desc shelly_s
        .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
  };
  
+ static const struct display_timing urt_umsh_8596md_timing = {
+       .pixelclock = { 33260000, 33260000, 33260000 },
+       .hactive = { 800, 800, 800 },
+       .hfront_porch = { 41, 41, 41 },
+       .hback_porch = { 216 - 128, 216 - 128, 216 - 128 },
+       .hsync_len = { 71, 128, 128 },
+       .vactive = { 480, 480, 480 },
+       .vfront_porch = { 10, 10, 10 },
+       .vback_porch = { 35 - 2, 35 - 2, 35 - 2 },
+       .vsync_len = { 2, 2, 2 },
+       .flags = DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
+               DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
+ };
+ static const struct panel_desc urt_umsh_8596md_lvds = {
+       .timings = &urt_umsh_8596md_timing,
+       .num_timings = 1,
+       .bpc = 6,
+       .size = {
+               .width = 152,
+               .height = 91,
+       },
+       .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
+ };
+ static const struct panel_desc urt_umsh_8596md_parallel = {
+       .timings = &urt_umsh_8596md_timing,
+       .num_timings = 1,
+       .bpc = 6,
+       .size = {
+               .width = 152,
+               .height = 91,
+       },
+       .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
+ };
  static const struct of_device_id platform_of_match[] = {
        {
                .compatible = "ampire,am800480r3tmqwa1h",
        }, {
                .compatible = "lg,lb070wv8",
                .data = &lg_lb070wv8,
+       }, {
+               .compatible = "lg,lp120up1",
+               .data = &lg_lp120up1,
        }, {
                .compatible = "lg,lp129qe",
                .data = &lg_lp129qe,
        }, {
                .compatible = "shelly,sca07010-bfn-lnn",
                .data = &shelly_sca07010_bfn_lnn,
+       }, {
+               .compatible = "urt,umsh-8596md-t",
+               .data = &urt_umsh_8596md_parallel,
+       }, {
+               .compatible = "urt,umsh-8596md-1t",
+               .data = &urt_umsh_8596md_parallel,
+       }, {
+               .compatible = "urt,umsh-8596md-7t",
+               .data = &urt_umsh_8596md_parallel,
+       }, {
+               .compatible = "urt,umsh-8596md-11t",
+               .data = &urt_umsh_8596md_lvds,
+       }, {
+               .compatible = "urt,umsh-8596md-19t",
+               .data = &urt_umsh_8596md_lvds,
+       }, {
+               .compatible = "urt,umsh-8596md-20t",
+               .data = &urt_umsh_8596md_parallel,
        }, {
                /* sentinel */
        }
diff --combined include/drm/drm_crtc.h
index fb9672783fa7013489a69caac635ad79f7a0293c,f336671ca9324c3e61758844b9a0038b06226346..e0170bf80bb030356e85489d568bed959749320a
@@@ -305,20 -305,12 +305,20 @@@ struct drm_plane_helper_funcs
   * @mode_changed: crtc_state->mode or crtc_state->enable has been changed
   * @active_changed: crtc_state->active has been toggled.
   * @connectors_changed: connectors to this crtc have been updated
 + * @color_mgmt_changed: color management properties have changed (degamma or
 + *    gamma LUT or CSC matrix)
   * @plane_mask: bitmask of (1 << drm_plane_index(plane)) of attached planes
   * @connector_mask: bitmask of (1 << drm_connector_index(connector)) of attached connectors
 + * @encoder_mask: bitmask of (1 << drm_encoder_index(encoder)) of attached encoders
   * @last_vblank_count: for helpers and drivers to capture the vblank of the
   *    update to ensure framebuffer cleanup isn't done too early
   * @adjusted_mode: for use by helpers and drivers to compute adjusted mode timings
   * @mode: current mode timings
 + * @degamma_lut: Lookup table for converting framebuffer pixel data
 + *    before apply the conversion matrix
 + * @ctm: Transformation matrix
 + * @gamma_lut: Lookup table for converting pixel data after the
 + *    conversion matrix
   * @event: optional pointer to a DRM event to signal upon completion of the
   *    state update
   * @state: backpointer to global drm_atomic_state
@@@ -340,7 -332,6 +340,7 @@@ struct drm_crtc_state 
        bool mode_changed : 1;
        bool active_changed : 1;
        bool connectors_changed : 1;
 +      bool color_mgmt_changed : 1;
  
        /* attached planes bitmask:
         * WARNING: transitional helpers do not maintain plane_mask so
        u32 plane_mask;
  
        u32 connector_mask;
 +      u32 encoder_mask;
  
        /* last_vblank_count: for vblank waits before cleanup */
        u32 last_vblank_count;
        /* blob property to expose current mode to atomic userspace */
        struct drm_property_blob *mode_blob;
  
 +      /* blob property to expose color management to userspace */
 +      struct drm_property_blob *degamma_lut;
 +      struct drm_property_blob *ctm;
 +      struct drm_property_blob *gamma_lut;
 +
        struct drm_pending_vblank_event *event;
  
        struct drm_atomic_state *state;
@@@ -770,7 -755,7 +770,7 @@@ struct drm_crtc 
        int x, y;
        const struct drm_crtc_funcs *funcs;
  
 -      /* CRTC gamma size for reporting to userspace */
 +      /* Legacy FB CRTC gamma size for reporting to userspace */
        uint32_t gamma_size;
        uint16_t *gamma_store;
  
@@@ -1181,7 -1166,6 +1181,7 @@@ struct drm_connector 
        struct drm_mode_object base;
  
        char *name;
 +      int connector_id;
        int connector_type;
        int connector_type_id;
        bool interlace_allowed;
@@@ -1597,6 -1581,8 +1597,8 @@@ struct drm_bridge_funcs 
         *
         * The bridge can assume that the display pipe (i.e. clocks and timing
         * signals) feeding it is still running when this callback is called.
+        *
+        * The disable callback is optional.
         */
        void (*disable)(struct drm_bridge *bridge);
  
         * The bridge must assume that the display pipe (i.e. clocks and timing
         * singals) feeding it is no longer running when this callback is
         * called.
+        *
+        * The post_disable callback is optional.
         */
        void (*post_disable)(struct drm_bridge *bridge);
  
         * will not yet be running when this callback is called. The bridge must
         * not enable the display link feeding the next bridge in the chain (if
         * there is one) when this callback is called.
+        *
+        * The pre_enable callback is optional.
         */
        void (*pre_enable)(struct drm_bridge *bridge);
  
         * signals) feeding it is running when this callback is called. This
         * callback must enable the display link feeding the next bridge in the
         * chain if there is one.
+        *
+        * The enable callback is optional.
         */
        void (*enable)(struct drm_bridge *bridge);
  };
@@@ -1690,7 -1682,6 +1698,7 @@@ struct drm_bridge 
   * @dev: parent DRM device
   * @allow_modeset: allow full modeset
   * @legacy_cursor_update: hint to enforce legacy cursor IOCTL semantics
 + * @legacy_set_config: Disable conflicting encoders instead of failing with -EINVAL.
   * @planes: pointer to array of plane pointers
   * @plane_states: pointer to array of plane states pointers
   * @crtcs: pointer to array of CRTC pointers
@@@ -1704,7 -1695,6 +1712,7 @@@ struct drm_atomic_state 
        struct drm_device *dev;
        bool allow_modeset : 1;
        bool legacy_cursor_update : 1;
 +      bool legacy_set_config : 1;
        struct drm_plane **planes;
        struct drm_plane_state **plane_states;
        struct drm_crtc **crtcs;
@@@ -2041,15 -2031,6 +2049,15 @@@ struct drm_mode_config_funcs 
   * @property_blob_list: list of all the blob property objects
   * @blob_lock: mutex for blob property allocation and management
   * @*_property: core property tracking
 + * @degamma_lut_property: LUT used to convert the framebuffer's colors to linear
 + *    gamma
 + * @degamma_lut_size_property: size of the degamma LUT as supported by the
 + *    driver (read-only)
 + * @ctm_property: Matrix used to convert colors after the lookup in the
 + *    degamma LUT
 + * @gamma_lut_property: LUT used to convert the colors, after the CSC matrix, to
 + *    the gamma space of the connected screen (read-only)
 + * @gamma_lut_size_property: size of the gamma LUT as supported by the driver
   * @preferred_depth: preferred RBG pixel depth, used by fb helpers
   * @prefer_shadow: hint to userspace to prefer shadow-fb rendering
   * @async_page_flip: does this device support async flips on the primary plane?
@@@ -2074,7 -2055,6 +2082,7 @@@ struct drm_mode_config 
        struct list_head fb_list;
  
        int num_connector;
 +      struct ida connector_ida;
        struct list_head connector_list;
        int num_encoder;
        struct list_head encoder_list;
        struct drm_property *aspect_ratio_property;
        struct drm_property *dirty_info_property;
  
 +      /* Optional color correction properties */
 +      struct drm_property *degamma_lut_property;
 +      struct drm_property *degamma_lut_size_property;
 +      struct drm_property *ctm_property;
 +      struct drm_property *gamma_lut_property;
 +      struct drm_property *gamma_lut_size_property;
 +
        /* properties for virtual machine layout */
        struct drm_property *suggested_x_property;
        struct drm_property *suggested_y_property;
        list_for_each_entry((plane), &(dev)->mode_config.plane_list, head) \
                for_each_if ((plane_mask) & (1 << drm_plane_index(plane)))
  
 +/**
 + * drm_for_each_encoder_mask - iterate over encoders specified by bitmask
 + * @encoder: the loop cursor
 + * @dev: the DRM device
 + * @encoder_mask: bitmask of encoder indices
 + *
 + * Iterate over all encoders specified by bitmask.
 + */
 +#define drm_for_each_encoder_mask(encoder, dev, encoder_mask) \
 +      list_for_each_entry((encoder), &(dev)->mode_config.encoder_list, head) \
 +              for_each_if ((encoder_mask) & (1 << drm_encoder_index(encoder)))
  
  #define obj_to_crtc(x) container_of(x, struct drm_crtc, base)
  #define obj_to_connector(x) container_of(x, struct drm_connector, base)
@@@ -2246,11 -2208,7 +2254,11 @@@ int drm_connector_register(struct drm_c
  void drm_connector_unregister(struct drm_connector *connector);
  
  extern void drm_connector_cleanup(struct drm_connector *connector);
 -extern unsigned int drm_connector_index(struct drm_connector *connector);
 +static inline unsigned drm_connector_index(struct drm_connector *connector)
 +{
 +      return connector->connector_id;
 +}
 +
  /* helper to unplug all connectors from sysfs for device */
  extern void drm_connector_unplug_all(struct drm_device *dev);
  
@@@ -2275,7 -2233,6 +2283,7 @@@ int drm_encoder_init(struct drm_device 
                     struct drm_encoder *encoder,
                     const struct drm_encoder_funcs *funcs,
                     int encoder_type, const char *name, ...);
 +extern unsigned int drm_encoder_index(struct drm_encoder *encoder);
  
  /**
   * drm_encoder_crtc_ok - can a given crtc drive a given encoder?
@@@ -2333,8 -2290,6 +2341,8 @@@ extern void drm_property_destroy_user_b
  extern bool drm_probe_ddc(struct i2c_adapter *adapter);
  extern struct edid *drm_get_edid(struct drm_connector *connector,
                                 struct i2c_adapter *adapter);
 +extern struct edid *drm_get_edid_switcheroo(struct drm_connector *connector,
 +                                          struct i2c_adapter *adapter);
  extern struct edid *drm_edid_duplicate(const struct edid *edid);
  extern int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid);
  extern void drm_mode_config_init(struct drm_device *dev);
@@@ -2535,8 -2490,6 +2543,8 @@@ extern int drm_format_num_planes(uint32
  extern int drm_format_plane_cpp(uint32_t format, int plane);
  extern int drm_format_horz_chroma_subsampling(uint32_t format);
  extern int drm_format_vert_chroma_subsampling(uint32_t format);
 +extern int drm_format_plane_width(int width, uint32_t format, int plane);
 +extern int drm_format_plane_height(int height, uint32_t format, int plane);
  extern const char *drm_get_format_name(uint32_t format);
  extern struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev,
                                                              unsigned int supported_rotations);
@@@ -2585,21 -2538,6 +2593,21 @@@ static inline struct drm_property *drm_
        return mo ? obj_to_property(mo) : NULL;
  }
  
 +/*
 + * Extract a degamma/gamma LUT value provided by user and round it to the
 + * precision supported by the hardware.
 + */
 +static inline uint32_t drm_color_lut_extract(uint32_t user_input,
 +                                           uint32_t bit_precision)
 +{
 +      uint32_t val = user_input + (1 << (16 - bit_precision - 1));
 +      uint32_t max = 0xffff >> (16 - bit_precision);
 +
 +      val >>= 16 - bit_precision;
 +
 +      return clamp_val(val, 0, max);
 +}
 +
  /* Plane list iterator for legacy (overlay only) planes. */
  #define drm_for_each_legacy_plane(plane, dev) \
        list_for_each_entry(plane, &(dev)->mode_config.plane_list, head) \