TLO what's pop? We are on twitch. We are not live, but you can leave a like comment subscribe Turning the post notification bells. Let's continue to grow the family from Chicago to the UK This is Where all the lives will go if we have any highlights and you happen to miss them Don't forget. We also got the patreon That's where we post stuff or we can't post on YouTube or anything that gets blocked and we can't do it We put it here. Well, don't forget. We also got the discord Yeah, I don't know what a discord is right To get to any of these go to the description underneath the video and there's a link in the bio Or the description you just click it. It'll take you to everything now. This is Alan Turing Turing The enigma Honestly, don't know who this is Well, let's check it out This is very random Possible by back blades get a free 15-day trial at back blade Imagine for a second that there exists a hero a man who has served his country in its darkest hour And has made great scientific breakthroughs who may have saved as many as 14 million lives How would you reward this man? Would you give him riches awards? Accolades or would you hound him from your institutions?  They made the latter choice that hero's name Alan Turing his crime Refusing to live in the closet a mathematical prodigy Alan Turing escaped a troubled childhood to become perhaps Britain's greatest Mathematician the father of modern computing he pioneered concepts of artificial intelligence in cryptography and saved millions of lives as a Codebreaker in World War two. He also dared to be openly gay at a time when loving another man could see you not just jailed But destroyed by the establishment join us today so Alan Turing was a mathematical prodigy who saved millions of lives But was an open community member back in the 50s 60s As we journey through the inspiring life and the tragic death of the mathematician who took on the Nazis and one It is said the first person we fall in love with fluences us for the rest It is said the first person we fall in love with influences us for the rest of our lives Perhaps that's never been more true than in the case of Alan Turing. I ain't never heard that When the teenage Turing met Christopher Morkin in 1928 it was the start of a relationship that would drive Turing to do his greatest work So it's really remarkable how close this meeting never came to happening There are near infinite universes out there where the father of computing never met the muse who would inspire him The first branching of the multiverse came in 1912 when Ethel stoning discovered She was pregnant with Julius Turing's second child at the time Julius Turing was a Functionary in the Indian civil service and there was no reason to believe the new baby would grab anywhere But amid the heat and humidity of the Indian plains But this was 1912 serious unrest was starting to break out against the British Raj And Julius decided that his child would be safer growing up in Britain And so it was that on June the 23rd Ninety-twelfth Alan Matheson Turing was born not in Andhra Pradesh, but in London Still India would powerfully affect young Alan's life although Julius wanted his children raised in Britain his job required Him and Ethel to live in India so in 1913 They went back leaving Alan and his brother John in the charge of Colonel Ward to compare Ward to the drill sergeant in full metal Jacket it would be a bit of an understatement Leaving Alan and his brother John in the charge of Colonel Ward Ward To compare Ward to the drill sergeant in full metal jacket it would be a bit of an understatement Ward was a true military man He liked boys who stood to attention not sissies like young Alan who preferred reading to rugga as a result Alan's early years were spent constantly being bellowed at until Ethel finally returned to England and decided Alan would fare better at boarding school And it's at this point that we get our second great branch in the multiverse in 1925 at age 13 Alan arrived at the prestigious Sherbourne boarding school in Dorset by now The boy was a veritable maths prodigy Unfortunately Sherbourne was a school that prided itself on Latin and Bible studies How do you just like like? Like we went from an Unknown age to 13 like how like I'm wondering how What makes you become a mathematician like what makes you great at math all of a sudden it's just something in your brain that click We've got to be something that's just given to you Because math is not my strong suit I'm okay with it, but I ain't the greatest you feel me Stuff that Alan kind of sucked at he sucked so bad in fact that the school actually opted to expel him It was only after some serious begging from Ethel that Alan was allowed to stay that decision would prove important when in 1928 Alan finally met Christopher Christopher Morgan was an attractive lad with a cheeky grin in the year above him at Sherbourne He was also a serious maths enthusiast the moment Alan first saw Christopher It was like time had stopped he took to following the older boy around always sitting next to him in class at first His behavior it seemed to have amused Christopher But as the weeks passed he and Alan began spending time together debating geometry and conducting science experiments before long They were inseparable. It wasn't exactly a romance Alan would write in later letters that Christopher was probably aware of his young friends romantic feelings But he had no desire to act on them. Yes It is sort of that classic story of a young gay man falling for his straight best friend But it didn't matter now and never I'm gonna be real with you sir. I've never heard that story. I Didn't know that was a classic It became bitter about this unrequited love. He was just happy being in the same room as Christopher as 1928 became 1929 and then 1930 the bond between Alan and Christopher only deepened Alan's grades They even improved and the danger of expulsion it drifted away and then came February the 7th 1930 and this idyllic life It was shattered into a million jagged pieces that day the tuberculosis that had afflicted Christopher since childhood It went into overdrive to come out. It said that the moments he had the news Alan I repeat Christopher had a premonition of his love's death on February the 13th 1930 Christopher Morkham died not yet even 18 in assembly. They had master gave a heartfelt speech to mark his point Not yet even 18 in assembly. They had master gave a heartfelt speech to mark his passing But for Alan what use when they are words he'd lost the one person in the world Who mattered to him the one beautiful thing in his life from that day on Alan Turing had simply never be the same again As 1930 first dawned on the rolling hills of Dorset Alan Turing had been an aimless student and a committed Christian By the time that fateful year retreated over the horizon. He was neither of those things Christopher's death it hit Turing like a haymaker to the stomach He cut himself off from his religion began trying to scientifically prove the existence of ghosts anything to give him hope that His one love hadn't been erased from existence. I worshipped the ground he trod on Turing wrote to Christopher's mother It was no exaggeration for the rest of his life Turing would always remember the first boy he fell for but life It goes on in 1931 Turing left Sherbourne and enrolled at Kings College Cambridge where he studied maths and dabbled in anti-war politics Yet even here the ghost of Christopher. It was never far away in 1932 Turing wrote nature of the spirit a hopeful essay that attempted to use the brand-new field of quantum mechanics to Suggest that our spirits might live on in eternity Turing was still clearly in the denial stage Tragedy but this flirtation with the otherworldly it wouldn't go to waste the papers Turing studied during this period would Directly influence his later work the next few years they passed in numbed heartbreak at Cambridge Turing had his first sexual Encounters with other boys. He also earned a first degree in mathematics aged 22 in 1935 he was even made a fellow finally that same year the broken young man discovered a reason to keep on living in 1935 Turing began working on a famous maths problem using some of the ideas that it cultivated while researching nature of the spirit one year later In 1936 he finished his masterpiece on computable numbers with an application to the Einstein Problem sorry about my German there, but don't let this name put you off You're still living with the insights of this paper to this very day The actual point of Turing's paper is really beyond the scope of the video today But part of it revolved around a thought experiment using something called a Turing machine to create the thought experiment Turing proved how you could take the then human process of computing numbers and create a machine capable of doing the same That's right. Well like a calculator Turing invented a calculator As a by-product of solving a maths problem Turing invented the basis for modern digital computers. This was oh computers Holy I'm thinking I'm keeping it basic up. Okay computers Hey, there's a truly dazzling step of mathematical logic a real once-in-a-lifetime achievement It was also thought to be hopelessly hypothetical something that was theoretically sound But nothing that any modern human could ever hope to build Yeah, the technology didn't catch up yet, but when they've kept knowledge kept the technology caught up Boom. I'm pretty sure there's real ideas floating around like that currently that the technology can't meet the demands of What's needed? Nonetheless Turing moved from Cambridge to Princeton, New Jersey in September of 1936 to keep working on his concept While he was in the USA He happened to catch an animated film at the cinema friends later said the mathematician was completely Bolled over by Disney's Snow White particularly the scene where the wicked Queen makes an apple deadly by dipping it in a cauldron While whispering dip the apple in the brew let the sleeping death seep through and that my friends That's what we call foreshadowing in 1938 Turing finally returned to the UK where he picked up a job with G CCS the pre-World War two British signals in deception and code cracking branch He was originally only going to stay there for a year in fact in summer of 1939 Turing was offered a teaching job at a university But as your laureate But you know summer of 1939 was when the fate of Europe changed forever It was at this point the Turing was really only weeks away from a meeting with destiny. I'm not gonna lie I've learned way more about history After school than during school It's more interesting now in school Maybe it was the way they was teaching it, but it was not interesting Like all you wanted to do was go in class and get a D so you can graduate for me at least but like The enigma All right, so it's time for us to rewind the clock back a little on our story all the way back to 1918 So 1918 at this point young Alan Turing is still dealing with parents who vanished to India at the drop of a hat And has never even heard of Sherbourne or Christopher Morgan, but it's not Alan Turing with time-traveled here to look at It's an anonymous-looking German man named Arthur Sherbius in February 1918 is the first World War still raged Sherbius had quietly filed a patent for a new cipher machine Looking like a typewriter the machine randomly scrambled messages as you input them producing gibberish that only someone with their own copy of Both the machine and the cypher key could possibly decode Sherbius named the machine the enigma in two short decades It was gonna be infamous Sherbius originally wanted the enigma on the commercial market But it wasn't long before the military came calling no surprises enough Or even in the 30 even now like commercially what I need that for Everything's already encrypted. I mean but back then I Mean I guess but it sounds like something for the military 1926 while Turing was close to getting his ass expelled from the Sherbourne the German Weimar Army purchased the enigma plans and started Developing their own even harder to crack version. This was worrying to Germany's neighbors for obvious reasons in 1930 The year Christopher died Polish intelligence began secretly trying to collect information on the new cipher machine in 1933 They got their break a drunk playboy in the German cipher office named Hans Delio Schmidt sold information on the enigma to the French Secret Service they passed it on to the polls and under the direction of mathematician Marion Raveski Polish intelligence was able to construct their own enigma device the bomber the bomber wasn't perfect It could decipher a lot of enigma traffic But it relied on the Germans not updating their methods when 1938 ended with Hitler annexing Austria and the Czech Sudetenland The polls began to worry that maybe they needed to show some other nations their stolen device in summer of 1939 Polish intelligence They finally passed on a replica enigma to both France and Britain. This was a decision They made just in time on September the 1st 1939 pants the tanks rolled into Poland by the time a month had passed The entire Polish state had been conquered by Germany and Russia and Britain and France had declared war. Okay Everything happens how it's supposed to happen if they wouldn't be gay that up They would have been destroyed or it would have been found out and things wouldn't have turned out the way they have turned out So back in our main narrative Alan Turing responded to the outbreak of war by reporting to Bletchley Park The hub of all British code-breaking efforts there You're already waiting for the young maths whiz was the Poles last gift before they were conquered that replica enigma that Turing Would use to save millions of lives now just before we get into the rest of the story today I do want to thank our sponsor backblaze who make these long. No, I like to try and in fact I as being synced with my computer I understand you got to pay the bills, but hey is also backing stuff up anymore. I can That if I they will eat hard disk Hands is off back Our Turing cracked that support this show, which is great And let's get back to our story and how Turing cracked that code So at this point in the story you might be feeling a little confused if Bletchley Park already had a replica enigma machine Well, why did they need Turing the problem was that enigma ciphers? They were constantly changing the Polish machine could intercept its traffic But without that day's cipher it was semi useless What Bletchley Park needed was a device that could crack the enigma code no matter the cipher and do it quickly This is where Turing's strange genius came in now You may have seen the Benedict Cumberbatch film about Turing's life called the imitation game and have a vision of The Imitation game Gotta watch that one And Turing as a borderline asperger's loner obsessed with maths at the expense of all else But the real Turing it wasn't like that Well, maybe a little I mean it's certainly true that he used to chain is mugged the radiator So no one else could drink out of it and it wear a gas mask in summer to keep his hay fever at bay But he was also a fan of socializing and he liked to go out drinking and dancing with his colleagues So while Turing certainly was a spooky maths genius while a Bletchley Park, please don't picture him as a 1940s version of Sheldon Cooper It's just not like that Now the early going work on enigma was heavy Although Turing helped build a machine known as the bomb with an E to help decipher Intercepted messages many of them only came through as gibberish or it turned out to be nursery rhymes the Germans had sent as tests As 1940 got underway Turing was reassigned to Hut 8 where he led a team tasked with decoding German naval transmissions This was important for two reasons the first was that as an island Britain had to import its food to survive Great when you've got a friendly continent on your doorstep less great when German U-boats are sinking all of the maritime traffic coming to the UK The second important reason is that it was in Hut 8 that Turing first met Joan Clark If Christopher was the great love of Turing's life Joan was the great friendship a mathematical genius Joan had volunteered her talents of Bletchley Park Only to be told that women can't do maths and she would have to take a job as a secretary Within days though it had become clear to even the knuckle dragging Neanderthals running the place that Joan's brain was the sort of brain They were desperately looking for and she was promoted to Hut 8 But as this was still the 1940s Joan was still paid a fraction of what her male colleagues earned Still she and Turing they really hit it off They went to the cinema together and they went out dancing as bombs rained down on southern England the two mathematicians friendship It began to blossom until in early 1941 Turing did something unexpected what he proposed to Joan now since you've watched That's out of nowhere. He's still in the closet though. Ain't he he's trying to conform to society's box You know I'm saying instead of being of self at this point right this far and heard all about Christopher You're probably wondering why a gay man like Turing would propose to a straight woman like Joan Joan kind of wondered it too She knew Turing was gay, but she still said yes It took a disastrous romantic vacation for them to face reality and call the whole thing off still Joan and Turing They remained firm friends better still they remained excellent co-workers in Hut 8 And Hut 8 in 1941 was the nerve center for the British fight back against Hitler that summer Turing and his colleagues developed a technique Known as ban barismus which broke the naval enigma codes wide open suddenly the British knew where the U-boats were Ships could be rerouted supply lines could be kept open and lives could be saved looking back It's really quite difficult to picture just how close Britain came to starvation in 1941 We see the course of World War two today like a narrative that can't be changed with Crazy really when I think when I used to think of war I would just think of soldiers on a front line fighting a battle But like all of this stuff going wrong behind closed doors Like it's is way more interesting than guns being fired. I didn't go a lot. Yes Yes, the soldiers are very important, but this stuff right here They're like logistics of it all it's kind of cool. I feel I Ain't gonna hold you That's what wars are one and hut eight clearly Plucky Britain standing alone always destined to triumph But just as there are other universes where Turing never met Christopher There are other universes where hut 8 never managed to crack those naval codes and Britain starved in a brutal siege That fall in 1941 buoyed by their success the team at hut 8 wrote to Winston Churchill asking for more funds They only asked for a little thinking the great man could never possibly have heard of their small team and what they were up to So imagine their surprise when Churchill wrote back on October the 21st saying that hut 8 would now have access to any amount of resources They needed with the utmost urgency even the Prime Minister knew that Turing and his team were gonna be the ones that saved Britain By early 1942 Bletchley Park analysts were decoding on average one German message every two minutes or around 84,000 a month yet even as they saved millions of lives and helped decisively turn the war the team were forbidden from telling anyone about their Achievements as a result that makes sense You don't want them you don't want like spies to know or anybody to get information and pass it on like a they know They're decoding your messages, of course That makes many suspected the hut 8 team of refusing to help the war effort Turing's landlady actually accused him of malingering and called his refusal to enlist a disgrace among people in the know Though Turing's reputation it was soaring in December of 1942 He was cleared for travel to the USA and given a top-secret security clearance to help American codebreakers But by March 1943 had been recalled to Bletchley Park as he was just too invaluable to be away in America as 1943 became 1944 the tide of war began to turn in the summer of 1944 D-Day dislodged the Germans from their once unassailable Position in France what followed was a slow-mo a dislodged the Germans from their once unassailable position in France What followed was a slow-motion collapse of the Third Reich that killed more people than perhaps any other war in history With his work wrapping up Turing began to make plans for his post-war career He decided that he might build a universal computer around this time Okay, back to the CPU. He also seems to have decided to start living mostly out of the closet Turing was now a hero a man whose work had saved Britain from starvation I mean who could possibly object to a war hero man. It's still 1950 who just happened to love other men Finally in August of 1945 1945 I've nearly three months after the collapse of Nazi Germany Japan formally surrendered to the Allies the Second World War It was over for Turing this meant an OBE one of Britain's highest honors It also meant being told to never ever reveal what had done at Bletchley Park Not that Turing cared He was a hot property now a genius that everyone was clamoring for in 1946 the National Laboratory commissioned him to build the first modern Computer the ACE had it been finished It would have been the most powerful early computer by far sadly Though the NPL bogged at the cost and decided to build a smaller version known as the pilot While the pilot's ACE was a milestone in computing It was overshadowed by the Royal Society Computing Machine Laboratory in Manchester's own effort the first working Electronic stored digital computer in 1948 Turing quit the NPL and moved to Manchester to join them It was around this time that of course they're making moves that he want to make And not being worried about the money Julius Turing finally died Turing's father had quit the Indian civil service many years before but it mostly lived brought for tax reasons when he died It was discovered that he'd rewritten his will to leave far more money to Turing than to his brother John like the gentleman He was Turing disregarded his father's wishes and the two brothers shared their inheritance equally the 1950s dawned on a Bury of activity for Alan Turing in 1948 the mathematician nearly competed at the London Olympics making the shortlist for the marathon event In 1950 he created the famous Turing test for determining if a machine has human level intelligence Finally in 1951 he began working on the creation of artificial life one of the very first people to do so 1951 they've been working on this 49 plus 23 is now saying I already told you I'm up mouth wasn't that great 72 years they've been working on artificial intelligence and now when I open up Snapchat. I got a AI That's crazy. AI is everywhere Thanks, Turing All in all things were going pretty well for Turing now He was respected in his profession mildly famous as a mathematician and living as close to openly gay as was possible in the 1950s Now, you'll no doubt recall that we started this video by describing Turing's life as tragic Buckle up because it's time for this innocent man to be brutally destroyed I'm not surprised Can't believe it's a little bird on my lap out when he making all that noise like that Hey In a weeks before Christmas 1951 Alan Turing was out shopping in Manchester when he happened to lock eyes with Arnold Murray A young man of around 19 Murray was a good-looking working-class lat that same day Turing took him out to lunch and charmed him a week Later Murray stayed the night at Turing's house soon the pair were seeing each other regularly It was during one of these romantic weekends that Murray started complaining that he was always short of cash Turing offered the boy some money, but Murray refused the next morning Turing discovered money missing from his wallet Although he confronted Murray the boy claimed he was innocent and the two reconciled and that was the pattern for the next few weeks Turing's money disappearing and Murray refusing to admit his guilt. It's likely the why would he do that when he offered him to That's pride man. He offered me money. I can't take it, but I'm still it The well-paid Turing could have lived with this odd arrangement where it's not for what happens next on January the 23rd 1952 Turing returned home to find his house had been burgled Deciding Murray had gone too far this time. He called the police a week or so later on February the 2nd 1952 Murray unexpectedly turned up on Turing's doorstep screaming that he was innocent He claimed a friend of his named Harry had been the burglar and that it targeted Turing after Murray admitted that the pair were In a gay relationship perhaps wanting to believe his lover Turing reported this new information to the police Not long after cops arrived at Turing's house Turing was asked if this was about Harry and it was But not in the way that he thought unknown to Turing the police had already arrested Harry when Harry told them Turing was in a sexual Relationship with Murray the police decided Harry wasn't the real criminal here The real criminal was Alan Turing that same day Turing was arrested on a charge of gross indecency of having sex with another man Murray was arrested alongside him in late February 1952 the pair attended a preliminary hearing together Turing was bailed Murray went to jail as a war hero used to moving in academic circles It's likely Turing never realized anyone would care that he was gay But the law itself otherwise in the 1950s it was routine for police to spy and entrap gay men You could have saved Britain from starvation in World War two You could have helped defeat the Nazis But if you weren't a hundred percent straight then you were worse than a common burglar in my that that's crazy I'm not gonna lie Shout out to all the community members man. Yeah, I ain't no y'all. I ain't no it was that deep Much 1952 Turing played guilty to one count of gross indecency the court I'm like he's had sound like touring steps so y'all could run What originally planned to jail him that his lawyers convincingly argued that Turing's work was of national importance in the end Turing was offered a choice one year in prison or chemical castration Bro, that's why he chose chemical castration a course of female hormones were released into his body via an implant in the thigh Chemical castration it was designed to destroy libido and leave you impotent It also had horrific side effects an increased risk of cancer was one and extreme depression was another When the news broke of Turing's conviction yet his security clearance revoked his clearance for traveling abroad Is it likewise went in the trash the years of Turing the genius were over in the eyes of the British establishment? He was now nothing but a monster It was a cold wet Monday morning when Alan Turing's housekeeper let herself into his home on June the 8th 1954 it was now over two years since the mathematicians trial and conviction for homosexuality and Turing's life It was in tatters Turing's public outing had caused a rift with his family Turing thought his brother John was trying to hide the fact that he had a homosexual sibling and his mother's reaction to Turing's Sexuality had been cold and dismissive The same time the course of hormone treatment had wreaked havoc on his brain and his body While under treatment Turing had a small number of sex dreams that convinced him that he was turning straight He wrote to a friend I've had a dream indicating rather clearly that I'm on the way to being hetero Though I don't accept it with much enthusiasm still by 1954 The worst was generally thought to be behind him in April 1953 The implants had been removed from Turing's thigh ending his hormone course a month later He'd picked up a new job at the cutting edge of computing There had even been a sort of reconciliation with his mother while their relationship never fully recovered it had come back from the lows of the trial As the housekeeper crept through the house that rainy morning in 1954 She had no reason to suspect that anything would be unusual The only sign she might have noticed was the faint whiff of bitter almonds on the air Upstairs the door to Turing's lab was open It had it installed some years before and spent his spare time experimenting with different chemicals But the housekeeper hardly noticed she was too busy staring or what lay on the bed his eyes closed and then Turing they dead on the bedsheets A half-eaten apple beside him the coroner's report would later claim that he had laced the apple with cyanide and bitten into it Committing suicide in a ghoulish homage to snow white It's generally thought to be an unresolved question whether Turing killed himself or Accidentally poisoned the apple with cyanide gas while working in his lab However, a recent exhibition at London's prestigious science museum published the original coroner's report for the first time in full It's noted that there was so much cyanide in Turing's stomach that accidental ingestion was effectively impossible The apple the coroner reasoned was a last meal a final treat to take away the bitter almond taste of Cyanide on June the 12th 1954 Alan Turing was cremated at Woking Cemetery despite his heroic wartime record Despite his pioneering scientific work, the press barely marked his passing. He was just another dead pervert What did anyone care 13 years after Alan? Turing died in 1967 the British government finally decriminalized homosexuality in England, Wales 42 years later in 2009 Prime Minister Gordon Brown issued a formal apology to him finally on Christmas Parades and anything received 2013 the Queen posthumously pardoned Alan Turing this led to the creation of Turing's law which came into effect on January the 31st 2017 and posthumously pardoned Thousands of gay and bisexual men who were convicted for their sexual orientation in Britain. It was a hot I ain't no nothing about none of this I'll fight a cadre of conservative MPs tried to filibuster the bill falsely claiming that it would Pardon convicted pedophiles even in the 21st century the prejudice which destroyed Alan Turing It still hasn't completely faded today It's estimated that Turing's work on enigma may have shortened the war by two years saving millions of lives in the process His work on computing artificial intelligence artificial life and many other fields is considered to have been pioneering Without this one remarkable man who met such a tragic end sound like he saved lives in multiple ways You know I'm saying Turing law making pure decoded Nazi Colts he did a lot You and I would be living in a very different world. I'm surprised. I don't got Turing day and you can't so I really Surprised I don't got a day for until I leave a like comment subscribe. I ain't no nothing about this. This is eye-opening


