<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 2014年11月19日 09:09, Mark yao wrote:<br>
    </div>
    <blockquote cite="mid:546BEDD9.1000205@rock-chips.com" type="cite">On
      2014年11月18日 22:24, Daniel Vetter wrote:
      <br>
      <blockquote type="cite">On Tue, Nov 18, 2014 at 02:21:30PM +0100,
        Boris Brezillon wrote:
        <br>
        <blockquote type="cite">Hi Daniel,
          <br>
          <br>
          On Tue, 18 Nov 2014 09:32:34 +0100
          <br>
          Daniel Vetter <a class="moz-txt-link-rfc2396E" href="mailto:daniel@ffwll.ch"><daniel@ffwll.ch></a> wrote:
          <br>
          <br>
          <blockquote type="cite">On Tue, Nov 18, 2014 at 04:00:29PM
            +0800, Mark Yao wrote:
            <br>
            <blockquote type="cite">From: Mark yao
              <a class="moz-txt-link-rfc2396E" href="mailto:mark.yao@rock-chips.com"><mark.yao@rock-chips.com></a>
              <br>
              <br>
              This patch adds the basic structure of a DRM Driver for
              Rockchip Socs.
              <br>
              <br>
              Signed-off-by: Mark Yao <a class="moz-txt-link-rfc2396E" href="mailto:mark.yao@rock-chips.com"><mark.yao@rock-chips.com></a>
              <br>
              Signed-off-by: Daniel Kurtz <a class="moz-txt-link-rfc2396E" href="mailto:djkurtz@chromium.org"><djkurtz@chromium.org></a>
              <br>
              Acked-by: Daniel Vetter <a class="moz-txt-link-rfc2396E" href="mailto:daniel@ffwll.ch"><daniel@ffwll.ch></a>
              <br>
              Reviewed-by: Rob Clark <a class="moz-txt-link-rfc2396E" href="mailto:robdclark@gmail.com"><robdclark@gmail.com></a>
              <br>
              ---
              <br>
              Changes in v2:
              <br>
              - use the component framework to defer main drm driver
              probe
              <br>
                 until all VOP devices have been probed.
              <br>
              - use dma-mapping API with ARM_DMA_USE_IOMMU, create dma
              mapping by
              <br>
                 master device and each vop device can shared the drm
              dma mapping.
              <br>
              - use drm_crtc_init_with_planes and
              drm_universal_plane_init.
              <br>
              - remove unnecessary middle layers.
              <br>
              - add cursor set, move funcs to rockchip drm crtc.
              <br>
              - use vop reset at first init
              <br>
              - reference framebuffer when used and unreference when
              swap out vop
              <br>
              <br>
              Changes in v3:
              <br>
              - change "crtc->fb" to "crtc->primary-fb"
              <br>
              Adviced by Daniel Vetter
              <br>
              - init cursor plane with universal api, remove unnecessary
              cursor set,move
              <br>
              <br>
              Changes in v4:
              <br>
              Adviced by David Herrmann
              <br>
              - remove drm_platform_*() usage, use register drm device
              directly.
              <br>
            </blockquote>
            Minor fixup for that part below.
            <br>
            <br>
            [snip]
            <br>
            <br>
            <blockquote type="cite">+static int rockchip_drm_bind(struct
              device *dev)
              <br>
              +{
              <br>
              +    struct drm_device *drm;
              <br>
              +    int ret;
              <br>
              +
              <br>
              +    drm = drm_dev_alloc(&rockchip_drm_driver, dev);
              <br>
              +    if (!drm)
              <br>
              +        return -ENOMEM;
              <br>
              +
              <br>
              +    ret = drm_dev_set_unique(drm, "%s", dev_name(dev));
              <br>
              +    if (ret)
              <br>
              +        goto err_free;
              <br>
            </blockquote>
            Please call rockchip_drm_load here directly and don't put it
            as the ->load
            <br>
            function into the driver vtable. The point of the
            alloc/register split is
            <br>
            that the driver can be completely set up _before_ we
            register anything.
            <br>
            But for backwards compat and historical reasons ->load is
            called somewhere
            <br>
            in the middle (so that you could access the minor nodes if
            needed, since
            <br>
            some drivers do that).
            <br>
          </blockquote>
          I tried to do the same in the atmel-hlcdc DRM driver, but I
          need the
          <br>
          primary drm_minor to register the connectors (see this kernel
          <br>
          backtrace [1]), which means I either initialize the connector
          in the
          <br>
          wrong place (currently part of the drm load process), or I
          just can't
          <br>
          call atmel_hlcdc_dc_load before registering the drm device...
          <br>
        </blockquote>
        Hm right, wonder who that works with rockchip tbh.
        <br>
        <br>
        We did split up the drm_connector setup into _init and register,
        so if you
        <br>
        want to do this then you need to move the call to
        drm_connector_register
        <br>
        below the call to drm_dev_register.
        <br>
        <br>
        We should probably have a drm_connectors_register_all helper
        which does
        <br>
        this for all connectors on the connector list. And also grabs
        the
        <br>
        appropriate lock.
        <br>
        <br>
        I guess it's somewhat obvious that no one yet actually tried
        this ;-)
        <br>
        -Daniel
        <br>
      </blockquote>
      right, I re-test the driver with it, get the same problem with
      Boris.
      <br>
      I should move drm_connector_register below the drm_dev_register.
      <br>
    </blockquote>
    I try move connector_register below drm_dev_register, but
    unfortunately<span style="color: rgb(51, 51, 51); font-family:
      arial; font-size: 18px; font-style: normal; font-variant: normal;
      font-weight: normal; letter-spacing: normal; line-height: 22px;
      orphans: auto; text-align: start; text-indent: 0px;
      text-transform: none; white-space: normal; widows: auto;
      word-spacing: 0px; -webkit-text-stroke-width: 0px;
      background-color: rgb(255, 255, 255); display: inline !important;
      float: none;">, </span>drm_dev_register call<br>
    drm_mode_group_init_legacy_group to save crtc, connector into list,
    it need below  connector_register.<br>
    so that problem is that now: connector_register need bewteen minor
    node create and<br>
    drm_mode_group_init_legacy_group.<br>
    I'm consider to revert the drm/rockchip v13.<br>
    <br>
  </body>
</html>