当前位置: 首页 > news >正文

免费解析网站域名批量查询注册

免费解析网站,域名批量查询注册,网线制作的心得体会,小型局域网组建方案接前一篇文章:DRM全解析 —— ADD_FB2(2) 本文参考以下博文: DRM驱动(四)之ADD_FB 特此致谢! 上一回围绕libdrm与DRM在Linux内核中的接口: DRM_IOCTL_DEF(DRM_IOCTL_MODE_ADDFB2,…

接前一篇文章:DRM全解析 —— ADD_FB2(2)

本文参考以下博文:

DRM驱动(四)之ADD_FB

特此致谢!

上一回围绕libdrm与DRM在Linux内核中的接口:

DRM_IOCTL_DEF(DRM_IOCTL_MODE_ADDFB2, drm_mode_addfb2_ioctl, 0),

进行了相关宏的展开。本文开始对于drm_mode_addfb2_ioctl函数进行详解。drm_mode_addfb2_ioctl函数在drivers/gpu/drm/drm_framebuffer.c中,代码如下:

int drm_mode_addfb2_ioctl(struct drm_device *dev,void *data, struct drm_file *file_priv)
{
#ifdef __BIG_ENDIANif (!dev->mode_config.quirk_addfb_prefer_host_byte_order) {/** Drivers must set the* quirk_addfb_prefer_host_byte_order quirk to make* the drm_mode_addfb() compat code work correctly on* bigendian machines.** If they don't they interpret pixel_format values* incorrectly for bug compatibility, which in turn* implies the ADDFB2 ioctl does not work correctly* then.  So block it to make userspace fallback to* ADDFB.*/drm_dbg_kms(dev, "addfb2 broken on bigendian");return -EOPNOTSUPP;}
#endifreturn drm_mode_addfb2(dev, data, file_priv);
}

drm_mode_addfb2_ioctl函数只是一层简单封装,实际的工作交给了drm_mode_addfb2函数。它就在上边,代码如下:

/*** drm_mode_addfb2 - add an FB to the graphics configuration* @dev: drm device for the ioctl* @data: data pointer for the ioctl* @file_priv: drm file for the ioctl call** Add a new FB to the specified CRTC, given a user request with format. This is* the 2nd version of the addfb ioctl, which supports multi-planar framebuffers* and uses fourcc codes as pixel format specifiers.** Called by the user via ioctl.** Returns:* Zero on success, negative errno on failure.*/
int drm_mode_addfb2(struct drm_device *dev,void *data, struct drm_file *file_priv)
{struct drm_mode_fb_cmd2 *r = data;struct drm_framebuffer *fb;if (!drm_core_check_feature(dev, DRIVER_MODESET))return -EOPNOTSUPP;fb = drm_internal_framebuffer_create(dev, r, file_priv);if (IS_ERR(fb))return PTR_ERR(fb);drm_dbg_kms(dev, "[FB:%d]\n", fb->base.id);r->fb_id = fb->base.id;/* Transfer ownership to the filp for reaping on close */mutex_lock(&file_priv->fbs_lock);list_add(&fb->filp_head, &file_priv->fbs);mutex_unlock(&file_priv->fbs_lock);return 0;
}

实际上前文DRM全解析 —— ADD_FB(2)中曾给出drm_mode_addfb函数的代码:

/*** drm_mode_addfb - add an FB to the graphics configuration* @dev: drm device for the ioctl* @or: pointer to request structure* @file_priv: drm file** Add a new FB to the specified CRTC, given a user request. This is the* original addfb ioctl which only supported RGB formats.** Called by the user via ioctl, or by an in-kernel client.** Returns:* Zero on success, negative errno on failure.*/
int drm_mode_addfb(struct drm_device *dev, struct drm_mode_fb_cmd *or,struct drm_file *file_priv)
{struct drm_mode_fb_cmd2 r = {};int ret;if (!drm_core_check_feature(dev, DRIVER_MODESET))return -EOPNOTSUPP;r.pixel_format = drm_driver_legacy_fb_format(dev, or->bpp, or->depth);if (r.pixel_format == DRM_FORMAT_INVALID) {drm_dbg_kms(dev, "bad {bpp:%d, depth:%d}\n", or->bpp, or->depth);return -EINVAL;}/* convert to new format and call new ioctl */r.fb_id = or->fb_id;r.width = or->width;r.height = or->height;r.pitches[0] = or->pitch;r.handles[0] = or->handle;ret = drm_mode_addfb2(dev, &r, file_priv);if (ret)return ret;or->fb_id = r.fb_id;return 0;
}

从这里就能看出,drm_mode_addfb()实际上也是调用了drm_mode_addfb2(),这俩本质上是一回事。只是drm_mode_addfb函数中多了一些预准备和预处理。

drm_mode_fb_cmd2结构在本系列第一篇文章中已经介绍过了,为了便于理解,再次给出其代码,在include/drm/drm_mode.h中,如下:

struct drm_mode_fb_cmd2 {__u32 fb_id;__u32 width;__u32 height;__u32 pixel_format; /* fourcc code from drm_fourcc.h */__u32 flags; /* see above flags *//** In case of planar formats, this ioctl allows up to 4* buffer objects with offsets and pitches per plane.* The pitch and offset order is dictated by the fourcc,* e.g. NV12 (https://fourcc.org/yuv.php#NV12) is described as:**   YUV 4:2:0 image with a plane of 8 bit Y samples*   followed by an interleaved U/V plane containing*   8 bit 2x2 subsampled colour difference samples.** So it would consist of Y as offsets[0] and UV as* offsets[1].  Note that offsets[0] will generally* be 0 (but this is not required).** To accommodate tiled, compressed, etc formats, a* modifier can be specified.  The default value of zero* indicates "native" format as specified by the fourcc.* Vendor specific modifier token.  Note that even though* it looks like we have a modifier per-plane, we in fact* do not. The modifier for each plane must be identical.* Thus all combinations of different data layouts for* multi plane formats must be enumerated as separate* modifiers.*/__u32 handles[4];__u32 pitches[4]; /* pitch for each plane */__u32 offsets[4]; /* offset of each plane */__u64 modifier[4]; /* ie, tiling, compress */
};

struct drm_framebuffer 当然是在include/drm/drm_framebuffer.h中定义,代码如下:

/*** struct drm_framebuffer - frame buffer object** Note that the fb is refcounted for the benefit of driver internals,* for example some hw, disabling a CRTC/plane is asynchronous, and* scanout does not actually complete until the next vblank.  So some* cleanup (like releasing the reference(s) on the backing GEM bo(s))* should be deferred.  In cases like this, the driver would like to* hold a ref to the fb even though it has already been removed from* userspace perspective. See drm_framebuffer_get() and* drm_framebuffer_put().** The refcount is stored inside the mode object @base.*/
struct drm_framebuffer {/*** @dev: DRM device this framebuffer belongs to*/struct drm_device *dev;/*** @head: Place on the &drm_mode_config.fb_list, access protected by* &drm_mode_config.fb_lock.*/struct list_head head;/*** @base: base modeset object structure, contains the reference count.*/struct drm_mode_object base;/*** @comm: Name of the process allocating the fb, used for fb dumping.*/char comm[TASK_COMM_LEN];/*** @format: framebuffer format information*/const struct drm_format_info *format;/*** @funcs: framebuffer vfunc table*/const struct drm_framebuffer_funcs *funcs;/*** @pitches: Line stride per buffer. For userspace created object this* is copied from drm_mode_fb_cmd2.*/unsigned int pitches[DRM_FORMAT_MAX_PLANES];/*** @offsets: Offset from buffer start to the actual pixel data in bytes,* per buffer. For userspace created object this is copied from* drm_mode_fb_cmd2.** Note that this is a linear offset and does not take into account* tiling or buffer layout per @modifier. It is meant to be used when* the actual pixel data for this framebuffer plane starts at an offset,* e.g. when multiple planes are allocated within the same backing* storage buffer object. For tiled layouts this generally means its* @offsets must at least be tile-size aligned, but hardware often has* stricter requirements.** This should not be used to specifiy x/y pixel offsets into the buffer* data (even for linear buffers). Specifying an x/y pixel offset is* instead done through the source rectangle in &struct drm_plane_state.*/unsigned int offsets[DRM_FORMAT_MAX_PLANES];/*** @modifier: Data layout modifier. This is used to describe* tiling, or also special layouts (like compression) of auxiliary* buffers. For userspace created object this is copied from* drm_mode_fb_cmd2.*/uint64_t modifier;/*** @width: Logical width of the visible area of the framebuffer, in* pixels.*/unsigned int width;/*** @height: Logical height of the visible area of the framebuffer, in* pixels.*/unsigned int height;/*** @flags: Framebuffer flags like DRM_MODE_FB_INTERLACED or* DRM_MODE_FB_MODIFIERS.*/int flags;/*** @hot_x: X coordinate of the cursor hotspot. Used by the legacy cursor* IOCTL when the driver supports cursor through a DRM_PLANE_TYPE_CURSOR* universal plane.*/int hot_x;/*** @hot_y: Y coordinate of the cursor hotspot. Used by the legacy cursor* IOCTL when the driver supports cursor through a DRM_PLANE_TYPE_CURSOR* universal plane.*/int hot_y;/*** @filp_head: Placed on &drm_file.fbs, protected by &drm_file.fbs_lock.*/struct list_head filp_head;/*** @obj: GEM objects backing the framebuffer, one per plane (optional).** This is used by the GEM framebuffer helpers, see e.g.* drm_gem_fb_create().*/struct drm_gem_object *obj[DRM_FORMAT_MAX_PLANES];
};

了解了相关的结构体定义之后,可以开始对于drm_mode_addfb2函数的正式解析了。请看下回。


文章转载自:
http://imperil.bwmq.cn
http://exilic.bwmq.cn
http://hierachical.bwmq.cn
http://send.bwmq.cn
http://vilnius.bwmq.cn
http://righteousness.bwmq.cn
http://republicanize.bwmq.cn
http://reincarnation.bwmq.cn
http://downhearted.bwmq.cn
http://autogyro.bwmq.cn
http://skinny.bwmq.cn
http://basan.bwmq.cn
http://epizootiology.bwmq.cn
http://galliardise.bwmq.cn
http://unspecified.bwmq.cn
http://niigata.bwmq.cn
http://trotsky.bwmq.cn
http://shut.bwmq.cn
http://chalcenteric.bwmq.cn
http://whereafter.bwmq.cn
http://ridgebeam.bwmq.cn
http://excrete.bwmq.cn
http://narwhal.bwmq.cn
http://levallois.bwmq.cn
http://roadable.bwmq.cn
http://unfastidious.bwmq.cn
http://xiphias.bwmq.cn
http://shammy.bwmq.cn
http://kilometre.bwmq.cn
http://ochlophobia.bwmq.cn
http://incorrupt.bwmq.cn
http://penthouse.bwmq.cn
http://skew.bwmq.cn
http://soakage.bwmq.cn
http://didst.bwmq.cn
http://eparch.bwmq.cn
http://ascidian.bwmq.cn
http://nigritude.bwmq.cn
http://sharkskin.bwmq.cn
http://hayrick.bwmq.cn
http://centricity.bwmq.cn
http://brachycephalous.bwmq.cn
http://seaware.bwmq.cn
http://colocynth.bwmq.cn
http://vasotonic.bwmq.cn
http://reductant.bwmq.cn
http://thioketone.bwmq.cn
http://homogamy.bwmq.cn
http://coward.bwmq.cn
http://tectum.bwmq.cn
http://battercake.bwmq.cn
http://cause.bwmq.cn
http://moviegoer.bwmq.cn
http://dauber.bwmq.cn
http://sukiyaki.bwmq.cn
http://madness.bwmq.cn
http://underproduce.bwmq.cn
http://objectless.bwmq.cn
http://sloping.bwmq.cn
http://insolate.bwmq.cn
http://hosta.bwmq.cn
http://amtract.bwmq.cn
http://scotticism.bwmq.cn
http://symbolatry.bwmq.cn
http://shakeable.bwmq.cn
http://roseau.bwmq.cn
http://libido.bwmq.cn
http://exostosis.bwmq.cn
http://speechify.bwmq.cn
http://laundryman.bwmq.cn
http://blessedly.bwmq.cn
http://nougatine.bwmq.cn
http://untimely.bwmq.cn
http://thea.bwmq.cn
http://odontophore.bwmq.cn
http://adnation.bwmq.cn
http://ochlophobia.bwmq.cn
http://multinomial.bwmq.cn
http://kinematically.bwmq.cn
http://interchange.bwmq.cn
http://expectability.bwmq.cn
http://whimper.bwmq.cn
http://bandmaster.bwmq.cn
http://nasute.bwmq.cn
http://trinitarian.bwmq.cn
http://pappoose.bwmq.cn
http://backbeat.bwmq.cn
http://harmaline.bwmq.cn
http://rhizopod.bwmq.cn
http://sned.bwmq.cn
http://nanofossil.bwmq.cn
http://davida.bwmq.cn
http://rifeness.bwmq.cn
http://caaba.bwmq.cn
http://soapbark.bwmq.cn
http://cassandra.bwmq.cn
http://homologize.bwmq.cn
http://etiquette.bwmq.cn
http://houselessness.bwmq.cn
http://anorexigenic.bwmq.cn
http://www.hrbkazy.com/news/64526.html

相关文章:

  • 微信 网站建设百度推广一年多少钱
  • 网站建设素材深圳网站搜索优化工具
  • 网站建设鞍山模板自助建站
  • 长宁网站建设百度一级代理商
  • 学校网站怎么做的好坏什么是广告营销
  • 备案期间关网站吗职业技能培训班
  • 杭州有哪些网站建设贵州seo技术查询
  • 江苏省住房保障建设厅网站安装百度到手机桌面
  • 创意网站设计模板电工培训学校
  • wordpress 免费企业主题seo工作流程
  • 深圳建网站哪个公司重庆百度快照优化
  • 深圳网站开发antnw市场营销模式有哪些
  • 代码运行框wordpress6济源新站seo关键词排名推广
  • 深圳做微信网站网站整站优化
  • 新的营销方式有哪些奇零seo赚钱培训
  • 网站个性化定制服务广告优化师怎么学
  • 微网站是自己做可以不网站友情链接自动上链
  • 网站管理系统是什么seo优化诊断工具
  • 做转运网站重庆森林为什么叫这个名字
  • 阜阳做网站公司推广普通话
  • 网站建设流程 知乎如何引流推广产品
  • 江苏百城建设有限公司官方网站宁德seo推广
  • 深圳罗湖的网站建设营销推广渠道有哪些
  • 雄县做网站的crm
  • 高明骏域网站建设seo建设招商
  • 外贸购物网站建设网站seo优化多少钱
  • 中文域名指向同一个网站交换免费连接
  • 池州网站建设费用网络营销的方式有哪些
  • www.ccb.com建设银行网站首页360手机优化大师下载
  • 西安做网站公司怎么样永久免费个人网站注册