Today, I've got a fun cup for you guys. This one is going to be a long long bob like extra long It's going to be all dry cutting So the way that we're going to start it off is I go a little bit above Oxyapatobone kind of straight with the jawline and I start by kind of get blunt line now My blunt line is in a triangular form. So it kind of follows that Jawline as well. You see you can see a really good shot of it here So it starts off a little shorter up by the nape in the very center And then it gets longer towards the edge and then what I do is I go through and I do a tease cutting technique Which is a half open half close of the scissor. I'm using the Matt Beck scissor version one. Yes I got my own scissor created by Mizutani, but it's mine. I designed the whole thing So if you guys are looking for that it is for sale. It's in stock and shipping five and a half inches And it's really great for dry cutting and wet cutting So I'm gonna show you guys the versatility of it in this cut everything is being over-directed straight back to the center point So I've over-directed everything straight back I cut it and you could see how those The layers get longer and longer towards behind the ear and then I go through and I define it So I think a lot of people worry about that outer perimeter and I talk about this a lot But you can't worry about the outer perimeter when you're cutting the interior part of the cut So just focus on getting your your shape right on the interior and then go out and cut that perimeter later So when I start off the cut, I do more of a tight tease cutting technique It's a very small strokes with the scissor when I go to this longer portion of the cut I'm trying to create a little more freedom and air in the shape So I do a heavier stroke or a longer stroke with the razor and I go in and still half open half close But you are cutting a line so I bring everything straight back from the head It's not going to the center back of the head It's going straight back and I cut it and you can see that line that we're creating It's that asymmetrical a-line shape in the very front, but look how long it is So this is a great haircut for that client that doesn't it's kind of afraid of change But they're looking for something new They could still hit a curling iron on it They could still pull it back into a ponytail if they wanted to it'd be a small one, but they could So go through tease cutting technique over directing everything back and really making it pop Also, this color is part of this collection as well So if you want to see the color technique go to fse on demand you can see the full collection On there it's all put together three colors three cuts And they're all dry cuts so Still over directing everything back and cutting with that tease cutting technique If you guys are wondering how to do the tease cutting technique just hit the search button and type in tease cutting Done many many videos on this technique, but it's really really simple.  So I go in with actual point cutting and I just clean that edge up to get a nice clean shape to the haircut So tease cutting is like a fast way to go through and get your shape But then point cutting kind of helps refine it a little bit Like I said, my scissor is really really versatile for doing dry cutting and wet cutting That's how I wanted to put out a whole Dry cutting collection because you know a lot of people are asking like what's a good all-around scissor Well, I have definitely created that at this point. So now I'm doing slide cutting So pretty much this entire haircut is a half open half closed I go through I pinch the hair where I believe I want it to blend And even this has a lot to do with the hair color because I just want to showcase some of that peach coming through So I create some more layering to show that off So now I hit it at the end with a wand iron facing down And I just kind of curl everything off of the face And then I'm going to hit it with the joyco beach shake spray Which is a texture spray. So once you get those curls in the hair and you put this product on it It just brings the whole texture to life. It's also great for curly hair as well So but you can see how much texture gets created in that. Hope you guys like the cut Remember if you want to pick up my scissor go to free salon education.com you can check it out on there Thank you so much for watching


We back So you two team keep it clean what's going on It's engraving here with another video and another episode of NFL questions from subs a series Well, you can ask me any question you want to about the NFL and we answer in a video just like this If you want to be part of it You can send me an email to team keep it clean at gmail.com or for the patrons you can send it directly on Patreon I love y'all team keep it clean. I appreciate y'all we I was just talking to my god Jermaine about it this morning. We have almost officially made it through the slowest part of the offseason like and honestly It went by fast me it went by fast for me at least cuz stuff has still been crazy busy But we're like right there training camp starts what next week. I think like so we're like right there Still looking for a pass for July 30th, but we'll see how things go with that But anyway, I love y'all we got some really good questions as we always do let's do it first question came from I got Nick brick. He said I hate to ask a Lamar question since we've all been hearing so much about him lately But I was shamefully reading some Twitter nonsense and saw a tweet that said he has declined drastically Since his MVP season and I think we all know who that tweet came from she got very popular for that tweet But anyway, it's not important Besides the fact that it's only been one COVID season since then I also thought last season he was better Obviously 2019 was magical, but everything went right and he gained my trust throughout the season in 2020 our offense was horrible Mostly new offensive line worst receiving corpus in the league and I love Gus But on paper our running backs on a running team were an undrafted free agent and a rookie and not to mention we got wrecked by COVID I mean on paper excluding quarterback our offensive roster was worse than the Eagles the Lions the Bears Vikings the list goes on Yet every time he dropped back. I was never worried no matter the situation I can't say the same about early 2019 Lamar and if we had 2019 Lamar with all the turmoil in 2020 I don't think we make the playoffs. Obviously The stats don't say this and anyone who doesn't watch the Ravens wouldn't understand this That's a very good that That was the only part you had to say anyone that doesn't watch They won't understand if you look at the numbers if you're just looking on paper Then you'd be like, oh man, what happened? What's going on? But if you actually watch you can see oh Okay, I get it now. Anyway, um But all of team keeping clean that sits on these live streams every Sunday can clearly see I appreciate that little shout out to I like that and that that was like a little A little shameless plug for the live streams that we do during the games, but I like that But anyway, you said uh All of team keeping clean that sits on these live streams every Sunday can clearly see that we are watching a guy That gets better every single game I'm not making excuses for him because I genuinely believe we were watching a better quarterback work with less The way he got through the progression much more patient a pocket accuracy on tight window throws was steps ahead of 2019 Only thing he struggled with was deep throws man out While I was reading that part. I was thinking And he he wasn't good on a deep ball last year. That was definitely a problem But then you went and said it and it was obvious that he was just overthinking them I ran to the long time but my question is aside from the stats and all that just watching the games each week Do you believe that Lamar Jackson grew as a quarterback in 2020? Or do you believe he declined? That is a very very good question And what a powerful way to start off question from subscribers with my guy nick brick Um, but anyway with Lamar Jackson. Yes, that is something that a lot of pundits and analysts and experts and artists and all that Say Lamar Jackson, he regressed Lamar Jackson. He declined Lamar Jackson. He took a step back In 2020 from 2019 But me the way I look at it the way I see it and like you said you got to watch the games to really understand Will Lamar Jackson were his numbers as pretty as they were in 2019? No, no, but again, he was coming off The only place you have to go from an MVP season is down. That's it. That's it You you cannot go up from an MVP. Well, you can technically but You 9.9 times out of 10 after MVP season, you're going to go down your stats are going to go down It's like the only the only place to go from the top is down So that's what happened to Lamar Jackson statistically But then again, that's when you just look at it on paper But when you look at what's around him Biggest thing that declined Way more than Lamar Jackson was offensive line It was offensive line And we lost marsha yanda We lost ronnie stanley um, it was just Mascara, he wasn't all the way back yet Um, there was pat mccarrie. There was uh, tyrie phillips who was up and down. There was um Bradley bow. It was just The offensive line was constantly in shambles man constantly in shambles. So the offense was Constantly in shambles and something else that you talked about too. It was the kovat season It was a kovat season. So with it being that season the ravens, they didn't have an off season So that really took away from everything That took away from everything that took away from them possibly implementing new things In the passing game and I think that's one of the biggest reasons why greg roman may have gotten a slight pass Even though again, they brought in t martin and Keith Williams. They like hey greg It's time for everybody to step it up this year. No excuses. No excuses Um, but with with the offense as a whole just with lamar jackson as far as when people say he regressed now And and that is another thing that you pointed out too with his patience in the pocket It seemed as if um They had a lot of on-the-job training Early on in the regular season because they didn't have a preseason because they didn't have an off season Because you know that lamar jackson early on in the season They were just having him throw throw throw throw throw throw throw throw A lot of us were like, hey, what's going on with the running game? But I mean, I appreciate the pass game too. What's going on with the running game? What's up? They had him throw throw throw throw extra heavy and it seemed as if they were trying to sort of play some makeup For everything that they missed in the off season um, but with that being said, uh I I don't think he regressed Like you said, he did again staying in the pocket waiting being paid and the thing with lamar sometimes It almost felt like he was being too patient And again, if you don't if you didn't watch the games you wouldn't be able to see that Because you look on the stat sheet. Oh, this was this was his numbers for this game These were his numbers for that game But if you actually watch the games you see this guy because a lot of people like to run with one of the one of the Many narratives of lamar jackson that isn't true. What they say. Oh That guy he's no pocket quarterback He can't be a pocket quarterback. He can't he doesn't stay in the pocket lamar jackson is a run first quarterback Whenever people say that whenever they say that I just I cringe twice I cringe twice I go Because it's just that's how you can always tell that people do not watch lamar jackson and they just listen To people on tv. They just listen to these experts and whatnot Because that couldn't be the furthest thing from the truth Yes, lamar jackson past two years thousand yards russian Over a thousand yards russian at the quarterback position Oof keep changing the game lamar but He is not a run first quarterback He's not Lamar jackson y'all know or those of y'all that watch lamar jackson will sit there and wait And he'll wait and he'll wait and he'll wait and he'll wait and a lot of times It can be frustrating because we know what he is capable of on the ground too So a lot of times when he's waiting and waiting and nothing's coming open We're thinking in our heads and saying it out loud to the tv lamar go Lamar run take off, please. Let's go man. Come on But he'd be just sitting there waiting and waiting and waiting And sometimes finally somebody comes open Sometimes he takes off sometimes he'll take a sack or sometimes he'll throw it away. It all just depends but He is not a run first quarterback and he has made plenty Plenty plenty plenty plenty of passes from the pocket So that narrative people try to run with that. It's like why what what are you doing that for what even saying that? It's not true. That's not factual And then there's the other narrative too That lamar has continued to shut down but people they don't they don't like believing facts though And shout out to my god simply as 10. He just made a video About all of the mall. I don't know if it was every single pass, but he made a video of lamar jackson throwing outside the numbers Passes from his rookie years sophomore years third year Passes that he was throwing outside the numbers Because what a lot of people like to do they they say oh lamar jackson can't pass outside the numbers So they'll pull up some incompletions. They may pull up some interceptions. They may pull up some bad throws from lamar jackson They'd be like see He can't pass outside the numbers But then you have simply who says wait a minute No He can He has And he will Pass outside the numbers He can do that With lamar jackson, um A lot of people they uh They try to emphasize Things that he can't do uh that he has already proven to do Um, but again, it's that's that's never gonna go away. It's it's never gonna go away With lamar jackson, uh the the the pedestal the um His What what people feel like lamar jackson needs to accomplish To be respected as a quarterback His ex expectation levels are through the roof They are through the roof And you look at some other quarterback guys that have been around longer than lamar jackson And people say oh, yeah, that guy's pretty good. He got a lot of respect, but he hasn't even accomplished half Of what lamar jackson has One of those guys, uh, is definitely matthew stafford Matthew stafford has a lot of respect from people around the league. Oh, yeah, Matthew stafford went to the Rams. Oh, man, old guys They got them one They sure got them a quarterback What has Matthew stafford done? Did they have some five thousand yard passing seasons? Is that it? Is that it? This guy for years he had The best one of the best wide receivers to ever do it ever period What does Matthew stafford accomplish? How many playoff lenses Matthew stafford has? Huh That press cut he's another one And again, this is not me. I'm not hating on any of these quarterbacks But I'm my thing is What have they done where they have just all this respect and all of these uh all this praise To where when people talk about them they like, oh, yeah, those guys When they talk about lamar jackson's like No, he needs to do this in order to be respected. No, he needs to do this. He needs to do that. He did. Oh, no, it It happened so much But It is what it is. Um, so to answer your question again No, I don't I don't feel like lamar jackson has regressed. I don't feel like lamar jackson has declined I don't feel like lamar jackson has taken a step back As a quarterback But I do feel like with lamar jackson what took the biggest step back for the ravens as a whole What took the biggest step back for their offense as a whole was the offensive line So this is why they invested into the offensive line And they also invested into some weapons uh for lamar jackson because both of those go hand in hand with the offensive line If you're not getting any blocking You could have the best weapons out there And sometimes those weapons can actually help the offensive line because the quicker a wide receiver gets open The less time that offensive line has to block for So it goes hand in hand or the longer it may be taking a receiver to get open If you got a good offensive line, they'll give you some time for that receiver to do just that so Ravens they they definitely um Did a little double dipping In in both of those categories, of course, alejandro via nuova Kevin zeitler for the offensive line bradley boseman shifting him back to center We should get a healthy ronnie stanley back whether he starts the season healthy or he starts the season on pup And he has to mix miss six games. Hopefully that's not what the case is. Hopefully that doesn't happen But whatever the case may be the offensive line should be a lot better this year than it was last year And especially another thing to think about too training camp The offset they'll actually have that this year and then have that last year But with them having it this year Things should be a lot better. Um, and as far as the wide receivers too sammy walkins veteran And he he can play biggest question mark with him is health that that is the biggest thing I don't think anybody questions sammy walkins head. I mean his hands his his his head his mind space his heart They don't question any of that stuff Um, but the only thing that that's questionable about him is his health Can he stay healthy and now instead of 16 is 17 games But they know he can ball out rishabh bateman He obviously got approved on an nfl level, but excellent route runner excellent hands and underrated speed underrated speed So they added him they also added tylen Wallace Not the tallest of the tall but to go up and get it 50 50 guy some deceptive speed Uh, but some deceptive strength as well added him as well Then of course hollywood you got hollywood coming back again um underrated route runner Underrated route runner very underrated So you got him in another year and one of the biggest additions too besides the personnel is the coaches with Keith Williams and t mark So you add those guys and what they've been able to do with different receivers around the league You add those guys and what they've been able to do what's on their resume You add that to the Ravens wide receiver just the Ravens period you add that to their offense period Because they also did say that they're going to be getting involved with the route running as far as with the running backs too And then of course that would have to be with the titans as well. It's going to be with everybody So it just it just adds so much value to the team, man So they should be in much they are in much better shape heading into this season Then they were last season and i'm sure Lamar will be able to show everybody that He did not regress. He did not decline. He did not take a step back And he'll be just fine. We out


