Re: [PATCH v5 1/3] drm/rockchip: Add basic drm driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2014年09月25日 20:11, Mark yao wrote:
On 2014年09月25日 16:58, Mark yao wrote:
On 2014年09月25日 00:20, Daniel Kurtz wrote:
Hi Mark,

Please review comments inline...

On Wed, Sep 24, 2014 at 10:12 AM, Mark yao <mark.yao@xxxxxxxxxxxxxx> wrote:
To match the enum name, use ROCKCHIP_OUTPUT_TYPE_*.
Also, no need to explicitly set the first one to 0.
However, see below.  I don't think we to modify the drm_display_mode
to include an output type.
but vop devices need know the connector type, connector enable register is in vop.
can I do that like under to  get connector type for crtc?

    static int rockchip_get_connector_type(struct drm_crtc *crtc)
    {
          struct drm_device *dev = crtc->dev;
          struct drm_connector * connector;

          list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
          if (!connector->encoder)
                  continue;
          /*
           * one crtc only has one connector in my case, so just find the first connector at list.
           */
          if (connector->encoder->crtc == crtc)
                  break;
    }

    if (!connector)
            return -EINVAL;

    return connector->connector_type;
}
Oh, sorry, forgot to drop this comment,
for connector type problem, I try to new a help function for encoder to call as Daniel advices.
+#define to_rockchip_plane(x) container_of(x, struct rockchip_plane, base)
+
+struct rockchip_plane {
+       int id;
+       struct drm_plane base;
+       const struct vop_win *win;
+       struct vop_context *ctx;
Isn't ctx just: to_vop_ctx(base->crtc)

OK. we can use to_vop_ctx(base->crtc) to get ctx.
I have do a test to use "to_vop_ctx(base->crtc)", but found that "base->crtc" maybe not init.
for cursor plane, base->crtc always is NULL. and disable_plane will fail.
maybe we can add "base->crtc = crtc" at update_plane, but it seems not good.
so I think still use "rockchip_plane->ctx" would be better.

-Mark
I found that: plane->crtc will be set if update_plane success, and will be set NULL if disable_plane success.
so disable_plane must after update_plane.
disable_plane get crtc==NULL problem is that disable_plane was called before update_plane or been called  twice.
for this reason we can just check if crtc is NULL at disable_plane.

-Mark




_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux