summaryrefslogtreecommitdiff
path: root/include/linux
AgeCommit message (Expand)Author
2021-03-03include: linux: Update Linux headers to v5.12-rc1Laurent Pinchart
2021-02-09uapi: raspberrypi: Update the bcm2835-isp header definitionNaushir Patuck
2021-02-05include: linux: Add ipu3 kernel header and format definitionsNiklas Söderlund
2020-10-19include: linux: Update V4L2_CID_USER_BCM2835_ISP_BASE to match upstream treeNaushir Patuck
2020-09-29include: linux: Update rkisp1 headerNiklas Söderlund
2020-07-27include: drm_fourcc: Add 16-bit Bayer FourCCNiklas Söderlund
2020-07-17libcamera: pipeline: ipa: raspberrypi: Use dma heap allocs for LS tablesNaushir Patuck
2020-07-17include: linux: Add dma-buf.h and dma-heap.h UAPI headersNaushir Patuck
2020-06-18include: linux: Remove drm.h and drm_mode.hLaurent Pinchart
2020-06-09libcamera: Add missing SPDX headers to miscellaneous small filesLaurent Pinchart
2020-05-21include: linux: Update v4l2 ctrls for propertiesJacopo Mondi
2020-05-11include: uapi: Add header definitions for BCM2835 Unicam and ISP blocksNaushir Patuck
2020-05-10include: linux: Extend VIDIOC_ENUM_FMT to support MC-centric devicesLaurent Pinchart
2020-03-27include: drm_fourcc: Add Bayer FourCC and modifiersNiklas Söderlund
2020-02-14include: linux: Update v4l2-controls.hJacopo Mondi
2019-12-08include: linux: Update Linux headers readme to v5.2Paul Elder
2019-10-28include: drm_fourcc: Add Motion-JPEG FourCCJacopo Mondi
2019-10-28include: linux: Import DRM/KMS headers from Linux v5.2Jacopo Mondi
2019-10-28include: linux: Update headers to Linux v5.2Jacopo Mondi
2019-10-11include: linux: Add rkisp1 kernel header and format definitionsNiklas Söderlund
2019-06-02include: linux: Update Linux headers to v5.1Jacopo Mondi
2019-01-17include: linux: Import V4L2 uAPI headers from Linux v4.19Kieran Bingham
2018-12-19libcamera: include: Import media.h from Linux v4.19Jacopo Mondi
ss="hl opt">[vendor] = int(value, 0) continue match = DRMFourCC.mod_regex.match(line) if match: mod, vendor, value = match.groups() self.mods[mod] = (vendor, int(value, 0)) continue def fourcc(self, name): return self.formats[name] def mod(self, name): vendor, value = self.mods[name] return self.vendors[vendor], value def generate_h(formats, drm_fourcc): template = string.Template('constexpr PixelFormat ${name}{ __fourcc(${fourcc}), __mod(${mod}) };') fmts = [] for format in formats: name, format = format.popitem() fourcc = drm_fourcc.fourcc(format['fourcc']) if format.get('big-endian'): fourcc += '| DRM_FORMAT_BIG_ENDIAN' data = { 'name': name, 'fourcc': fourcc, 'mod': '0, 0', } mod = format.get('mod') if mod: data['mod'] = '%u, %u' % drm_fourcc.mod(mod) fmts.append(template.substitute(data)) return {'formats': '\n'.join(fmts)} def fill_template(template, data): template = open(template, 'rb').read() template = template.decode('utf-8') template = string.Template(template) return template.substitute(data) def main(argv): # Parse command line arguments parser = argparse.ArgumentParser() parser.add_argument('-o', dest='output', metavar='file', type=str, help='Output file name. Defaults to standard output if not specified.') parser.add_argument('input', type=str, help='Input file name.') parser.add_argument('template', type=str, help='Template file name.') parser.add_argument('drm_fourcc', type=str, help='Path to drm_fourcc.h.') args = parser.parse_args(argv[1:]) data = open(args.input, 'rb').read() formats = yaml.safe_load(data)['formats'] drm_fourcc = DRMFourCC(args.drm_fourcc) data = generate_h(formats, drm_fourcc) data = fill_template(args.template, data) if args.output: output = open(args.output, 'wb') output.write(data.encode('utf-8')) output.close() else: sys.stdout.write(data) return 0 if __name__ == '__main__': sys.exit(main(sys.argv))