if there's some time. So let's start now. This talk is going to be about the anatomy of a KMS driver. So we'll start by quickly explaining what KMS actually is, because most of you probably have at least heard about KMS DRM, but might not know exactly what the difference between those is and what exactly each API does handle. This will be fairly technical. So I will have to jump into code at some point, because I really want to show you how you can write a KMS driver. So there will be kernel code. There will be C code. Apologize for that. Please try not to fall asleep, at least too early. If anyone wants me to kick him if you fall asleep, just tell me before him. OK, so starting with DRM and KMS, DRM is the direct rendering manager. So that's a kernel to use a space API and a kernel infrastructure that started as a project to support GPUs in Linux. So it was mostly at that time about 3D acceleration. And we needed an API to expose that to user space. So we already had the FB Dev API on the kernel side to expose the display capabilities of the hardware. But for the 3D acceleration, we needed something new to manage methods, to manage the memory, to handle the common cues, to be able to handle synchronization. And all that went into KMS. That was quite a few years ago, into DRM, sorry. That was quite a few years ago. And KMS didn't exist at that time. KMS stands for kernel mode setting. So it's a fairly recent addition to DRM that's moving all the mode setting codes that lived in user space, mostly in the X server back then. It aimed at moving that inside kernel space, inside the kernel drivers, so that you could actually control your display hardware and modified display modes from the kernel. There were many reasons to do that. One of them was to be able to control that from inside the kernel at boot time when you want to have early display before X is available. Another reason was to actually arbitrate between the different user space components that might want to control the hardware. Because when you go directly to your PCR hardware from user space from the X server, then it becomes quite messy if you have different components in user space that want to access that directly. So nowadays, we have both DRM and KMS inside a kernel and both of them overlap. So we have two APIs that are exposed through a single device and that are used by user space. And you cannot really use DRM without using KMS or the other way around. We'll see that in a minute. So as I mentioned, DRM handles mostly memory, vertical blanking. And there's a couple of core tasks that nobody really wants to do because there's nothing fancy in that, but that needs to be available. So exposing a version number to user space, exposing authentication features, so that an unauthorized user space application will not mess up with your graphic hardware, handling the multiple master configuration when you want a user space application to hand over control of the hardware to another one. So that's really cool stuff that are quite boring. And I will not go into too many details about them in this talk because those are mainly in DRM. That's something that the DRM handles for you and you don't really have to care about that in your driver. On the KMS side, it's a bit more interesting, at least from my point of view, because I've been working on that. That shouldn't happen. OK. Right. OK. I have to stay close to the computer. So KMS handles expose a device model to your application to user space. We'll come to that in a minute as well. It handles frame buffers. So a frame buffer is a memory object that you can use to give to display hardware and that will contain information that you want to display on the screen so that will be scanned out to the screen. It handles mode setting. That's the kernel mode setting API, so that's more or less a given. It handles page flipping as well. Page flipping is a process in which you can atomically switch between different frame buffers, between different memory arrays to avoid tearing when you want to display video, for instance. It handles planes, overlays, and hails many other small details that, unfortunately, I will not have time to go into a harder cursor, gamma tables, things like that. Before diving into the kernel side, it's very important to explain what a KMS defined looks like and what the KMS model is, because that's really the core of the KMS operation and you need to understand that both from the user space side and the kernel side to understand how to write a kernel driver or how to write a KMS application in the space. So KMS handles five different kind of objects at its core. On the left, you have the memory objects. So I mentioned a frame buffer. A frame buffer is really a piece of memory in which you have graphics data that you want to push to display. That was the only memory object available when KMS was created. And the frame buffer is associated with a CRTC. So CRTC stands for CRT controller. There's probably no CRT anymore in use nowadays in any kind of Linux device, but still the name is still here. So that's a piece of hardware that will get the pointer to your memory frame buffer and that will scan the memory frame buffer out of the chip to an encoder. The encoder is then a piece of hardware that will take the digital signals that get out of the CRTC and encode that to whatever format you need for your display. So that could be analog and VGA, for instance, analog for TV. There are several different digital formats for HDMI, DVI, for flat panels as well. So we have a different set of encoders. Some of them are really simple. They don't really need to be controlled. They just take digital signals on the input and will output signals that are compatible with a flat panel. And that's it. Some of them are much more complex. So that's an object that's exposed by KMS API because it sometimes needs to be controlled precisely in the user space. And then on the far right hand, you have the connectors. We have to remember that KMS started as an x86 or PC API in which you have a graphics card and you have connectors to get the signals out of the graphic cards. There's usually no embedded LCD on the desktop. It's changed, obviously, with netbooks. And so the model started with connectors. But a connector can actually be something that handles a flat panel or any kind of display device. So it can be a physical connector. It can just be an interface on the bar to the real flat panel. So I forgot to mention about the planes. So planes are a recent addition to KMS API. So it's also memory objects, exactly that frame buffer. But when you have a single frame buffer, you need to scan out. That was pretty much all that was supported when we started by the hardware that we needed to support. But some hardware can overlay other images on top of the main frame buffer. So that's what the planes are for. They're pieces of memory that you can give to the CRTC and that you can overlay on top of your main frame buffer. So you have to part for different hardware overlays. If we had to redesign the API nowadays, we probably wouldn't separate the main frame buffer and the planes because there's no real difference between them except that the main frame buffer is at the bottom of the stack, if you think about the Z-order. But except that, it's a plane like the others. But for historical reasons, they're currently separated. On the embedded side, well, memory is memory. There's no question about that. The CRTC is what you will have on your SOC. That's the graphic control or the display control on your SOC. For encoders, it's a bit of a mixture here. You can have the encoders inside your SOC or you can have them outside on board. The connectors, obviously, are not part of the SOC. They are on the board and off-chip. So that's a pretty simple model. There are a couple of core objects. They can represent more or less all that you have in nowadays hardware. Well, really more or less because we have some current cases today that will be more common in the future. Things like deep pipelining, for instance, when you have a camera interface in your SOC that can deep pipeline data to your display controller. And that's not supported in this model. We have memory as inputs on the left. We don't have deep pipeline capabilities, for instance. So there are a couple of issues. We will need to extend that. But the basic model is pretty simple. The scandal process, as I mentioned, is about taking a frame buffer, so piece of memory, and pushing that to the display. See, you don't need to use the whole frame buffer, actually. You can use a part of the frame buffer. The frame buffer can be bigger than the display size. And you can take part of that and push that to the display. So that's smaller the scandal process. With the plane support, we have in KMS support for scaling the planes. That's not supported from the main frame buffer. And KMS can compose that. So the composition model is not part of the KMS API. KMS will just know there's a main frame buffer. There are planes I need to compose on top of that. And everything else, like configuring alpha blending, ZD, Z-order, things like that, that's left to draft a specific API. I mentioned a frame buffer. So a frame buffer is, well, I said it's a piece of memory. But actually, it can be a bit more complex than that. Because depending on your video format, you can actually have several pieces of memory. When you have a planner format, or you have an NV12 format, for instance, when you have one piece of memory with the Y data and one piece of memory with the chroma data, then you have two separate memory arrays that make your whole frame buffer. So the frame buffer in the KMS model has a couple of properties. It has a size. It has a pixel format to know what kind of data you have in there. It has pitches, offsets. Very importantly, it has memory objects that it uses to create that whole frame buffer. So in the usual case, you will have a single memory object. But you can have them in many cases when you need to. We could have formats where we need more than two memory objects. They support up to four of them, I think, in the frame buffer API. Yep? So when you say format, do you literally mean it's RGBA? It's YUV? Exactly. So it's not simply the case that it's single buffer, multi-buffer, or whatever? It's really RGB 16-bit with 565, things like that. So it's a format identifier that we have in the API in there. So yeah, we support up to four memory objects. They showed here as GAM objects. So GAM stands for Graphical Execution Manager. That's where it comes from. But nowadays, in the embedded world, we use GAM as a memory manager. It has no relationship with any kind of graphics execution. So when I'm talking about GAM objects, that's a memory object that's handled by the KMS API and by the DRM API. We have options to have different kind of memory objects, but we'll not go into that because that's never used in embedded drivers nowadays. And there's no reason for that, anyway. So a GAM object, that's really the piece of memory. It's a linear piece of memory, at least from a virtual point of view, virtual memory point of view. It also has a size. It has a number of bits per pixel. It has a pitch.  And several of those GAM objects are used to create a frame buffer. Briefly talk about handles. So when the kernel driver will allocate the memory for you. So user space will ask for memory to be located depending on user space needs. And then allocation is performed by the driver. When a GAM object is allocated by a driver on behalf of an application, the application has control on that object. But sometimes you want to actually share that object between several applications. Like you have an application that will allocate memory for a texture. You want to pass that to another application so that it will be filled. So you need to be able to share those pieces of memory between the applications. And you also need to share them between different drivers. So when you create a GAM object in the kernel, you have local handle that's available to your application that's just a number that's referenced the buffer. And then you can export that as global handle. So application can request a global handle that's a file descriptor that's created behind a scene for a given GAM object. And when it gets that, the application can send the file descriptor to a separate application over a unique socket. So there's an API to do that. Because the file descriptor is just an integer that's local to an application. You can just send the integer value that will not work. And one added benefit of that API is that it's not possible for the other application to just guess the ID of the buffer. It needs to receive it explicitly. So we have embedded security in there, which means that if you have a buffer that you don't want to have exposed to any application that will contain sensitive data. And by sensitive data and graphics, we're just talking about copyrighted data, unfortunately. I mean, I don't really care about that myself. But if we design an API that don't support that kind of use cases, then the industry will not use it. So it's not possible for only use the PACE process to just go and access a buffer it doesn't have access to. It needs to be explicitly allowed to do that by sending the buffer ID and the buffer handle to the application. And then the second process then can go back to the kernel and give the file descriptor to kernel driver and get back a local handle that it can use in all the APIs. Briefly talk about the modes as well, the way we represent the mode. When you have a video that's displayed, you have horizontal and vertical synchronization signals. So you have a number of lines, a number of pixel lines. And at the beginning of the line, you will have a synchronization pulse over here. Then you have a viable delay, the start of the active area, then a viable inactive area here, and then you go back to the next line. And it's the same for vertical synchronization signals. So we have the sync area. We have a delay that's called the back porch, because at the back of the sync, we have the active area of the image, and we have the front porch. Because if you think about it, the synchronization signals is produced here as well. So the front porch is actually right in the front of the synchronization signal. That's more or less what a display mode is. The way we represent that in KMS is that we actually move things around a bit.  And we have four values that are used to represent the mode. So you have the width of the active area, the position of the synchronization pulse start and end, and the total number of pixel cloud pulses that you have on a single line. It's the same for the vertical synchronization. And then last part of the model in the API that is exposed, and we need to understand, is the mode setting API. KMS is about mode setting, so that's really the core of it. Mode setting is about taking a frame buffer with X and Y offsets inside the frame buffer with an eighth of an active area in there, giving that to a CRTC to be scanned out on one or more connectors. And those connectors should be configured with a given video mode. So that's what the mode setting API does. You give all that information from user space and the driver needs to do the rest. And we'll now see how the driver actually handles that. There's documentation inside the kernel, documentation.book directory. It's not complete. It's better than it was a year ago because there was nothing a year ago, so the synchronization is definitely much better now. If you're going to write a KMS driver, read that documentation, try to write the code, and if there's something that's in clean the documentation, something that's incomplete, if you need to actually have a look in the code in the DRM car or in example drivers, then please contribute it to the documentation. If the documentation isn't clean enough, I mean, I've been working on KMS for some time now. There are things I know and understand because I'm familiar with them, but they might not be clear from the documentation. So if they're not clear for you, please tell me, send a patch if possible, or just tell me that there's something that's not good with the documentation and I will try to help with that. I'm going to dive into the code now. That's going to be the boring part of the talk. Well, I hope you're not bored yet, otherwise this will be terrible. I've omitted locking and handling because otherwise it would be completely unreadable. Don't do that in your code. Have a look at the drivers that we have in the kernel if you want to see how errors are managed, how we need to handle locking. It's mentioned documentation as well. So just a couple of conventions. Every function that will start by DRM and this car, that's part of DRM car. Every function that will start by our car, DU, that's the driver I've used as a basis for this presentation, that's Renes' display unit driver, that's specific to the driver so that you know what part of the code is implemented in the DRM car and what part is implemented in the driver itself. So we all start, well, you get your kernel module. Your kernel module is initialized. It probes your platform device. We're talking about embedded devices here so I'll talk about the platform device case only. Obviously the support for PCI and USB-CMS devices as well in the kernel, but that's not the topic of this talk here.  In those functions, you just have to call DRM platform unit and DRM platform exit and that's it. So that's pretty easy. And you give to those functions a pointer to a structure that's a struct DRM driver and that will contain all information that DRM will need to actually process all the use space calls and forward that to your driver. So let's get to that DRM driver structure. There's lots of fields. I'm going to present them as they used. There's a couple of starting information first. There's a flag field that is used to tell the DRM car what your driver needs and what it can do. So your driver probably needs to have an interrupt. Otherwise it's a bit difficult to react to vertical blanking even so that's more or something that you always need to do. You want to tell that your driver use the GEM marry manager because there's no point in using another one. You want to tell that your driver can do mode setting. It's not an old legacy driver with the user space access to the hardware from the Xserver. So you're using mode setting. And you also want to tell that it's using the prime API. The prime API is the API I talked about to that allows sharing buffers between different applications and different drivers.  The date is actually supposed to tell user space, report it to user space and it's supposed to tell when the last update to the driver happened. We all know that's something that you just write in your driver the first time and then you always forget to update the date. So it's more or less pointless. Nowadays it just tells when the driver was treated for the first time. You get a major, minor and patch level version number. Patch level, that's something you always forget. To update as well. Major and minor are actually useful because the version of the driver API exposed to user space can change. So you have the KMS standard API but you allow to expose private driver your controls. And at some point you might decide that you need a new version of those. So you need to increase your minor number when you make additions to your driver specific API. So the user space will know about that. And you want to increase your major number when you make modifications that are completely incompatible with the previous version. And the DRM car will handle that is a code to use from user spacing. I want to use this API version and the DRM car will handle that for you. Then you have the file operations. They're all that's quite, usually that's quite easy in this case actually. So in the DRM driver structure you have a pointer to file operations. And if you look at them, most of them except the last one, they're calling DRM car functions. So you allow to override that. You allow to use your own functions if you need to. But except maybe for the compatibility control that's used for 32 and 64 bit compatibility, you shouldn't need to do that. And even that, I mean, that problem, we will need to wait from ARM 64 to be you, who's KMS drivers before that's really useful. That's just the M-Map file operation that you will need to implement yourself. We'll get to that. Then you have the load function. That's the main entry point of your driver. That's something that the DRM car will call. So when we call the DRM platform in it, it will perform a couple of initialization and call your load function. So that's a bit like your probe function in a non-KMS driver. And in there you will do all your driver, your device specific initialization. You need to locate memory for your device, device private data. You need to get the memory sources, the clocks, the regulators, everything that your device needs. That's where it's handled. That's pretty boring. That's definitely device specific. So I won't go into details of what needs to be done there. And you just start a pointer to your private data inside the depth private field of the DRM device. Then you want to handle IQ registration. There's a helper function that helps you doing that in DRM. It will get the IQ resource for the platform resources. It will perform a couple of steps. So you just want to call DRM IQ install. And that will do all the magic. There's a caveat in that. If you have more than one interrupt that's needed by your driver, you need to do it yourself. So that only supports a single interrupt. You also have pre-installed and post-installed callback functions that can be used while as the name implies before and after installing the IQ handler. And in pre-installed, the optional, if you use pre-installed, you should make sure that you will clear like interrupt flags there so that you will not have any spurious interrupts that will be triggered. And in post-installed, you usually want to enable the interrupts if needed. And it's obviously the IQ handler that you need to provide. Then we go, we're going to the mode configuration initialization. So KMS is about mode setting. And you need to call the DRM mode config init function. That's going to initialize while mostly all the lists, mutixes, everything that's needed by KMS internally. Just have to add that and you have to fill a couple of fields with the minimum and maximum size of the frame buffers that you can support. So that's specific to your hardware, you should know about that. And you also need to provide a pointer to a structure with mode config functions. And there's only one that I'm going to talk about here. That's the fbcreate function that is used to create a frame buffer. So from user space application, we'll ask the driver to create a frame buffer because it will want to put data in there and push that to the display. And that's a function that's called to create that frame buffer. And I'll explain how that works. We're using GEM and because of that, we have to fill the mmap file operation and two driver functions, callback functions, to free GEM object. And the other one is not function, it's actually a pointer to a structure with VM virtual memory operations. That's something you need to implement yourself, except if you can live with the helpers that we have in the kernel in KMS. We have lots of helper layers that handles the complex tasks in most cases. So in most embedded cases, you will want to locate your memory buffers contiguously in memory, at least contiguously in the device memory space if you have an IUMMU. And in that case, we have the DRM GEM CMA helper layer that handles all the memory management for you. So you just give the pointer to destruction and the functions from the GEM CMA helper. CMA stands for contiguous memory allocation, but there's actually nothing that's specific in there to the CMA API. So behind the scene, it uses DMA unlock right combine. And if you want that kind of memory buffers, that's what you want to use. If you have a more complex hardware with different requirements on memory management, then you will have to implement that yourself. But in most cases, that's really the simplest solution. GEM has support for dump objects as well. So if we look back at the previous slide, you see that the operations can actually free an object, map it to user space, but there's no operation to allocate the object. That's because memory allocation was left to driver-specific APIs. The reason for that is, was that on the desktop world, the memory allocation requirements really varied between the different devices. So that was left to a device-specific API. But then we realized that there was a caveat with that, is that it was impossible to have a generic user space application that would be able to allocate memory. That's not really a problem when you have a complete graphics stack in user space with X away land, because you will have user space drivers for that. But when you have an early boot application that you want to display as touch screen, then you don't want in your early boot application to support all the different memory allocations API possible. So we've added in KMS a dumb memory buffer allocation API that can be used to locate a memory object that can be used as a frame buffer so that you can push that to the CRTC to be displayed. It cannot be used to allocate a memory buffer that's usable for OpenGL texture, for instance, but that's not the top topic of this talk. So we have those three functions that are handled by the game CMA helpers to allocate the memory for you.  So there's no need to add anything there. Last topic about game memory allocation. So that's something I mentioned, the prime API to be able to share buffers. There are two functions that you need to implement. They call prime handle to FD and FD to handle to convert local handle to global FD and global FD to a local handle. When you're using game objects, you just use two helper functions here. We'll always use game objects, so that's just the function that you need to use. And those two functions will use, will call the game prime import and game prime export functions that also provided by the game CMA helpers. So all that is heavy for you. So if we summarize that, allocation of the buffers, mapping them to user space, freeing them, exporting them, that's all handled by the helpers and there's nothing you have to do for the memory management. Frame buffer creation. So the FB create function, that's something that you need to implement in your driver. And what you need to do in there, when user space will request a frame buffer creation, then it will pass several parameters like a frame buffer size, pitches, things like that. And you need to validate that. If user space asks for YUV frame buffer and your hardware canal and URGB, you need to validate that and return an error there. That's something that's driver-specific. So you need to implement that. And when you're done validating the information, you can just call the DRM FB CMA create. That's a helper function that's also provided by the game CMA helper and that will create the frame buffer for you with game CMA objects behind the scene. So all you need to do to create a frame buffer is to validate the parameters to make sure that they will work with your hardware and that's it. Now we're getting to the CRTC. So the CRTC is the main piece of the display controller that will handle the scan out of the frame buffer to the display. You need at least one CRTC per driver. If there's no CRTC, there's nothing you can do with your device anyway. So you need at least one. You need to create the CRTC. You can dynamically allocate that. You can embed that in a bigger structure. It can be embedded in your driver private data, whatever, but you need to have a pointer to your DRM CRTC and initialize that and pass a pointer to a structure with CRTC functions. So the first one, I mentioned the other one afterwards, the first one is the destroy function. KMS manages the life, the lifetime and the life cycle of all the objects I mentioned. So your driver doesn't need to care about reference counting the object itself. That's KMS job. That's a core job. And when an object is not needed anymore, then the destroy function will be called. So there's a function provided by the core that's just DRM CRTC cleanup that will perform the exact opposite of DRM CRTC init function. If your CRTC is embedded in a bigger structure and you want to free that or you want to clean up anything you've done at any time, then you can provide your own function and call DRM CRTC cleanup yourself. The encoders, well, it's pretty similar. You initialize your encoder with functions. There's a destroy function. The encoders has a list of possible CRTC it can be connected to. So you have a single CRTC, a single encoder, it's pretty easy. When you have multiple of them, you just have to tell, okay, this encoder on the board can be connected to only the first CRTC or the first and the second CRTC. That's just a big mask of the CRTCs. And you have to tell about the encoder type. So in this case, that's for a VG encoder. So it's a digital to another converter. And there's a list of types that are defined in the API. And then you have to initialize your connectors. So you also have a connector init function. You have connector functions that you need to provide. And it's a bit more complex for the connector because you need to attach that to an encoder. So every connector needs to be attached to one or several encoders. Otherwise, if it's not attached to anything, it's just useless. When you have a simple hardware with one-to-one mapping between encoders and connectors, like you have this encoder that's always connected to one connector, then that's pretty easy. You can just attach them at initialization time. If you have one connector that can actually be attached to different encoders, not at the same time, obviously, then you need to manage that at runtime. Mode setting, then. That's the most interesting part. So as I mentioned, mode setting is about telling a CRTC, he's a frame buffer that I want you to scan out. He's an offset inside the frame buffer and here's the mode that I want to have on the connectors. So there's a single function in the CRTC function that's called set config that takes the DRM mode set structure pointer and that lists all those information. It's fairly complex actually because you need in your hardware, in your driver, to validate all the parameters, to handle the states of the CRTC, the encoder, all the pieces of the hardware. And yeah, that's something that can be a big piece of code. But in most of the cases, we can actually break that in simple operations and we have a helper layer inside KMS that can be used to do that. So you can use the DRM CRTC helper set config function as a handler for the set configuration and then you just need to install by calling the helper add functions for the CRTC connector and encoder, helper function callbacks. You can just use the helpers for the CRTC and the encoder and not the connector. It's either all of them or none of them but if you use that helper function and you should use that otherwise it's really pretty complex. You need to install the helper functions and all of all of those. The helper functions on the CRTC side is quite a couple of them. The first one will be mode fix up. Use a space one to display that mode and kind of hardware support that. So that's what the function does. It will take the mode as a parameter and check if it can be supported by a CRTC. If it cannot, it's rejected. If it can but with minor tweaks like pixel clock frequency modification and things like that, then the mode will be fixed up. It will modify slightly. When that's done, the prepare function of the CRTC is called and that's really device specific. That's why you should perform a device specific operation that needs to be done before setting the mode and usually that's disabling the CRTC and the output. Then we have the mode set function that is called with a new mode. That's why you reprogram the hardware and there's the commit function that is called at the end where you should apply all the settings to the hardware and just enable the CRTC again and then you will have your new mode set up. There's a mode set based function that is a simpler version of mode set and that's used when you don't want to do a complete mode set but just want to change the frame buffer. So you have a bigger frame buffer and you want to pan into that. If you want to just change the offset, there's no need to disable the output and re-enable that, that would just make the screen flicker. And so mode set based in that case is called and prepare and commit functions are not called. So it just sets the offset, the base address in memory from which you want to scan out. And lastly, there's the disable function that's called to disable the CRTC. So when you use the space when to disable the output, that's a function that it gets called. So all that needs to be implemented in driver. It's usually simple code at least for most of them. The mode set function that will reprogram all the register that might be a bit complex depending on your hardware complexity but it still splits into fairly simple functions. Then you also have those helper functions for the encoder and for the connector. There's also a mode fix up function for the encoder because the encoder can have different mode requirements as a CRTC. There's a prepare and commit function and a mode set function. And for the connector, they're just a best encoder function. If we go back to the mode set API, you see that there's a list of connectors that are given. And so your driver needs to find out which encoder to use between the CRTC and the connectors that you want to use. And that's what the best encoder function will do. In most cases, when you connect are just connected to a single encoder, you return a pointer to that encoder and you're done. Mode setting is nice, but you also want to discover the modes. You want to be able to list from user space the mode as supported by your display. And that's done by a connector function because modes are handled at the connector level. That's where you display is plugged in. And that's a fill mode function. So the fill mode function will take a pointer to the connector, a maximum within eight. So it needs to filter all the modes that are larger than that in fill the connector structure with the list of the different modes that are supported. There's also a helper for that. You can use the DLM helper probe single connector modes. That's a bit long. And provide two helper functions. Get modes that will give a list of all the modes supported by your display. And then the car will handle all the filtering for all the features that are all the modes that are bigger than maximum size or not supported for different reasons. And then there's a mode valid function that is used to actually validate a mode that you want to set and make sure that the connector can use that. So that's pretty simple as well. DPMS is about power management and display. So that's a pretty old standard that defined four different power managed power states for the display device. So you have the on state that's pretty easy. You have the off state that's easy as well. It's completely off. It draws the least possible power. And you have two intermediate states that are standby in suspense state. They draw less power than on. So the power consumption decreases when you go down. But the time it takes to recover from standby or suspend or off increases when you go down as well. So when you displays off, the specification actually allows, I think it was the original version up to 10 or 30 seconds for the display to come up, which is according to today's standards, that's insane. So we still have those four power states in the API and that's handled at a connector level. So from user space, you want to tell, okay, on this connector for this screen, I want to put it in standby or suspend. I want to turn it on and off. And there's a function that you need to implement there. But that function will lead to touch the encoder connected to the connector. And also the CRTC.  So there's a helper layer for that as well. There's a function called dnm helper connector dpms. You should use that. And that relies on dpms callbacks on both the CRTC and on the encoder. So the function will, for instance, if you have two encoders connected to one CRTC, so you have cloned displays, you want to turn one of them off, you still want the other to be on. You turn the second one off, then at that point you can disable completely your display device. And that's what the core handles. It will check what's used in the whole pipeline and then call the two callback functions to set the power state on the encoders and on the CRTCs. Vertical blanking, that allows tier three rendering, so it's pretty important. That needs to be initialized at load time and it takes the number of CRTCs available in your device. Then in your interrupt handler, you need to call dnhandle vblank with the CRTC number and that will account for the vblank interrupt. Counting vblank interrupts sounds like something pretty simple, but you need to make sure that it's race free, that you will handle the counter wraparounds. There are many small caveats that actually make it pretty complex. So the dnhandle handles that for you and you just have to call this dnhandle vblank function. And there are three functions that you need to implement in your driver. There's the enable vblank, disable vblank that will enable and disable the vertical blanking interrupt. And there's the get vblank counter. So if your hardware has a hardware vblank counter, that's the function you need to implement to return the value of the counter. If it doesn't, you just use the dnhandle vblank count function as the handler and that will handle everything for you behind the scene and count the interrupt. Pitch flipping is taking another piece of memory, giving it to the CRTC to replace the frame buffer being scanned out. And you want that to be down at the vertical blanking time so that you get no tearing on the screen. So the page flip function is the function that you need to implement to set a new frame buffer for the CRTC. It takes a pointer to the new frame buffer you want to use, pointer to CRTC and a pointer to a vblank event. If there's already a page flip queued, then you need to tell I'm busy. The KMS API only supports queuing one page flip and you need to wait until it's down before queuing the other one. Then you do whatever you need for your device to handle that. And if there's an event supply by the application, then you enable the vblanking interrupt to report the page flip complication to user space when it will be done. So page flip complication will be down at interrupt time. So when you get your vblank interrupt, you have to implement a piece of code that will fill the event structure with a sequence number. There's a helper function to get that, timestamp also from the helper function. Then you add that to a list of event, wake up the call and then disable the vertical blanking interrupts. All the vertical blanking interrupts are reference counted. So the dmvblank get and put can be called from your driver from the dmcar and you will only be asked to enable and disable the interrupt when there's no user or when there's a new user. Planes, that's the last topic I think. So it's a bit similar to the CRTC frame buffer API. You create a plane. You give it a list of CRTC it can be associated with. That's a bit mask. You give it function pointers and a list of formats that the plane can support. So that's really the list of all the formats that are defined by DRAM and that you hardly can use. Then you need to provide three callback functions. There's still a destroyer function as pretty usual and a plane update and plane disable functions. Plane update is the function that is called when you want to, when you space want to enable a plane, want to enable an overlay or change the overlay parameters. It takes lots of parameters. It takes the plane, the CRTC, the frame buffer. It takes enough sets in the CRTC with an A. It takes enough sets in the frame buffer with an A as well so it can handle scaling. And then you just need to program your hardware to do that. There's a plane disable function that's called when user space want to turn off an overlay and you just have to turn it out there. There's much more than that. I haven't mentioned the properties. Properties are an API that can be used to expose any kind of device-specific properties to user space. So that's how you can extend a KMS API. There's an FB dev emulation layer I haven't mentioned. There's a connector status polling system that I haven't mentioned either. That can be used to report hot plugins to user space. There's an atomic page flip API that can be used to actually do page flip on CRTC and on planes at the same time. Otherwise, when you have an overlay that's moving inside your main frame buffer and you want to grow a border around that so you have your overlay that displays the video and the border is displayed on the main frame buffer. You need to keep them in sync. If you don't do that atomically, then they will move slightly. So all that is not mentioned is though. Some part of those topics are available in documentation I mentioned, not all of them because we need to complete the documentation. So if you're using any of those and if there's no documentation, please send a patch. What's coming next? Well, there's one pretty important topic which is the generic display framework. It started a generic panel framework to have a single framework to expose the single API so that you can write panel drivers in a device-independent way. It grew more or less in a generic display framework that can be used to support not only panels but encoders as well and different pieces of hardware than you have in your display pipeline. It's still not done yet. There's a buff session tomorrow at 4 p.m. So if you're interested in that, Jesse's has been kind enough to organize that so that will be just brainstorming and getting feedback from everybody to make sure that all the use cases we have will be supported. In a nutshell, yeah, 30 seconds. That's the idea behind the display framework. So you have a single panel driver that needs to communicate with the display controller that has an underlying control bus that it uses to talk with the panel. It gets video from the display controller so it needs to control the video stream as well. And so it sits in the middle of lots of blocks and we want to make something that extensible that will cover the panel use cases but also the encoder use cases when you have a more complex chain with really a display panel at the end but different encoders in the chain. All that needs to be handled somehow as well. Most of the use cases I've been told about are more theoretical use cases. Some of them are real. We're not sure yet how complex we'll make DEPR at the moment so that's something that will be discussed tomorrow. Contact information, mailing list, my email address.